Package net.sf.tweety.arg.aspic.syntax
Class AspicArgument<T extends Invertable>
- java.lang.Object
-
- net.sf.tweety.arg.dung.syntax.Argument
-
- net.sf.tweety.arg.aspic.syntax.AspicArgument<T>
-
- Type Parameters:
T- is the type of the language that the ASPIC theory's rules range over
- All Implemented Interfaces:
DungEntity,Formula,Node
public class AspicArgument<T extends Invertable> extends Argument
- Author:
- Nils Geilen An argument according to the ASPIC+ specification
-
-
Constructor Summary
Constructors Constructor Description AspicArgument(InferenceRule<T> toprule)Creates an empty ArgumentAspicArgument(InferenceRule<T> toprule, java.util.Collection<AspicArgument<T>> directsubs)Creates an empty Argument
-
Method Summary
Modifier and Type Method Description voidaddDirectSub(AspicArgument<T> sub)Adds a subargumentbooleanequals(java.lang.Object obj)java.util.Collection<T>getAllConclusions()Returns all conclusions appearing in this argument.java.util.Collection<InferenceRule<T>>getAllRules()Returns all rules appearing in this argument.java.util.Collection<AspicArgument<T>>getAllSubs()returns the Subs according to the ASPIC+ specificationTgetConclusion()Returns Conc according to the ASPIC+ specificationjava.util.Collection<InferenceRule<T>>getDefeasibleRules()Returns the DefRules according to ASPIC+ specification, i.e.java.util.Collection<AspicArgument<T>>getDefeasibleSubs()Determines subarguments with defeasible toprules, premises do not count as subrulesjava.util.Collection<AspicArgument<T>>getDirectSubs()The argument's direct children, whose conclusions fit its prerequisitesjava.util.Collection<InferenceRule<T>>getListLastDefeasibleRules()Returns all defeasible subrules of the level where the first defeasible subrule appears, i.e.java.util.Collection<AspicArgument<T>>getOrdinaryPremises()InferenceRule<T>getTopRule()Retruns the TopRule according to ASPIC+ specificationbooleanhasDefeasibleSub()Checks whether this has a defeasible subrule, premises do not count as subrulesinthashCode()static <T extends Invertable>
booleanisAttack(AspicArgument<T> active, AspicArgument<T> passive, RuleFormulaGenerator<T> rfgen, java.util.Comparator<AspicArgument<T>> order)Determines whether the attack is successfulbooleanisFirm()An argument is firm iff it does not contain ordinary premisesbooleanisStrict()An argument is strict iff it does not contain defeasible subrulesbooleanisSubArgumentOf(AspicArgument<T> arg)Checks wheter this is a direct or indirect subargument ofargvoidsetConclusion(T conc)Change the conclusionvoidsetTopRule(InferenceRule<T> toprule)Changes the TopRuleAspicArgument<T>shallowCopy()java.lang.StringtoString()-
Methods inherited from class net.sf.tweety.arg.dung.syntax.Argument
getLdoArgument, getLdoFormula, getName, getSignature, setName
-
-
-
-
Constructor Detail
-
AspicArgument
public AspicArgument(InferenceRule<T> toprule, java.util.Collection<AspicArgument<T>> directsubs)
Creates an empty Argument- Parameters:
toprule- the argument's TopRuledirectsubs- the direct sub arguments
-
AspicArgument
public AspicArgument(InferenceRule<T> toprule)
Creates an empty Argument- Parameters:
toprule- the argument's TopRule
-
-
Method Detail
-
hasDefeasibleSub
public boolean hasDefeasibleSub()
Checks whether this has a defeasible subrule, premises do not count as subrules- Returns:
- whether this has a defeasible subrule
-
isStrict
public boolean isStrict()
An argument is strict iff it does not contain defeasible subrules- Returns:
- true iff this argument is strict
-
isFirm
public boolean isFirm()
An argument is firm iff it does not contain ordinary premises- Returns:
- iff this is firm
-
isSubArgumentOf
public boolean isSubArgumentOf(AspicArgument<T> arg)
Checks wheter this is a direct or indirect subargument ofarg- Parameters:
arg- an ASPIC argument- Returns:
- true iff this is in Sub(arg)
-
getOrdinaryPremises
public java.util.Collection<AspicArgument<T>> getOrdinaryPremises()
- Returns:
- all ordinary premises
-
getConclusion
public T getConclusion()
Returns Conc according to the ASPIC+ specification- Returns:
- the top rule's conclusion
-
setConclusion
public void setConclusion(T conc)
Change the conclusion- Parameters:
conc- the new conclusion
-
getAllSubs
public java.util.Collection<AspicArgument<T>> getAllSubs()
returns the Subs according to the ASPIC+ specification- Returns:
- all subarguments including this
-
getDefeasibleSubs
public java.util.Collection<AspicArgument<T>> getDefeasibleSubs()
Determines subarguments with defeasible toprules, premises do not count as subrules- Returns:
- all arguments in Subs with defeasible top rules
-
getListLastDefeasibleRules
public java.util.Collection<InferenceRule<T>> getListLastDefeasibleRules()
Returns all defeasible subrules of the level where the first defeasible subrule appears, i.e. the set of defeasible subrules with the smallest depth- Returns:
- the last defeasible rules
-
getDefeasibleRules
public java.util.Collection<InferenceRule<T>> getDefeasibleRules()
Returns the DefRules according to ASPIC+ specification, i.e. the defeasible toprules of subarguments- Returns:
- this argument's defeasible rules
-
getAllRules
public java.util.Collection<InferenceRule<T>> getAllRules()
Returns all rules appearing in this argument.- Returns:
- all rules appearing in this argument.
-
getAllConclusions
public java.util.Collection<T> getAllConclusions()
Returns all conclusions appearing in this argument.- Returns:
- all conclusions appearing in this argument.
-
getDirectSubs
public java.util.Collection<AspicArgument<T>> getDirectSubs()
The argument's direct children, whose conclusions fit its prerequisites- Returns:
- the direct subrules
-
addDirectSub
public void addDirectSub(AspicArgument<T> sub)
Adds a subargument- Parameters:
sub- to be added
-
getTopRule
public InferenceRule<T> getTopRule()
Retruns the TopRule according to ASPIC+ specification- Returns:
- the top rule
-
setTopRule
public void setTopRule(InferenceRule<T> toprule)
Changes the TopRule- Parameters:
toprule- the new TopRule
-
isAttack
public static <T extends Invertable> boolean isAttack(AspicArgument<T> active, AspicArgument<T> passive, RuleFormulaGenerator<T> rfgen, java.util.Comparator<AspicArgument<T>> order)
Determines whether the attack is successful- Type Parameters:
T- the type of formulas- Parameters:
active- the active argumentpassive- the passive argumentrfgen- a rule formula generatororder- a comparator- Returns:
- true iff the attack is successful
-
shallowCopy
public AspicArgument<T> shallowCopy()
-
-