Class AggregateElement

  • 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 AggregateElement
    extends ASPElement
    This class models an aggregate element, meaning a set of terms and a set of naf literals (= literals or default negated literals). One or more aggregate elements form an aggregate or aggregate atom.
    Author:
    Anna Gessler
    See Also:
    AggregateAtom
    • Constructor Detail

      • AggregateElement

        public AggregateElement​(List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> l,
                                List<ASPBodyElement> r)
        Creates a new Aggregate Element with the given list of terms and the given list of naf literals.
        Parameters:
        l - a list of terms
        r - a list of body elements
      • AggregateElement

        public AggregateElement​(AggregateElement other)
        Copy-Constructor
        Parameters:
        other - another AggregateElement
    • Method Detail

      • isLiteral

        public boolean isLiteral()
      • getTerms

        public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
      • getTerms

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms​(Class<C> cls)
      • 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 AggregateElement 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
      • 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 AggregateElement 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
      • getLeft

        public List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getLeft()
        Returns the left part of the Aggregate element.
        Returns:
        list of terms
      • getRight

        public List<ASPBodyElement> getRight()
        Returns the right part of the Aggregate element.
        Returns:
        list of naf literals (= literals or default negated literals)