public class ASPRule extends ASPElement implements net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>, Comparable<ASPRule>
| Constructor and Description |
|---|
ASPRule()
Empty constructor
|
ASPRule(ASPHead head)
Creates a fact with the given ASPHead.
|
ASPRule(ASPHead head,
List<ASPBodyElement> body)
Creates a rule with the given head and body.
|
ASPRule(ASPLiteral literal)
Creates a fact with the given literal.
|
ASPRule(ASPLiteral head,
ASPBodyElement b)
Creates a rule with the given head and a single-element body.
|
ASPRule(ASPLiteral head,
List<ASPBodyElement> body)
Creates a rule with the given head and body.
|
ASPRule(ASPRule other)
Copy-Constructor
|
ASPRule(List<ASPBodyElement> body)
Creates a constraint with the given body.
|
ASPRule(List<ASPBodyElement> nafliterals,
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> weight,
List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)
Creates a constraint with the given weight and terms.
|
ASPRule(List<ASPBodyElement> body,
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> weight,
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> level,
List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)
Creates a constraint with the given weight, level and terms.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPremise(ASPBodyElement premise) |
void |
addPremises(Collection<? extends ASPBodyElement> premises) |
void |
addToHead(ASPLiteral h) |
ASPRule |
clone() |
int |
compareTo(ASPRule arg0) |
boolean |
equals(Object other) |
ASPRule |
exchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) |
Set<ASPAtom> |
getAtoms() |
List<ASPBodyElement> |
getBody() |
ASPHead |
getConclusion() |
List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> |
getConstraintTerms() |
ASPHead |
getHead() |
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> |
getLevel() |
Collection<? extends ASPLiteral> |
getLiterals() |
Set<net.sf.tweety.logics.commons.syntax.Predicate> |
getPredicates() |
List<ASPBodyElement> |
getPremise() |
net.sf.tweety.logics.fol.syntax.FolSignature |
getSignature() |
Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> |
getTerms() |
<C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> |
getTerms(Class<C> cls) |
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> |
getWeight() |
int |
hashCode() |
boolean |
isConstraint() |
boolean |
isEmpty() |
boolean |
isFact() |
boolean |
isGround() |
boolean |
isLiteral() |
Boolean |
isSafe()
This methods tests a rule for safety.
|
void |
setBody(List<ASPBodyElement> body) |
void |
setConclusion(ASPHead conclusion) |
void |
setConclusion(ASPLiteral head) |
void |
setHead(ASPHead head) |
void |
setLevel(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> level) |
void |
setWeight(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> weight) |
ASPRule |
substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) |
String |
toString() |
containsTermsOfType, getPredicateCls, isWellFormed, substitutepublic ASPRule()
public ASPRule(ASPHead head)
head - public ASPRule(ASPLiteral literal)
literal - public ASPRule(ASPHead head, List<ASPBodyElement> body)
head - body - public ASPRule(ASPLiteral head, ASPBodyElement b)
head - b - a body elementpublic ASPRule(ASPLiteral head, List<ASPBodyElement> body)
head - body - public ASPRule(List<ASPBodyElement> body)
body - public ASPRule(List<ASPBodyElement> nafliterals, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> weight, List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)
nafliterals - weight - terms - public ASPRule(List<ASPBodyElement> body, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> weight, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> level, List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)
body - weight - level - wal - public ASPRule(ASPRule other)
other - public Boolean isSafe()
public boolean isFact()
isFact in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>public boolean isConstraint()
isConstraint in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>public void addPremises(Collection<? extends ASPBodyElement> premises)
addPremises in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
getSignature in interface net.sf.tweety.commons.FormulagetSignature in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>getSignature in class ASPElementpublic void setConclusion(ASPHead conclusion)
setConclusion in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>public void setConclusion(ASPLiteral head)
public void addPremise(ASPBodyElement premise)
addPremise in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>public List<ASPBodyElement> getPremise()
getPremise in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>public ASPHead getConclusion()
getConclusion in interface net.sf.tweety.commons.util.rules.Rule<ASPHead,ASPBodyElement>public net.sf.tweety.logics.commons.syntax.interfaces.Term<?> getWeight()
public void setWeight(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> weight)
public net.sf.tweety.logics.commons.syntax.interfaces.Term<?> getLevel()
public void setLevel(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> level)
public ASPHead getHead()
public void setHead(ASPHead head)
public void addToHead(ASPLiteral h)
public List<ASPBodyElement> getBody()
public void setBody(List<ASPBodyElement> body)
public List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getConstraintTerms()
public boolean isGround()
isGround in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormulaisGround in class ASPElementpublic int compareTo(ASPRule arg0)
compareTo in interface Comparable<ASPRule>public Collection<? extends ASPLiteral> getLiterals()
public ASPRule substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormulasubstitute in class ASPElementpublic ASPRule exchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
exchange in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormulaexchange in class ASPElementpublic boolean isLiteral()
isLiteral in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormulapublic Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructurepublic <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms(Class<C> cls)
getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructurepublic Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
getPredicates in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormulagetPredicates in class ASPElementpublic Set<ASPAtom> getAtoms()
getAtoms in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormulagetAtoms in class ASPElementpublic ASPRule clone()
clone in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormulaclone in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormulaclone in class ASPElementpublic boolean equals(Object other)
public int hashCode()
public boolean isEmpty()
Copyright © 2019. All rights reserved.