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 T
conclusion
The rule's conclusionprivate java.lang.String
name
Identifying name.private java.util.Collection<T>
premises
The 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 void
addPremise(T premise)
void
addPremises(java.util.Collection<? extends T> premises)
boolean
equals(java.lang.Object obj)
T
getConclusion()
Returns the conclusion of this rule.java.lang.String
getIdentifier()
Returns the name if it has one, else it returns the hashcodejava.lang.String
getName()
Returns the namejava.util.Collection<? extends T>
getPremise()
Returns the premise of this rule.Signature
getSignature()
Returns the signature of the language of this formula.int
hashCode()
boolean
isConstraint()
abstract boolean
isDefeasible()
boolean
isFact()
void
setConclusion(T conclusion)
void
setName(java.lang.String name)
Sets the nameDefeasibleInferenceRule<T>
toDefeasible()
StrictInferenceRule<T>
toStrict()
java.lang.String
toString()
-
-
-
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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
isDefeasible
public abstract boolean isDefeasible()
- Returns:
- true iff this rule is defeasible
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
isFact
in interfaceRule<T extends Invertable,T extends Invertable>
-
isConstraint
public boolean isConstraint()
- Specified by:
isConstraint
in interfaceRule<T extends Invertable,T extends Invertable>
-
setConclusion
public void setConclusion(T conclusion)
- Specified by:
setConclusion
in interfaceRule<T extends Invertable,T extends Invertable>
-
addPremise
public void addPremise(T premise)
- Specified by:
addPremise
in interfaceRule<T extends Invertable,T extends Invertable>
-
addPremises
public void addPremises(java.util.Collection<? extends T> premises)
- Specified by:
addPremises
in interfaceRule<T extends Invertable,T extends Invertable>
-
getSignature
public Signature getSignature()
Description copied from interface:Formula
Returns the signature of the language of this formula.- Specified by:
getSignature
in interfaceFormula
- Specified by:
getSignature
in 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:Rule
Returns the premise of this rule.- Specified by:
getPremise
in interfaceRule<T extends Invertable,T extends Invertable>
- Returns:
- the premise of this rule.
-
getConclusion
public T getConclusion()
Description copied from interface:Rule
Returns the conclusion of this rule.- Specified by:
getConclusion
in interfaceRule<T extends Invertable,T extends Invertable>
- Returns:
- the conclusion of this rule.
-
-