Class RelationalConditional

    • Constructor Detail

      • RelationalConditional

        public RelationalConditional​(FolFormula premise,
                                     FolFormula conclusion)
        Creates a new conditional with the given premise and conclusion.
        Parameters:
        premise - a fol formula.
        conclusion - a fol formula.
      • RelationalConditional

        public RelationalConditional​(FolFormula conclusion)
        Creates a new conditional with the given conclusion and a tautological premise.
        Parameters:
        conclusion - a fol formula.
    • 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.
      • isFact

        public boolean isFact()
        Checks whether this conditional is a fact, i.e. has a tautological premise.
        Specified by:
        isFact in interface Rule<FolFormula,​FolFormula>
        Returns:
        "true" iff this conditional is a fact.
      • 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.
      • substitute

        public RelationalFormula substitute​(Term<?> v,
                                            Term<?> t)
                                     throws java.lang.IllegalArgumentException
        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 RelationalFormula
        Parameters:
        v - the term to be substituted.
        t - the term to substitute.
        Returns:
        a formula where every occurrence of "v" is replaced by "t".
        Throws:
        java.lang.IllegalArgumentException - if "v" and "t" are of different sorts (NOTE: this exception is only thrown when "v" actually appears in this formula).
      • getPremise

        public java.util.Collection<? extends FolFormula> getPremise()
        Description copied from interface: Rule
        Returns the premise of this rule.
        Specified by:
        getPremise in interface Rule<FolFormula,​FolFormula>
        Returns:
        the premise of this rule.
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface SimpleLogicalFormula
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface SimpleLogicalFormula
        Overrides:
        equals in class java.lang.Object
      • isLiteral

        public boolean isLiteral()
        Specified by:
        isLiteral in interface SimpleLogicalFormula
        Returns:
        true if the formula represents a literal in the language or false otherwise
      • 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
      • setConclusion

        public void setConclusion​(FolFormula conclusion)
        Description copied from interface: Rule
        Set the conclusion of this rule.
        Specified by:
        setConclusion in interface Rule<FolFormula,​FolFormula>
        Parameters:
        conclusion - some formula
      • addPremise

        public void addPremise​(FolFormula premise)
        Description copied from interface: Rule
        Add the given premise to this rule.
        Specified by:
        addPremise in interface Rule<FolFormula,​FolFormula>
        Parameters:
        premise - some formula
      • addPremises

        public void addPremises​(java.util.Collection<? extends FolFormula> premises)
        Description copied from interface: Rule
        Add the given premises to this rule.
        Specified by:
        addPremises in interface Rule<FolFormula,​FolFormula>
        Parameters:
        premises - some formulas