Class ASPElement

    • Constructor Summary

      Constructors 
      Constructor Description
      ASPElement()  
    • Method Summary

      Modifier and Type Method Description
      abstract ASPElement clone()
      Creates a deep copy of this formula
      <C extends Term<?>>
      boolean
      containsTermsOfType​(java.lang.Class<C> cls)
      Checks if this logical structure contains at least one term of type C.
      ASPElement exchange​(Term<?> v, Term<?> t)
      Substitutes all occurrences of term "v" in this formula by term "t" and at the same time replaces all occurrences of term "t" by term "v" and eventually returns the new formula.
      abstract java.util.Set<ASPAtom> getAtoms()
      Processes the set of all atoms which appear in this formula
      java.lang.Class<? extends Predicate> getPredicateCls()  
      abstract java.util.Set<Predicate> getPredicates()
      Processes the set of all predicates which appear in this formula
      abstract FolSignature getSignature()
      Returns the signature of the language of this formula.
      boolean isGround()
      Checks whether this formula is ground, i.e.
      boolean isWellFormed()
      Checks if this formula is well formed in the logical langauge.
      ASPElement substitute​(java.util.Map<? extends Term<?>,​? extends Term<?>> map)
      Substitutes all occurrences of all terms "v" in map.keyset() in this formula by map.get(v) and returns the new formula.
      abstract ASPElement substitute​(Term<?> t, Term<?> v)
      Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ASPElement

        public ASPElement()
    • Method Detail

      • getPredicates

        public abstract java.util.Set<Predicate> getPredicates()
        Description copied from interface: SimpleLogicalFormula
        Processes the set of all predicates which appear in this formula
        Specified by:
        getPredicates in interface SimpleLogicalFormula
        Returns:
        all predicates that appear in this formula
      • substitute

        public abstract ASPElement substitute​(Term<?> t,
                                              Term<?> v)
        Description copied from interface: ComplexLogicalFormula
        Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.
        Specified by:
        substitute in interface ComplexLogicalFormula
        Parameters:
        t - the term to be substituted.
        v - the term to substitute.
        Returns:
        a formula where every occurrence of "v" is replaced by "t".
      • getSignature

        public abstract FolSignature getSignature()
        Description copied from interface: Formula
        Returns the signature of the language of this formula.
        Specified by:
        getSignature in interface Formula
        Returns:
        the signature of the language of this formula.
      • substitute

        public ASPElement substitute​(java.util.Map<? extends Term<?>,​? extends Term<?>> map)
                              throws java.lang.IllegalArgumentException
        Description copied from interface: ComplexLogicalFormula
        Substitutes all occurrences of all terms "v" in map.keyset() in this formula by map.get(v) and returns the new formula.
        Specified by:
        substitute in interface ComplexLogicalFormula
        Parameters:
        map - a mapping defining which terms to be substituted.
        Returns:
        a formula where every term in map.keyset() has been replaced by map.get(v).
        Throws:
        java.lang.IllegalArgumentException - if any term and its mapping are of different sorts
      • exchange

        public ASPElement exchange​(Term<?> v,
                                   Term<?> t)
                            throws java.lang.IllegalArgumentException
        Description copied from interface: ComplexLogicalFormula
        Substitutes all occurrences of term "v" in this formula by term "t" and at the same time replaces all occurrences of term "t" by term "v" and eventually returns the new formula.
        Specified by:
        exchange in interface ComplexLogicalFormula
        Parameters:
        v - a term.
        t - a term.
        Returns:
        a new logical formula with both "v" and "t" exchanged.
        Throws:
        java.lang.IllegalArgumentException - if "v" and "t" are of different sorts
      • containsTermsOfType

        public <C extends Term<?>> boolean containsTermsOfType​(java.lang.Class<C> cls)
        Description copied from interface: LogicStructure
        Checks if this logical structure contains at least one term of type C. This method is a shortcut for !getTerms(TermImplementation.class).isEmpty().
        Specified by:
        containsTermsOfType in interface LogicStructure
        Type Parameters:
        C - the type of terms
        Parameters:
        cls - The class structure representing the type C of the term.
        Returns:
        True if this logical structure contains at least one term of type C or false otherwise.
      • isGround

        public boolean isGround()
        Description copied from interface: ComplexLogicalFormula
        Checks whether this formula is ground, i.e. whether there appears no variable in this formula.
        Specified by:
        isGround in interface ComplexLogicalFormula
        Returns:
        "true" if this formula is ground.
      • isWellFormed

        public boolean isWellFormed()
        Description copied from interface: ComplexLogicalFormula
        Checks if this formula is well formed in the logical langauge. What well- formed means is highly language dependent and the documentation of implementing sub classes shall describe the well formed term for the language they model.
        Specified by:
        isWellFormed in interface ComplexLogicalFormula
        Returns:
        true if the formula is well-formed, false otherwise