Class 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 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: ASPBodyElement
        Returns all literals in this element in form of a SortedSet. Literals are atoms or strict negations of atoms.
        Specified by:
        getLiterals in class ASPBodyElement
        Returns:
        all the literals used in the rule element
      • getPredicates

        public Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
        Specified by:
        getPredicates in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        getPredicates in class ASPElement
      • getAtoms

        public Set<ASPAtom> getAtoms()
        Specified by:
        getAtoms in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        getAtoms in class ASPElement
      • substitute

        public ComparativeAtom substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t,
                                          net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v)
        Specified by:
        substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Specified by:
        substitute in class ASPBodyElement
      • getSignature

        public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
        Specified by:
        getSignature in interface net.sf.tweety.commons.Formula
        Specified by:
        getSignature in class ASPElement
      • clone

        public ASPBodyElement clone()
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        clone in class ASPElement
      • getPredicateCls

        public Class<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicateCls()
        Specified by:
        getPredicateCls in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        getPredicateCls in class ASPElement
      • 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()
        Specified by:
        hashCode in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object