Package org.tweetyproject.arg.aba.syntax
Class InferenceRule<T extends Formula>
java.lang.Object
org.tweetyproject.arg.aba.syntax.AbaElement<T>
org.tweetyproject.arg.aba.syntax.AbaRule<T>
org.tweetyproject.arg.aba.syntax.InferenceRule<T>
- Type Parameters:
T- is the type of the language that the ABA theory's rules range over
- All Implemented Interfaces:
Formula,Rule<T,,T> ComplexLogicalFormula,LogicStructure,SimpleLogicalFormula
This class models an inference rule from an ABA theory.
- Author:
- Nils Geilen (geilenn@uni-koblenz.de)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPremise(T premise) Add the given premise to this rule.voidaddPremises(Collection<? extends T> premises) Add the given premises to this rule.clone()Creates a deep copy of this formulabooleanReturns the conclusion of this rule.Processes the set of all predicates which appear in this formulaCollection<? extends T>Returns the premise of this rule.Returns the signature of the language of this formula.getTerms()Processes the set containing all terms of type C.inthashCode()booleanbooleanisConstraintbooleanisFact()isFactvoidsetConclusion(T conclusion) Set the conclusion of this rule.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.arg.aba.syntax.AbaElement
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getAtoms, getPredicateCls, getUnboundVariables, isGround, isLiteral, isWellFormed, substitute
-
Constructor Details
-
InferenceRule
public InferenceRule()
-
-
Method Details
-
isFact
public boolean isFact()Description copied from interface:RuleisFact- Returns:
- whether the rule is a fact
-
isConstraint
public boolean isConstraint()Description copied from interface:RuleisConstraint- Returns:
- whether the rule is a constraint
-
setConclusion
Description copied from interface:RuleSet the conclusion of this rule.- Parameters:
conclusion- some formula
-
addPremise
Description copied from interface:RuleAdd the given premise to this rule.- Parameters:
premise- some formula
-
addPremises
Description copied from interface:RuleAdd the given premises to this rule.- Parameters:
premises- some formulas
-
getSignature
Description copied from interface:FormulaReturns the signature of the language of this formula.- Returns:
- the signature of the language of this formula.
-
getPremise
Description copied from interface:RuleReturns the premise of this rule.- Returns:
- the premise of this rule.
-
getConclusion
Description copied from interface:RuleReturns the conclusion of this rule.- Returns:
- the conclusion of this rule.
-
isAssumption
public boolean isAssumption()- Specified by:
isAssumptionin classAbaRule<T extends Formula>- Returns:
- whether this rule is an assumption
-
toString
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceSimpleLogicalFormula- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceSimpleLogicalFormula- Overrides:
equalsin classObject
-
getPredicates
Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Returns:
- all predicates that appear in this formula
-
getTerms
- Returns:
- a set containing all terms of this logical structure
-
getTerms
Description 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
-
clone
Description copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
clonein interfaceComplexLogicalFormula- Specified by:
clonein interfaceSimpleLogicalFormula- Specified by:
clonein classAbaElement<T extends Formula>- Returns:
- the cloned formula
-
substitute
Description copied from interface:ComplexLogicalFormulaSubstitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.- Specified by:
substitutein interfaceComplexLogicalFormula- Specified by:
substitutein classAbaElement<T extends Formula>- 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
-