Class ASPBodyElement

  • 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
    Direct Known Subclasses:
    AggregateAtom, ASPLiteral, ComparativeAtom, DefaultNegation

    public abstract class ASPBodyElement
    extends ASPElement
    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)
    Note: In the ASP-Core-2 standard, the formulas represented by this class are also referred to as 'Literals'. In the Tweety ASP library, literals are only atoms or the strict negations of atoms.
    Author:
    Tim Janus, Anna Gessler
    • Constructor Detail

      • ASPBodyElement

        public ASPBodyElement()
    • Method Detail

      • getLiterals

        public abstract SortedSet<ASPLiteral> 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

        public abstract ASPBodyElement 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 ASPElement