Class Implication

  • All Implemented Interfaces:
    net.sf.tweety.commons.Formula, net.sf.tweety.logics.commons.syntax.interfaces.ClassicalFormula, net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula, net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable, net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable, net.sf.tweety.logics.commons.syntax.interfaces.Invertable, net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure, net.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware, net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula, net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula

    public class Implication
    extends FolFormula
    The implication of first-order logic.
    Author:
    Anna Gessler
    • Constructor Summary

      Constructors 
      Constructor Description
      Implication​(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,​net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
      Creates a new implication with the given pair of formulas
      Implication​(net.sf.tweety.logics.commons.syntax.RelationalFormula a, net.sf.tweety.logics.commons.syntax.RelationalFormula b)
      Creates a new implication a=>b with the two given formulas
    • Method Summary

      Modifier and Type Method Description
      Implication clone()  
      net.sf.tweety.logics.commons.syntax.RelationalFormula collapseAssociativeFormulas()
      This method collapses all associative operations appearing in this term, e.g.
      boolean containsQuantifier()  
      boolean equals​(Object obj)  
      Set<? extends net.sf.tweety.logics.commons.syntax.interfaces.Atom> getAtoms()  
      net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,​net.sf.tweety.logics.commons.syntax.RelationalFormula> getFormulas()
      Returns the formulas of the implication.
      Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()  
      Set<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()  
      Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()  
      <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>
      Set<C>
      getTerms​(Class<C> cls)  
      Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()  
      int hashCode()  
      boolean isClosed()  
      boolean isClosed​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)  
      boolean isDnf()
      Checks whether this formula is in disjunctive normal form.
      boolean isLiteral()  
      boolean isWellBound()  
      boolean isWellBound​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)  
      void setFormulas​(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,​net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
      Sets the formulas of the implication.
      void setFormulas​(net.sf.tweety.logics.commons.syntax.RelationalFormula left, net.sf.tweety.logics.commons.syntax.RelationalFormula right)
      Sets the formulas of the implication.
      FolFormula substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)  
      FolFormula toNnf()
      Makes the negation normal form of this formula.
      String toString()  
      • Methods inherited from class net.sf.tweety.logics.commons.syntax.RelationalFormula

        allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute
    • Constructor Detail

      • Implication

        public Implication​(net.sf.tweety.logics.commons.syntax.RelationalFormula a,
                           net.sf.tweety.logics.commons.syntax.RelationalFormula b)
        Creates a new implication a=>b with the two given formulas
        Parameters:
        a - a relational formula.
        b - a relational formula.
      • Implication

        public Implication​(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,​net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
        Creates a new implication with the given pair of formulas
        Parameters:
        formulas - a pair of formulas
    • Method Detail

      • getFormulas

        public net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,​net.sf.tweety.logics.commons.syntax.RelationalFormula> getFormulas()
        Returns the formulas of the implication.
        Returns:
        the formulas that are part of the implication
      • setFormulas

        public void setFormulas​(net.sf.tweety.commons.util.Pair<net.sf.tweety.logics.commons.syntax.RelationalFormula,​net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
        Sets the formulas of the implication.
        Parameters:
        formulas - the formulas
      • setFormulas

        public void setFormulas​(net.sf.tweety.logics.commons.syntax.RelationalFormula left,
                                net.sf.tweety.logics.commons.syntax.RelationalFormula right)
        Sets the formulas of the implication.
        Parameters:
        left -
        right -
      • getPredicates

        public Set<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
      • isLiteral

        public boolean isLiteral()
      • getUnboundVariables

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

        public boolean containsQuantifier()
      • isWellBound

        public boolean isWellBound()
      • isWellBound

        public boolean isWellBound​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
      • isClosed

        public boolean isClosed()
      • isClosed

        public boolean isClosed​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
      • getTerms

        public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
      • getTerms

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms​(Class<C> cls)
      • toNnf

        public FolFormula toNnf()
        Description copied from class: FolFormula
        Makes the negation normal form of this formula.
        Specified by:
        toNnf in class FolFormula
        Returns:
        the NNF of this formula
      • collapseAssociativeFormulas

        public net.sf.tweety.logics.commons.syntax.RelationalFormula collapseAssociativeFormulas()
        Description copied from class: FolFormula
        This method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.
        Specified by:
        collapseAssociativeFormulas in class FolFormula
        Returns:
        the collapsed formula.
      • isDnf

        public boolean isDnf()
        Description copied from class: FolFormula
        Checks whether this formula is in disjunctive normal form.
        Specified by:
        isDnf in class FolFormula
        Returns:
        "true" iff this formula is in disjunctive normal form.
      • clone

        public Implication 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 FolFormula
      • 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
        Specified by:
        getAtoms in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • getFunctors

        public Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()
        Specified by:
        getFunctors in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • toString

        public String toString()
        Specified by:
        toString in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object