Package org.tweetyproject.lp.asp.syntax
Class ASPBodyElement
java.lang.Object
org.tweetyproject.lp.asp.syntax.ASPElement
org.tweetyproject.lp.asp.syntax.ASPBodyElement
- All Implemented Interfaces:
Formula
,ComplexLogicalFormula
,LogicStructure
,SimpleLogicalFormula
- Direct Known Subclasses:
AggregateAtom
,ASPLiteral
,ComparativeAtom
,DefaultNegation
,OptimizationStatement
This class is a common base class for ASP formulas
that can be part of an ASP rule body (premise of a rule):
- Literals (i.e. atoms or strictly negated atoms)
- Built-in atoms (i.e. terms connected by comparative operators like == and !=)
- Aggregate atoms
- Default negations of literals or aggregates (i.e. 'not a' a for a literal or aggregate a)
- Author:
- Tim Janus, Anna Gessler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract SortedSet
<ASPLiteral> Returns all literals in this element in form of a SortedSet.abstract ASPBodyElement
substitute
(Term<?> t, Term<?> v) Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.Methods inherited from class org.tweetyproject.lp.asp.syntax.ASPElement
clone, containsTermsOfType, exchange, getAtoms, getPredicateCls, getPredicates, getSignature, isGround, isWellFormed, printToClingo, printToDLV, substitute
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.LogicStructure
getTerms, getTerms
Methods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.SimpleLogicalFormula
equals, hashCode, isLiteral
-
Constructor Details
-
ASPBodyElement
public ASPBodyElement()Default Constructor
-
-
Method Details
-
getLiterals
Returns all literals in this element in form of a SortedSet. Literals are atoms or strict negations of atoms.- Returns:
- all the literals used in the rule element
-
substitute
Description copied from interface:ComplexLogicalFormula
Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.- Specified by:
substitute
in interfaceComplexLogicalFormula
- Specified by:
substitute
in classASPElement
- Parameters:
t
- the term to be substituted.v
- the term to substitute.- Returns:
- a formula where every occurrence of "v" is replaced by "t".
-