Class AspicArgument<T extends Invertable>

java.lang.Object
org.tweetyproject.arg.dung.syntax.Argument
org.tweetyproject.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:
Comparable<Argument>, DungEntity, Formula, Node

public class AspicArgument<T extends Invertable> extends Argument
An argument according to the ASPIC+ specification
Author:
Nils Geilen
  • Constructor Details

    • AspicArgument

      public AspicArgument(InferenceRule<T> toprule, Collection<AspicArgument<T>> directsubs)
      Creates an empty Argument
      Parameters:
      toprule - the argument's TopRule
      directsubs - the direct sub arguments
    • AspicArgument

      public AspicArgument(InferenceRule<T> toprule)
      Creates an empty Argument
      Parameters:
      toprule - the argument's TopRule
  • Method Details

    • 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 of arg
      Parameters:
      arg - an ASPIC argument
      Returns:
      true iff this is in Sub(arg)
    • getOrdinaryPremises

      public 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 Collection<AspicArgument<T>> getAllSubs()
      returns the Subs according to the ASPIC+ specification
      Returns:
      all subarguments including this
    • getDefeasibleSubs

      public 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 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 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 Collection<InferenceRule<T>> getAllRules()
      Returns all rules appearing in this argument.
      Returns:
      all rules appearing in this argument.
    • getAllConclusions

      public Collection<T> getAllConclusions()
      Returns all conclusions appearing in this argument.
      Returns:
      all conclusions appearing in this argument.
    • getDirectSubs

      public Collection<AspicArgument<T>> getDirectSubs()
      The argument's direct children, whose conclusions fit its prerequisites
      Returns:
      the direct subrules
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Argument
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Argument
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Argument
    • isAttack

      public static <T extends Invertable> boolean isAttack(AspicArgument<T> active, AspicArgument<T> passive, RuleFormulaGenerator<T> rfgen, Comparator<AspicArgument<T>> order)
      Determines whether the attack is successful
      Type Parameters:
      T - the type of formulas
      Parameters:
      active - the active argument
      passive - the passive argument
      rfgen - a rule formula generator
      order - a comparator
      Returns:
      true iff the attack is successful
    • shallowCopy

      public AspicArgument<T> shallowCopy()
      Returns:
      a shallow copy