Package net.sf.tweety.arg.aspic.syntax
Class InferenceRule<T extends Invertable>
- java.lang.Object
-
- net.sf.tweety.arg.aspic.syntax.InferenceRule<T>
-
- Type Parameters:
T- is the type of the language that the ASPIC theory's rules range over
- Direct Known Subclasses:
DefeasibleInferenceRule,StrictInferenceRule
public abstract class InferenceRule<T extends Invertable> extends java.lang.Object implements Rule<T,T>
- Author:
- Nils Geilen This stands for an inference rule or for a premise if premises has length 0. If this is a premise and defeasible it is an ordinary premise else it is an axiom.
-
-
Field Summary
Fields Modifier and Type Field Description private TconclusionThe rule's conclusionprivate java.lang.StringnameIdentifying name.private java.util.Collection<T>premisesThe rule's premises
-
Constructor Summary
Constructors Constructor Description InferenceRule()Creates an empty instanceInferenceRule(T conclusion, java.util.Collection<T> premise)Constructs a new inference rule of rule p -> c if strict or p => c else
-
Method Summary
Modifier and Type Method Description voidaddPremise(T premise)voidaddPremises(java.util.Collection<? extends T> premises)booleanequals(java.lang.Object obj)TgetConclusion()Returns the conclusion of this rule.java.lang.StringgetIdentifier()Returns the name if it has one, else it returns the hashcodejava.lang.StringgetName()Returns the namejava.util.Collection<? extends T>getPremise()Returns the premise of this rule.SignaturegetSignature()Returns the signature of the language of this formula.inthashCode()booleanisConstraint()abstract booleanisDefeasible()booleanisFact()voidsetConclusion(T conclusion)voidsetName(java.lang.String name)Sets the nameDefeasibleInferenceRule<T>toDefeasible()StrictInferenceRule<T>toStrict()java.lang.StringtoString()
-
-
-
Field Detail
-
conclusion
private T extends Invertable conclusion
The rule's conclusion
-
premises
private java.util.Collection<T extends Invertable> premises
The rule's premises
-
name
private java.lang.String name
Identifying name. used e.g. for formula generation
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
isDefeasible
public abstract boolean isDefeasible()
- Returns:
- true iff this rule is defeasible
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStrict
public StrictInferenceRule<T> toStrict()
- Returns:
- a strict instance of this rule
-
toDefeasible
public DefeasibleInferenceRule<T> toDefeasible()
- Returns:
- a defeasible instance of this rule
-
getIdentifier
public java.lang.String getIdentifier()
Returns the name if it has one, else it returns the hashcode- Returns:
- an identifier for this rule
-
getName
public java.lang.String getName()
Returns the name- Returns:
- this rul's name
-
setName
public void setName(java.lang.String name)
Sets the name- Parameters:
name- new name
-
isFact
public boolean isFact()
- Specified by:
isFactin interfaceRule<T extends Invertable,T extends Invertable>
-
isConstraint
public boolean isConstraint()
- Specified by:
isConstraintin interfaceRule<T extends Invertable,T extends Invertable>
-
setConclusion
public void setConclusion(T conclusion)
- Specified by:
setConclusionin interfaceRule<T extends Invertable,T extends Invertable>
-
addPremise
public void addPremise(T premise)
- Specified by:
addPremisein interfaceRule<T extends Invertable,T extends Invertable>
-
addPremises
public void addPremises(java.util.Collection<? extends T> premises)
- Specified by:
addPremisesin interfaceRule<T extends Invertable,T extends Invertable>
-
getSignature
public Signature getSignature()
Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
getSignaturein interfaceFormula- Specified by:
getSignaturein interfaceRule<T extends Invertable,T extends Invertable>- Returns:
- the signature of the language of this formula.
-
getPremise
public java.util.Collection<? extends T> getPremise()
Description copied from interface:RuleReturns the premise of this rule.- Specified by:
getPremisein interfaceRule<T extends Invertable,T extends Invertable>- Returns:
- the premise of this rule.
-
getConclusion
public T getConclusion()
Description copied from interface:RuleReturns the conclusion of this rule.- Specified by:
getConclusionin interfaceRule<T extends Invertable,T extends Invertable>- Returns:
- the conclusion of this rule.
-
-