Package org.tweetyproject.lp.asp.syntax
Class ASPLiteral
java.lang.Object
org.tweetyproject.lp.asp.syntax.ASPElement
org.tweetyproject.lp.asp.syntax.ASPBodyElement
org.tweetyproject.lp.asp.syntax.ASPLiteral
- All Implemented Interfaces:
Comparable<ASPLiteral>
,Formula
,Atom
,ComplexLogicalFormula
,Invertable
,LogicStructure
,SimpleLogicalFormula
- Direct Known Subclasses:
ASPAtom
,StrictNegation
public abstract class ASPLiteral
extends ASPBodyElement
implements Atom, Invertable, Comparable<ASPLiteral>
This class defines common functionality for literals,
meaning atoms or strictly negated atoms. In the ASP-Core-2
standard, the formulas represented by this class are
referred to as 'classical atoms'.
- Author:
- Anna Gessler, Tim Janus
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.Atom
Atom.AtomImpl, Atom.RETURN_SET_PREDICATE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ASPLiteral
cloneWithAddedTerm
(Term<?> term) Creates a copy of the literal and adds the given term as argument to the end of the argument list.abstract ASPLiteral
abstract ASPAtom
getAtom()
Return The atom representing the literal.boolean
Methods inherited from class org.tweetyproject.lp.asp.syntax.ASPBodyElement
getLiterals, substitute
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.Atom
addArgument, getArguments, getName, getPredicate, isComplete, setPredicate
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.tweetyproject.commons.Formula
getSignature
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, getAtoms, getPredicateCls, getPredicates, hashCode
-
Constructor Details
-
ASPLiteral
public ASPLiteral()Default Constructor
-
-
Method Details
-
getAtom
Return The atom representing the literal.- Returns:
- The atom representing the literal.
-
cloneWithAddedTerm
Creates a copy of the literal and adds the given term as argument to the end of the argument list.- Parameters:
term
- the new argument.- Returns:
- A copy of the literal containing the given term as new argument.
-
isLiteral
public boolean isLiteral()- Specified by:
isLiteral
in interfaceSimpleLogicalFormula
- Returns:
- true if the formula represents a literal in the language or false otherwise
-
complement
- Specified by:
complement
in interfaceInvertable
- Returns:
- the complement of this formula.
-