Class ASPHead

  • All Implemented Interfaces:
    Iterable<ASPLiteral>, Collection<ASPLiteral>, List<ASPLiteral>, net.sf.tweety.commons.Formula, net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge, net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<ASPLiteral>, net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula, net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable, net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure, net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula

    public class ASPHead
    extends ASPElement
    implements net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<ASPLiteral>, net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable, net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
    This formula represents the head of an disjunctive rule which is a disjunction of literals.
    Author:
    Tim Janus, Anna Gessler
    • Constructor Detail

      • ASPHead

        public ASPHead()
        Empty Constructor.
      • ASPHead

        public ASPHead​(List<ASPLiteral> head_elements)
        Creates a new head with the given elements.
        Parameters:
        head_elements - list of literals
      • ASPHead

        public ASPHead​(ASPLiteral head)
        Creates a new head with a single element.
        Parameters:
        head - an ASP literal
      • ASPHead

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

      • isGround

        public boolean isGround()
        Specified by:
        isGround in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Overrides:
        isGround in class ASPElement
      • isWellFormed

        public boolean isWellFormed()
        Specified by:
        isWellFormed in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Overrides:
        isWellFormed 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()
        Specified by:
        isLiteral in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • getTerms

        public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
        Specified by:
        getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
      • getTerms

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms​(Class<C> cls)
        Specified by:
        getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
      • containsTermsOfType

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> boolean containsTermsOfType​(Class<C> cls)
        Specified by:
        containsTermsOfType in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
        Overrides:
        containsTermsOfType in class ASPElement
      • 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 ASPHead 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 ASPHead 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
      • getFormulas

        public List<ASPLiteral> getFormulas()
        Specified by:
        getFormulas in interface net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<ASPLiteral>
      • getFormulas

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula> Set<C> getFormulas​(Class<C> cls)
        Specified by:
        getFormulas in interface net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<ASPLiteral>
      • createEmptyFormula

        public ASPHead createEmptyFormula()
        Specified by:
        createEmptyFormula in interface net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
      • createEmptySignature

        public net.sf.tweety.logics.fol.syntax.FolSignature createEmptySignature()
        Specified by:
        createEmptySignature in interface net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
      • getOperatorSymbol

        public String getOperatorSymbol()
        Specified by:
        getOperatorSymbol in interface net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
      • getEmptySymbol

        public String getEmptySymbol()
        Specified by:
        getEmptySymbol in interface net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
      • combineWithOr

        public net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula combineWithOr​(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable f)
        Specified by:
        combineWithOr in interface net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable
      • substitute

        public ASPHead substitute​(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> map)
                           throws IllegalArgumentException
        Specified by:
        substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Overrides:
        substitute in class ASPElement
        Throws:
        IllegalArgumentException
      • exchange

        public ASPHead exchange​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
                                net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
                         throws IllegalArgumentException
        Specified by:
        exchange in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Overrides:
        exchange in class ASPElement
        Throws:
        IllegalArgumentException
      • getLiterals

        public 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