Class AssociativeFolFormula

    • Constructor Detail

      • AssociativeFolFormula

        public AssociativeFolFormula()
        Creates a new (empty) associative formula.
      • AssociativeFolFormula

        public AssociativeFolFormula​(RelationalFormula first,
                                     RelationalFormula second)
        Creates a new associative formula with the two given formulae
        Parameters:
        first - a relational formula.
        second - a relational formula.
      • AssociativeFolFormula

        public AssociativeFolFormula​(java.util.Collection<? extends RelationalFormula> formulas)
        Creates a new associative formula with the given inner formulas.
        Parameters:
        formulas - a collection of formulas.
    • Method Detail

      • containsQuantifier

        public boolean containsQuantifier()
        Description copied from interface: QuantifiedFormula
        Checks whether this formula contains any quantification.
        Specified by:
        containsQuantifier in interface QuantifiedFormula
        Returns:
        "true" if this formula contains a quantification.
      • isClosed

        public boolean isClosed()
        Description copied from interface: QuantifiedFormula
        Checks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier.
        Specified by:
        isClosed in interface QuantifiedFormula
        Returns:
        "true" if this formula is closed, "false" otherwise.
      • isClosed

        public boolean isClosed​(java.util.Set<Variable> boundVariables)
        Description copied from interface: QuantifiedFormula
        Checks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier. Every variable in "boundVariables" is already assumed to be bound.
        Specified by:
        isClosed in interface QuantifiedFormula
        Parameters:
        boundVariables - the variables assumed to be bound.
        Returns:
        "true" if this formula is closed wrt. "boundVariables", "false" otherwise.
      • isWellBound

        public boolean isWellBound()
        Description copied from interface: QuantifiedFormula
        Checks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier's range.
        Specified by:
        isWellBound in interface QuantifiedFormula
        Returns:
        "true" if this formula is well-bound, "false" otherwise.
      • isWellBound

        public boolean isWellBound​(java.util.Set<Variable> boundVariables)
        Description copied from interface: QuantifiedFormula
        Checks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier range. Every variable in "boundVariables" is assumed to be bound already.
        Specified by:
        isWellBound in interface QuantifiedFormula
        Parameters:
        boundVariables - the variables assumed to be bound.
        Returns:
        "true" if this formula is well-bound, "false" otherwise.
      • isLiteral

        public boolean isLiteral()
        Specified by:
        isLiteral in interface SimpleLogicalFormula
        Returns:
        true if the formula represents a literal in the language or false otherwise
      • getFormulas

        public <C extends SimpleLogicalFormula> java.util.Set<C> getFormulas​(java.lang.Class<C> cls)
        Description copied from interface: AssociativeFormula
        Process the formulas of type C that are children of this associative formula
        Specified by:
        getFormulas in interface AssociativeFormula<RelationalFormula>
        Type Parameters:
        C - the type of formulas
        Parameters:
        cls - the class structure defining the type of formulas which are searched.
        Returns:
        A set of formulas of type C which are members of the associative formula
      • getTerms

        public java.util.Set<Term<?>> getTerms()
        Specified by:
        getTerms in interface LogicStructure
        Returns:
        a set containing all terms of this logical structure
      • getTerms

        public <C extends Term<?>> java.util.Set<C> getTerms​(java.lang.Class<C> cls)
        Description copied from interface: LogicStructure
        Processes the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.
        Specified by:
        getTerms in interface LogicStructure
        Type Parameters:
        C - the type of terms
        Parameters:
        cls - The Class structure containing type information about the searched term
        Returns:
        A set containing all terms of type C of this logical structure
      • getPredicates

        public java.util.Set<? extends 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 AssociativeFolFormula substitute​(Term<?> v,
                                                Term<?> t)
        Description copied from class: RelationalFormula
        Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula. NOTE: if "v" is a variable and bound to a quantifier then "v" is not substituted in that quantifiers inner formula.
        Specified by:
        substitute in interface ComplexLogicalFormula
        Specified by:
        substitute in class FolFormula
        Parameters:
        v - the term to be substituted.
        t - the term to substitute.
        Returns:
        a formula where every occurrence of "v" is replaced by "t".
      • substitute

        public AssociativeFolFormula substitute​(java.util.Map<? extends Term<?>,​? extends Term<?>> termMap)
        Description copied from class: RelationalFormula
        Substitutes all occurrences of all terms "v" in map.keyset() in this formula by map.get(v) and returns the new formula.
        NOTE: variables bound to quantifiers are not substituted in their inner formulas even if they appear in the map.
        Specified by:
        substitute in interface ComplexLogicalFormula
        Overrides:
        substitute in class RelationalFormula
        Parameters:
        termMap - a mapping defining which terms to be substituted.
        Returns:
        a formula where every term in map.keyset() has been replaced by map.get(v).
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Collection<RelationalFormula>
        Specified by:
        equals in interface java.util.List<RelationalFormula>
        Specified by:
        equals in interface SimpleLogicalFormula
        Overrides:
        equals in class java.lang.Object
      • add

        public boolean add​(FolFormula... formulas)
        Adds the specified elements to the end of this collection (optional operation).
        Parameters:
        formulas - to be appended to collection
        Returns:
        true if all elements were added, false otherwise
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<RelationalFormula>
        Specified by:
        clear in interface java.util.List<RelationalFormula>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<RelationalFormula>
        Specified by:
        contains in interface java.util.List<RelationalFormula>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<RelationalFormula>
        Specified by:
        containsAll in interface java.util.List<RelationalFormula>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<RelationalFormula>
        Specified by:
        isEmpty in interface java.util.List<RelationalFormula>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<RelationalFormula>
        Specified by:
        remove in interface java.util.List<RelationalFormula>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<RelationalFormula>
        Specified by:
        removeAll in interface java.util.List<RelationalFormula>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<RelationalFormula>
        Specified by:
        retainAll in interface java.util.List<RelationalFormula>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<RelationalFormula>
        Specified by:
        toArray in interface java.util.List<RelationalFormula>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<RelationalFormula>
        Specified by:
        toArray in interface java.util.List<RelationalFormula>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends RelationalFormula> c)
        Specified by:
        addAll in interface java.util.List<RelationalFormula>
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<RelationalFormula>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<RelationalFormula>