Class DefaultRule

  • 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 DefaultRule
    extends net.sf.tweety.logics.commons.syntax.RelationalFormula
    Models a default rule in Reiter's default logic, see [R. Reiter. A logic for default reasoning. Artificial Intelligence, 13:81–132, 1980].
    Author:
    Matthias Thimm, Nils Geilen
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultRule()
      an empty Default Rule
      DefaultRule​(net.sf.tweety.logics.fol.syntax.FolFormula pre, Collection<net.sf.tweety.logics.fol.syntax.FolFormula> jus, net.sf.tweety.logics.fol.syntax.FolFormula conc)
      Creates a new DefaultRule
      DefaultRule​(net.sf.tweety.logics.fol.syntax.FolFormula pre, net.sf.tweety.logics.fol.syntax.FolFormula jus, net.sf.tweety.logics.fol.syntax.FolFormula conc)
      Creates a new DefaultRule
    • Method Summary

      Modifier and Type Method Description
      net.sf.tweety.logics.commons.syntax.RelationalFormula clone()  
      net.sf.tweety.logics.fol.syntax.Conjunction combineWithAnd​(net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable formula)  
      net.sf.tweety.logics.fol.syntax.Disjunction combineWithOr​(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable formula)  
      net.sf.tweety.logics.commons.syntax.RelationalFormula complement()  
      boolean containsQuantifier()  
      boolean equals​(Object o)  
      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()  
      Collection<net.sf.tweety.logics.fol.syntax.FolFormula> getJustification()  
      Set<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()  
      net.sf.tweety.logics.fol.syntax.FolFormula getPrerequisite()  
      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 isLiteral()  
      boolean isNormal​(DefaultTheory dt)
      Tests, whether the default is normal normal ^= a:c/c
      boolean isWellBound()  
      boolean isWellBound​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)  
      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

      • DefaultRule

        public DefaultRule()
        an empty Default Rule
      • DefaultRule

        public DefaultRule​(net.sf.tweety.logics.fol.syntax.FolFormula pre,
                           net.sf.tweety.logics.fol.syntax.FolFormula jus,
                           net.sf.tweety.logics.fol.syntax.FolFormula conc)
                    throws IllegalArgumentException
        Creates a new DefaultRule
        Parameters:
        pre - the prerequsite
        jus - the justification
        conc - the conclusion
        Throws:
        IllegalArgumentException - if there is some issue with the arguments
        net.sf.tweety.commons.ParserException - when a parameter is missing
      • DefaultRule

        public DefaultRule​(net.sf.tweety.logics.fol.syntax.FolFormula pre,
                           Collection<net.sf.tweety.logics.fol.syntax.FolFormula> jus,
                           net.sf.tweety.logics.fol.syntax.FolFormula conc)
                    throws IllegalArgumentException
        Creates a new DefaultRule
        Parameters:
        pre - the prerequsite
        jus - the justifications
        conc - the conclusion
        Throws:
        IllegalArgumentException - if there is some issue with the arguments
    • Method Detail

      • isNormal

        public boolean isNormal​(DefaultTheory dt)
        Tests, whether the default is normal normal ^= a:c/c
        Parameters:
        dt - a default theory
        Returns:
        true iff the theory is normal
      • getPrerequisite

        public net.sf.tweety.logics.fol.syntax.FolFormula getPrerequisite()
        Returns:
        the default's prerequisite
      • getJustification

        public Collection<net.sf.tweety.logics.fol.syntax.FolFormula> getJustification()
        Returns:
        the default's justification
      • getConclusion

        public net.sf.tweety.logics.fol.syntax.FolFormula getConclusion()
        Returns:
        the default's conclusion
      • getPredicates

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

        public boolean isLiteral()
      • getQuantifierVariables

        public Set<net.sf.tweety.logics.commons.syntax.Variable> getQuantifierVariables()
      • 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)
      • 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
      • getFunctors

        public Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()
        Specified by:
        getFunctors in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • 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
      • 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
      • 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
      • combineWithOr

        public net.sf.tweety.logics.fol.syntax.Disjunction combineWithOr​(net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable formula)
        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
      • combineWithAnd

        public net.sf.tweety.logics.fol.syntax.Conjunction combineWithAnd​(net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable formula)
        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
      • getSignature

        public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
      • toString

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

        public net.sf.tweety.logics.commons.syntax.RelationalFormula 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
      • 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 o)
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object