Class AbaElement<T extends net.sf.tweety.commons.Formula>

  • Type Parameters:
    T - the type of formula
    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:
    AbaRule, Negation

    public abstract class AbaElement<T extends net.sf.tweety.commons.Formula>
    extends Object
    implements net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
    Abstract class that models common properties of aba syntax elements.
    Author:
    Anna Gessler
    • Constructor Summary

      Constructors 
      Constructor Description
      AbaElement()  
    • Method Summary

      Modifier and Type Method Description
      Set<? extends AbaElement<T>> allGroundInstances​(Set<net.sf.tweety.logics.commons.syntax.Constant> constants)
      Computes all ground instances of all inner fol formulas wrt.
      Set<Map<net.sf.tweety.logics.commons.syntax.Variable,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>> allSubstitutions​(Collection<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)
      Computes all possible substitutions, i.e.
      abstract AbaElement<T> clone()  
      <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>
      boolean
      containsTermsOfType​(Class<C> cls)  
      AbaElement<T> exchange​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)  
      Set<? extends net.sf.tweety.logics.commons.syntax.interfaces.Atom> getAtoms()  
      Class<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicateCls()  
      Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()  
      boolean isGround()  
      boolean isLiteral()  
      boolean isWellFormed()  
      AbaElement<T> substitute​(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> map)  
      abstract AbaElement<T> substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)  
      • Methods inherited from interface net.sf.tweety.commons.Formula

        getSignature
      • Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure

        getTerms, getTerms
      • Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula

        equals, getPredicates, hashCode
    • Constructor Detail

      • AbaElement

        public AbaElement()
    • Method Detail

      • clone

        public abstract AbaElement<T> 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
        Overrides:
        clone in class Object
      • 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
      • substitute

        public abstract AbaElement<T> substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
                                                 net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
                                          throws IllegalArgumentException
        Specified by:
        substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Throws:
        IllegalArgumentException
      • substitute

        public AbaElement<T> 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
        Throws:
        IllegalArgumentException
      • exchange

        public AbaElement<T> 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
        Throws:
        IllegalArgumentException
      • isGround

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

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

        public Set<Map<net.sf.tweety.logics.commons.syntax.Variable,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>> allSubstitutions​(Collection<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)
                                                                                                                                             throws IllegalArgumentException
        Computes all possible substitutions, i.e. maps from variables to terms, of unbound variables of this formula's inner fol formulas to terms in "terms".
        Parameters:
        terms - a set of terms.
        Returns:
        a set of maps from variables to terms.
        Throws:
        IllegalArgumentException - if there is an unbound variable in this formula for which there is no term in "terms" with the same sort.
      • allGroundInstances

        public Set<? extends AbaElement<T>> allGroundInstances​(Set<net.sf.tweety.logics.commons.syntax.Constant> constants)
        Computes all ground instances of all inner fol formulas wrt. the given set of constants, i.e. every formula where each occurrence of some unbound variable is replaced by some constant.
        Parameters:
        constants - a set of constants
        Returns:
        a set of ground instances of this formula
        Throws:
        IllegalArgumentException - if there is an unbound variable in this formula for which there is no constant in "constants" with the same sort.
      • getUnboundVariables

        public Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()
      • isLiteral

        public boolean isLiteral()
        Specified by:
        isLiteral in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • getAtoms

        public Set<? extends net.sf.tweety.logics.commons.syntax.interfaces.Atom> getAtoms()
        Specified by:
        getAtoms in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • 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