Class ExtendedTheory

java.lang.Object
org.tweetyproject.commons.BeliefSet<Argument,DungSignature>
org.tweetyproject.arg.extended.syntax.ExtendedTheory
All Implemented Interfaces:
Iterable<Argument>, Collection<Argument>, ArgumentationFramework<Argument>, BeliefBase

public class ExtendedTheory extends BeliefSet<Argument,DungSignature> implements ArgumentationFramework<Argument>, Collection<Argument>
Implementation of extended argumentation frameworks in the sense of Modgil
Author:
Lars Bengel
See Also:
  • "Sanjay Modgil. Reasoning about Preferences in Argumentation Frameworks. Artificial Intelligence, 2009."
  • Constructor Details

    • ExtendedTheory

      public ExtendedTheory()
      Initializes an empty Extended Theory
  • Method Details

    • isConflictFree

      public boolean isConflictFree(Collection<Argument> ext)
      Determines whether the given set of arguments contains no conflicts, i.e., there are no attacks between any of its members
      Parameters:
      ext - some set of arguments
      Returns:
      "true" if there is no attack between any of the arguments
    • isUndisturbedAttack

      public boolean isUndisturbedAttack(Argument a, Argument b, Collection<Argument> ext)
      Determines whether there is an undisturbed attack from 'a' to 'b' given 'ext', i.e., whether 'a' attacks 'b' and there is no extended attack from some element of 'ext' onto the attack (a,b)
      Parameters:
      a - some argument
      b - some argument
      ext - some set of arguments
      Returns:
      "true" if 'a' attacks 'b' undisturbed given 'ext'
    • isUndisturbedAttack

      public boolean isUndisturbedAttack(Attack att, Collection<Argument> ext)
      Determines whether there is an undisturbed attack from 'a' to 'b' given 'ext', i.e., whether 'a' attacks 'b' and there is no extended attack from some element of 'ext' onto the attack (a,b)
      Parameters:
      att - some attack (a,b)
      ext - some set of arguments
      Returns:
      "true" if 'a' attacks 'b' undisturbed given 'ext'
    • isReinstatementSet

      public boolean isReinstatementSet(Collection<Attack> W, Argument a, Argument b, Collection<Argument> S)
      Determines whether 'W' is a reinstatement set for the attack (a,b) A set of attacks W is a reinstatement set for an attack (a,b) iff (a,b) is an attack undisturbed by the set S and W contains all attack originating from S necessary to reinstate the attack (a,b) against all its attacks
      Parameters:
      W - some set of attacks
      a - some argument
      b - some argument
      S - some set of arguments
      Returns:
      "true" iff 'W' is a reinstatement for (a,b)
    • minimizeReinstatementSet

      public Collection<Attack> minimizeReinstatementSet(Collection<Attack> W, Argument a, Argument b, Collection<Argument> S)
      Minimizes the given Reinstatement set for (a,b)
      Parameters:
      W - some set of attacks
      a - some argument
      b - some argument
      S - some set of arguments
      Returns:
      the minimal reinstatement set for (a,b)
    • getReinstatementSet

      public Collection<Attack> getReinstatementSet(Argument a, Argument b, Collection<Argument> S)
      Computes the reinstatement set for the attack (a,b)
      Parameters:
      a - some argument
      b - some argument
      S - a set of arguments
      Returns:
      a reinstatement set for the attack (a,b); null if none exists
    • existsReinstatementSet

      public boolean existsReinstatementSet(Argument a, Argument b, Collection<Argument> S)
      Determines whether there exists a reinstatement set for the attack (a,b)
      Parameters:
      a - some argument
      b - some argument
      S - a set of arguments
      Returns:
      "true" iff there exists a reinstatement set for the attack (a,b)
    • isAcceptable

      public boolean isAcceptable(Argument arg, Collection<Argument> ext)
      Determines whether the argument 'arg' is defended by the set 'ext'
      Parameters:
      arg - some argument
      ext - some set of arguments
      Returns:
      "true" iff 'arg' is defended by 'ext'
    • isAdmissible

      public boolean isAdmissible(Collection<Argument> ext)
      Determines whether 'ext' is admissible, i.e., conflict-free and defends all its arguments
      Parameters:
      ext - some set of arguments
      Returns:
      "true" iff 'ext' is admissible
    • isComplete

      public boolean isComplete(Collection<Argument> ext)
      Determines whether 'ext' is complete, i.e., admissible and contains all arguments defended by it
      Parameters:
      ext - some set of arguments
      Returns:
      "true" iff 'ext' is complete
    • getAttackers

      public Collection<Argument> getAttackers(Attack attack)
      Computes the set of attackers of 'attack'
      Parameters:
      attack - some attack
      Returns:
      the attackers of 'attack'
    • getAttackers

      public Collection<Argument> getAttackers(Argument argument)
      Computes the set of attackers of 'argument'
      Parameters:
      argument - some argument
      Returns:
      the attackers of 'argument'
    • getAttackers

      public Collection<Argument> getAttackers(Collection<DungEntity> entities)
      Computes the set of attackers of 'entities'
      Parameters:
      entities - a set of arguments and attacks
      Returns:
      the attackers of 'entities'
    • getAttacked

      public Collection<DungEntity> getAttacked(Argument argument)
      Computes the set of Arguments/Attacks attacked by 'argument'
      Parameters:
      argument - some argument
      Returns:
      the set of Arguments/Attacks attacked by 'argument'
    • getAttacked

      public Collection<DungEntity> getAttacked(Collection<Argument> ext)
      Computes the set of Arguments/Attacks attacked by 'ext'
      Parameters:
      ext - some set of arguments
      Returns:
      the set of Arguments/Attacks attacked by 'ext'
    • flatten

      public DungTheory flatten()
      Transforms the extended theory into a standard dung theory by flattening the extended attacks via creating meta-arguments
      Returns:
      the flattened theory
    • contains

      public boolean contains(Object o)
      Specified by:
      contains in interface Collection<Argument>
      Overrides:
      contains in class BeliefSet<Argument,DungSignature>
    • add

      public boolean add(Argument argument)
      Specified by:
      add in interface Collection<Argument>
      Overrides:
      add in class BeliefSet<Argument,DungSignature>
    • addAttack

      public boolean addAttack(Argument attacker, Argument attacked)
      Adds an attack to the theory
      Parameters:
      attacker - some argument
      attacked - some argument
      Returns:
      true iff the attack has been added successfully
    • addAttack

      public boolean addAttack(Argument attacker, Attack attacked)
      Adds an attack to the theory
      Parameters:
      attacker - some argument
      attacked - some attack
      Returns:
      true iff the attack has been added successfully
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<Argument>
      Overrides:
      remove in class BeliefSet<Argument,DungSignature>
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<Argument>
      Overrides:
      removeAll in class BeliefSet<Argument,DungSignature>
    • retainAll

      public boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<Argument>
      Overrides:
      retainAll in class BeliefSet<Argument,DungSignature>
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<Argument>
      Overrides:
      clear in class BeliefSet<Argument,DungSignature>
    • isAttacked

      public boolean isAttacked(Argument a, Extension<? extends ArgumentationFramework<?>> ext)
      Description copied from interface: ArgumentationFramework
      Determines whether a given argument is attacked by any arguments in the specified extension.
      Specified by:
      isAttacked in interface ArgumentationFramework<Argument>
      Parameters:
      a - the argument to check if it is being attacked.
      ext - the extension that potentially contains attackers of the argument.
      Returns:
      true if the argument a is attacked by any argument in the given extension ext, false otherwise.
    • isAttacked

      public boolean isAttacked(Argument a, Argument b)
      Determines whether 'a' is attacked by 'b' in the theory
      Parameters:
      a - some argument
      b - some argument
      Returns:
      "true" iff 'b' attacks 'a'
    • isAttacked

      public boolean isAttacked(Attack a, Argument b)
      Determines whether 'a' is attacked by 'b' in the theory
      Parameters:
      a - some attack
      b - some argument
      Returns:
      "true" iff 'b' attacks 'a'
    • getNodes

      public Collection<Argument> getNodes()
      Description copied from interface: ArgumentationFramework
      Retrieves all the nodes (arguments) of this argumentation framework.
      Specified by:
      getNodes in interface ArgumentationFramework<Argument>
      Returns:
      a collection of all arguments (nodes) within this framework.
    • getAllAttacks

      public Collection<DungEntity> getAllAttacks()
      Computes the set of all attacks in the theory
      Returns:
      the set of all attacks of the theory
    • getExtendedAttacks

      public Collection<ExtendedAttack> getExtendedAttacks()
      Computes the set of all extended attack, i.e., the attacks from arguments to attacks
      Returns:
      the set of extended attacks of the theory
    • getBinaryAttacks

      public Collection<Attack> getBinaryAttacks()
      Computes the set of all binary attacks, i.e., the attacks between arguments
      Returns:
      the set of binary attacks of the theory
    • getMinimalSignature

      public Signature getMinimalSignature()
      Description copied from interface: BeliefBase
      Returns the signature of the language of this knowledge base.
      Specified by:
      getMinimalSignature in interface BeliefBase
      Returns:
      the signature of the language of this knowledge base.
    • prettyPrint

      public String prettyPrint()
      Pretty Prints the extended theory
      Returns:
      a string representation of the extended theory