Class DefaultRule
java.lang.Object
org.tweetyproject.logics.commons.syntax.RelationalFormula
org.tweetyproject.logics.rdl.syntax.DefaultRule
- All Implemented Interfaces:
- Formula,- ClassicalFormula,- ComplexLogicalFormula,- Conjunctable,- Disjunctable,- Invertable,- LogicStructure,- ProbabilityAware,- QuantifiedFormula,- SimpleLogicalFormula
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 SummaryConstructorsConstructorDescriptionan empty Default RuleDefaultRule(FolFormula pre, Collection<FolFormula> jus, FolFormula conc)Creates a new DefaultRuleDefaultRule(FolFormula pre, FolFormula jus, FolFormula conc)Creates a new DefaultRule
- 
Method SummaryModifier and TypeMethodDescriptionclone()Creates a deep copy of this formulacombineWithAnd(Conjunctable formula)Returns a conjunction of this and the given formula.combineWithOr(Disjunctable formula)booleanChecks whether this formula contains any quantification.booleangetAtoms()Processes the set of all atoms which appear in this formulaProcesses the set of all predicates which appear in this formulaReturns the signature of the language of this formula.getTerms()Processes the set containing all terms of type C.inthashCode()booleanisClosed()Checks whether this formula is closed, i.e.booleanChecks whether this formula is closed, i.e.booleanbooleanisNormal(DefaultTheory dt)Tests, whether the default is normal normal ^= a:c/cbooleanChecks whether this formula is well-bound, i.e.booleanisWellBound(Set<Variable> boundVariables)Checks whether this formula is well-bound, i.e.substitute(Term<?> v, Term<?> t)Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.toString()Methods inherited from class org.tweetyproject.logics.commons.syntax.RelationalFormulaallGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute
- 
Constructor Details- 
DefaultRulepublic DefaultRule()an empty Default Rule
- 
DefaultRulepublic DefaultRule(FolFormula pre, FolFormula jus, FolFormula conc) throws IllegalArgumentExceptionCreates a new DefaultRule- Parameters:
- pre- the prerequsite
- jus- the justification
- conc- the conclusion
- Throws:
- IllegalArgumentException- if there is some issue with the arguments
- ParserException- when a parameter is missing
 
- 
DefaultRulepublic DefaultRule(FolFormula pre, Collection<FolFormula> jus, FolFormula conc) throws IllegalArgumentExceptionCreates a new DefaultRule- Parameters:
- pre- the prerequsite
- jus- the justifications
- conc- the conclusion
- Throws:
- IllegalArgumentException- if there is some issue with the arguments
 
 
- 
- 
Method Details- 
isNormalTests, whether the default is normal normal ^= a:c/c- Parameters:
- dt- a default theory
- Returns:
- true iff the theory is normal
 
- 
getPrerequisite- Returns:
- the default's prerequisite
 
- 
getJustification- Returns:
- the default's justification
 
- 
getConclusion- Returns:
- the default's conclusion
 
- 
getPredicatesDescription copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Returns:
- all predicates that appear in this formula
 
- 
isLiteralpublic boolean isLiteral()- Returns:
- true if the formula represents a literal in the language or false otherwise
 
- 
getQuantifierVariables- Returns:
- a set containing all quantified variables
 
- 
getUnboundVariables- Returns:
- a set of of unbound variables
 
- 
containsQuantifierpublic boolean containsQuantifier()Description copied from interface:QuantifiedFormulaChecks whether this formula contains any quantification.- Returns:
- "true" if this formula contains a quantification.
 
- 
isWellBoundpublic boolean isWellBound()Description copied from interface:QuantifiedFormulaChecks 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.- Returns:
- "true" if this formula is well-bound, "false" otherwise.
 
- 
isWellBoundDescription copied from interface:QuantifiedFormulaChecks 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.- Parameters:
- boundVariables- the variables assumed to be bound.
- Returns:
- "true" if this formula is well-bound, "false" otherwise.
 
- 
isClosedpublic boolean isClosed()Description copied from interface:QuantifiedFormulaChecks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier.- Returns:
- "true" if this formula is closed, "false" otherwise.
 
- 
isClosedDescription copied from interface:QuantifiedFormulaChecks 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.- Parameters:
- boundVariables- the variables assumed to be bound.
- Returns:
- "true" if this formula is closed wrt. "boundVariables", "false" otherwise.
 
- 
getTerms- Returns:
- a set containing all terms of this logical structure
 
- 
getTermsDescription copied from interface:LogicStructureProcesses 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.- 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
 
- 
getAtomsDescription copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
- getAtomsin interface- SimpleLogicalFormula
- Specified by:
- getAtomsin class- RelationalFormula
- Returns:
- all atoms that appear in this formula.
 
- 
getFunctors- Specified by:
- getFunctorsin class- RelationalFormula
- Returns:
- all functors that appear in this formula.
 
- 
substituteDescription copied from class:RelationalFormulaSubstitutes 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:
- substitutein interface- ComplexLogicalFormula
- Specified by:
- substitutein 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:
- IllegalArgumentException- if "v" and "t" are of different sorts (NOTE: this exception is only thrown when "v" actually appears in this formula).
 
- 
getUniformProbability- Specified by:
- getUniformProbabilityin interface- ProbabilityAware
- Specified by:
- getUniformProbabilityin class- RelationalFormula
- Returns:
- this formula's probability in the uniform distribution.
 
- 
complement- Specified by:
- complementin interface- Invertable
- Specified by:
- complementin class- RelationalFormula
- Returns:
- the complement of this formula.
 
- 
combineWithOr- Specified by:
- combineWithOrin interface- Disjunctable
- Specified by:
- combineWithOrin class- RelationalFormula
- Parameters:
- formula- a formula to be combined with OR and this.
- Returns:
- a disjunction of this and the given formula.
 
- 
combineWithAndDescription copied from interface:ConjunctableReturns a conjunction of this and the given formula.- Specified by:
- combineWithAndin interface- Conjunctable
- Specified by:
- combineWithAndin class- RelationalFormula
- Parameters:
- formula- a formula to be combined with AND and this.
- Returns:
- a conjunction of this and the given formula.
 
- 
getSignatureDescription copied from interface:FormulaReturns the signature of the language of this formula.- Returns:
- the signature of the language of this formula.
 
- 
toString- Specified by:
- toStringin class- RelationalFormula
 
- 
cloneDescription copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
- clonein interface- ComplexLogicalFormula
- Specified by:
- clonein interface- SimpleLogicalFormula
- Specified by:
- clonein class- RelationalFormula
- Returns:
- the cloned formula
 
- 
hashCodepublic int hashCode()- Specified by:
- hashCodein interface- SimpleLogicalFormula
- Overrides:
- hashCodein class- Object
 
- 
equals- Specified by:
- equalsin interface- SimpleLogicalFormula
- Overrides:
- equalsin class- Object
 
 
-