Class RelationalConditional

  • All Implemented Interfaces:
    net.sf.tweety.commons.Formula, net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>, 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 RelationalConditional
    extends net.sf.tweety.logics.commons.syntax.RelationalFormula
    implements net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
    Instances of this class represent relational conditionals.
    Premise and conclusion of this conditional must confirm to a fol language without quantifiers and without functions (@see net.sf.tweety.logics.firstorderlogic.lang.FolLanguageNoQuantifiersNoFunctions)
    Author:
    Matthias Thimm TODO dont use relation formula cause it is a Quantified formula that not support or and etc.
    • Constructor Summary

      Constructors 
      Constructor Description
      RelationalConditional​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)
      Creates a new conditional with the given conclusion and a tautological premise.
      RelationalConditional​(net.sf.tweety.logics.fol.syntax.FolFormula premise, net.sf.tweety.logics.fol.syntax.FolFormula conclusion)
      Creates a new conditional with the given premise and conclusion.
    • Method Summary

      Modifier and Type Method Description
      void addPremise​(net.sf.tweety.logics.fol.syntax.FolFormula premise)  
      void addPremises​(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> premises)  
      RelationalConditional clone()  
      net.sf.tweety.logics.fol.syntax.Conjunction combineWithAnd​(net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable f)  
      net.sf.tweety.logics.fol.syntax.Disjunction combineWithOr​(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable f)  
      net.sf.tweety.logics.commons.syntax.RelationalFormula complement()  
      boolean containsQuantifier()  
      boolean equals​(Object obj)  
      Set<net.sf.tweety.logics.fol.syntax.FolAtom> getAtoms()  
      net.sf.tweety.logics.fol.syntax.FolFormula getConclusion()  
      Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()  
      Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()  
      Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> getPremise()  
      Set<net.sf.tweety.logics.commons.syntax.Variable> getQuantifierVariables()  
      net.sf.tweety.logics.fol.syntax.FolSignature getSignature()  
      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()  
      net.sf.tweety.math.probability.Probability getUniformProbability()  
      int hashCode()  
      boolean isClosed()  
      boolean isClosed​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)  
      boolean isConstraint()  
      boolean isFact()
      Checks whether this conditional is a fact, i.e.
      boolean isLiteral()  
      boolean isWellBound()  
      boolean isWellBound​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)  
      void setConclusion​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)  
      net.sf.tweety.logics.commons.syntax.RelationalFormula substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)  
      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

      • RelationalConditional

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

        public RelationalConditional​(net.sf.tweety.logics.fol.syntax.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()
        Specified by:
        containsQuantifier in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • getAtoms

        public Set<net.sf.tweety.logics.fol.syntax.FolAtom> 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
      • getPredicates

        public Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
        Specified by:
        getPredicates in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • getUnboundVariables

        public Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()
        Specified by:
        getUnboundVariables in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • isFact

        public boolean isFact()
        Checks whether this conditional is a fact, i.e. has a tautological premise.
        Specified by:
        isFact in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
        Returns:
        "true" iff this conditional is a fact.
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • isClosed

        public boolean isClosed​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
        Specified by:
        isClosed in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • isWellBound

        public boolean isWellBound()
        Specified by:
        isWellBound in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • isWellBound

        public boolean isWellBound​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
        Specified by:
        isWellBound in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • substitute

        public net.sf.tweety.logics.commons.syntax.RelationalFormula 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
        Specified by:
        substitute in class net.sf.tweety.logics.commons.syntax.RelationalFormula
        Throws:
        IllegalArgumentException
      • toString

        public String toString()
        Specified by:
        toString 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
      • getConclusion

        public net.sf.tweety.logics.fol.syntax.FolFormula getConclusion()
        Specified by:
        getConclusion in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • getPremise

        public Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> getPremise()
        Specified by:
        getPremise in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • combineWithAnd

        public net.sf.tweety.logics.fol.syntax.Conjunction combineWithAnd​(net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable f)
        Specified by:
        combineWithAnd in interface net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable
        Specified by:
        combineWithAnd in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • combineWithOr

        public net.sf.tweety.logics.fol.syntax.Disjunction combineWithOr​(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable f)
        Specified by:
        combineWithOr in interface net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable
        Specified by:
        combineWithOr in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • complement

        public net.sf.tweety.logics.commons.syntax.RelationalFormula complement()
        Specified by:
        complement in interface net.sf.tweety.logics.commons.syntax.interfaces.Invertable
        Specified by:
        complement 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
      • getUniformProbability

        public net.sf.tweety.math.probability.Probability getUniformProbability()
        Specified by:
        getUniformProbability in interface net.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware
        Specified by:
        getUniformProbability in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • isLiteral

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

        public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
        Specified by:
        getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
      • getTerms

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms​(Class<C> cls)
        Specified by:
        getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
      • getQuantifierVariables

        public Set<net.sf.tweety.logics.commons.syntax.Variable> getQuantifierVariables()
        Specified by:
        getQuantifierVariables in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • clone

        public RelationalConditional 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 net.sf.tweety.logics.commons.syntax.RelationalFormula
      • isConstraint

        public boolean isConstraint()
        Specified by:
        isConstraint in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • setConclusion

        public void setConclusion​(net.sf.tweety.logics.fol.syntax.FolFormula conclusion)
        Specified by:
        setConclusion in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • addPremise

        public void addPremise​(net.sf.tweety.logics.fol.syntax.FolFormula premise)
        Specified by:
        addPremise in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • addPremises

        public void addPremises​(Collection<? extends net.sf.tweety.logics.fol.syntax.FolFormula> premises)
        Specified by:
        addPremises in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>
      • getSignature

        public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
        Specified by:
        getSignature in interface net.sf.tweety.commons.Formula
        Specified by:
        getSignature in interface net.sf.tweety.commons.util.rules.Rule<net.sf.tweety.logics.fol.syntax.FolFormula,​net.sf.tweety.logics.fol.syntax.FolFormula>