Package net.sf.tweety.lp.asp.syntax
Class ComparativeAtom
- java.lang.Object
-
- net.sf.tweety.lp.asp.syntax.ASPElement
-
- net.sf.tweety.lp.asp.syntax.ASPBodyElement
-
- net.sf.tweety.lp.asp.syntax.ComparativeAtom
-
- All Implemented Interfaces:
net.sf.tweety.commons.Formula,net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure,net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
public class ComparativeAtom extends ASPBodyElement
This class represents a comparative atom, meaning an expression of the form t x u where t,u are terms and x is in {<, <=, ==, !=, >, >=}. Comparatives are called "Built-in atoms" in the ASP-Core-2 standard.- Author:
- Tim Janus, Thomas Vengels, Anna Gessler
-
-
Constructor Summary
Constructors Constructor Description ComparativeAtom(ASPOperator.BinaryOperator op, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> left, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> right)ComparativeAtom(ComparativeAtom other)Copy-Constructor
-
Method Summary
Modifier and Type Method Description ASPBodyElementclone()booleanequals(Object obj)Set<ASPAtom>getAtoms()net.sf.tweety.logics.commons.syntax.interfaces.Term<?>getLeft()Returns the left (first) term of the comparative atom.SortedSet<ASPLiteral>getLiterals()Returns all literals in this element in form of a SortedSet.ASPOperator.BinaryOperatorgetOperator()Returns the comparative operator of the atom.Class<? extends net.sf.tweety.logics.commons.syntax.Predicate>getPredicateCls()Set<net.sf.tweety.logics.commons.syntax.Predicate>getPredicates()net.sf.tweety.logics.commons.syntax.interfaces.Term<?>getRight()Returns the right (second) term of the comparative atom.net.sf.tweety.logics.fol.syntax.FolSignaturegetSignature()Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>getTerms()<C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>
Set<C>getTerms(Class<C> cls)inthashCode()booleanisLiteral()ComparativeAtomsubstitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v)StringtoString()-
Methods inherited from class net.sf.tweety.lp.asp.syntax.ASPElement
containsTermsOfType, exchange, isGround, isWellFormed, substitute
-
-
-
-
Constructor Detail
-
ComparativeAtom
public ComparativeAtom(ASPOperator.BinaryOperator op, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> left, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> right)
-
ComparativeAtom
public ComparativeAtom(ComparativeAtom other)
Copy-Constructor- Parameters:
other- another ComparativeAtom
-
-
Method Detail
-
getLiterals
public SortedSet<ASPLiteral> getLiterals()
Description copied from class:ASPBodyElementReturns all literals in this element in form of a SortedSet. Literals are atoms or strict negations of atoms.- Specified by:
getLiteralsin classASPBodyElement- Returns:
- all the literals used in the rule element
-
getPredicates
public Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
- Specified by:
getPredicatesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getPredicatesin classASPElement
-
getAtoms
public Set<ASPAtom> getAtoms()
- Specified by:
getAtomsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getAtomsin classASPElement
-
substitute
public ComparativeAtom substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v)
- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
substitutein classASPBodyElement
-
getSignature
public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
- Specified by:
getSignaturein interfacenet.sf.tweety.commons.Formula- Specified by:
getSignaturein classASPElement
-
clone
public ASPBodyElement clone()
- Specified by:
clonein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
clonein interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
clonein classASPElement
-
getPredicateCls
public Class<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicateCls()
- Specified by:
getPredicateClsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Overrides:
getPredicateClsin classASPElement
-
isLiteral
public boolean isLiteral()
-
getTerms
public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
-
getOperator
public ASPOperator.BinaryOperator getOperator()
Returns the comparative operator of the atom.- Returns:
- the comparative operator of the atom.
-
getLeft
public net.sf.tweety.logics.commons.syntax.interfaces.Term<?> getLeft()
Returns the left (first) term of the comparative atom.- Returns:
- the left (first) term of the comparative atom.
-
getRight
public net.sf.tweety.logics.commons.syntax.interfaces.Term<?> getRight()
Returns the right (second) term of the comparative atom.- Returns:
- the right (second) term of the comparative atom.
-
getTerms
public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms(Class<C> cls)
-
hashCode
public int hashCode()
-
-