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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SortedSet<ASPLiteral> Returns all literals in this element in form of a SortedSet.abstract ASPBodyElementsubstitute(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, substituteMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.LogicStructure
getTerms, getTermsMethods 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:ComplexLogicalFormulaSubstitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.- Specified by:
substitutein interfaceComplexLogicalFormula- Specified by:
substitutein 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".
-