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:
-
Field Summary
Fields inherited from class org.tweetyproject.commons.BeliefSet
EQUALS_USES_SIGNATURE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Adds an attack to the theoryboolean
Adds an attack to the theoryvoid
clear()
boolean
boolean
existsReinstatementSet
(Argument a, Argument b, Collection<Argument> S) Determines whether there exists a reinstatement set for the attack (a,b)flatten()
Transforms the extended theory into a standard dung theory by flattening the extended attacks via creating meta-argumentsComputes the set of all attacks in the theorygetAttacked
(Collection<Argument> ext) Computes the set of Arguments/Attacks attacked by 'ext'getAttacked
(Argument argument) Computes the set of Arguments/Attacks attacked by 'argument'getAttackers
(Collection<DungEntity> entities) Computes the set of attackers of 'entities'getAttackers
(Argument argument) Computes the set of attackers of 'argument'getAttackers
(Attack attack) Computes the set of attackers of 'attack'Computes the set of all binary attacks, i.e., the attacks between argumentsComputes the set of all extended attack, i.e., the attacks from arguments to attacksReturns the signature of the language of this knowledge base.getNodes()
Retrieves all the nodes (arguments) of this argumentation framework.getReinstatementSet
(Argument a, Argument b, Collection<Argument> S) Computes the reinstatement set for the attack (a,b)boolean
isAcceptable
(Argument arg, Collection<Argument> ext) Determines whether the argument 'arg' is defended by the set 'ext'boolean
isAdmissible
(Collection<Argument> ext) Determines whether 'ext' is admissible, i.e., conflict-free and defends all its argumentsboolean
isAttacked
(Argument a, Extension<? extends ArgumentationFramework<?>> ext) Determines whether a given argument is attacked by any arguments in the specified extension.boolean
isAttacked
(Argument a, Argument b) Determines whether 'a' is attacked by 'b' in the theoryboolean
isAttacked
(Attack a, Argument b) Determines whether 'a' is attacked by 'b' in the theoryboolean
isComplete
(Collection<Argument> ext) Determines whether 'ext' is complete, i.e., admissible and contains all arguments defended by itboolean
isConflictFree
(Collection<Argument> ext) Determines whether the given set of arguments contains no conflicts, i.e., there are no attacks between any of its membersboolean
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 attacksboolean
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)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)minimizeReinstatementSet
(Collection<Attack> W, Argument a, Argument b, Collection<Argument> S) Minimizes the given Reinstatement set for (a,b)Pretty Prints the extended theoryboolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) Methods inherited from class org.tweetyproject.commons.BeliefSet
add, addAll, containsAll, equals, getSignature, hashCode, isEmpty, iterator, setSignature, size, toArray, toArray, toString, toString
Methods inherited from interface org.tweetyproject.arg.dung.syntax.ArgumentationFramework
containsAll
Methods inherited from interface org.tweetyproject.commons.BeliefBase
toString
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeIf, size, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
ExtendedTheory
public ExtendedTheory()Initializes an empty Extended Theory
-
-
Method Details
-
isConflictFree
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
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 argumentb
- some argumentext
- some set of arguments- Returns:
- "true" if 'a' attacks 'b' undisturbed given 'ext'
-
isUndisturbedAttack
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 attacksa
- some argumentb
- some argumentS
- 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 attacksa
- some argumentb
- some argumentS
- some set of arguments- Returns:
- the minimal reinstatement set for (a,b)
-
getReinstatementSet
Computes the reinstatement set for the attack (a,b)- Parameters:
a
- some argumentb
- some argumentS
- a set of arguments- Returns:
- a reinstatement set for the attack (a,b); null if none exists
-
existsReinstatementSet
Determines whether there exists a reinstatement set for the attack (a,b)- Parameters:
a
- some argumentb
- some argumentS
- a set of arguments- Returns:
- "true" iff there exists a reinstatement set for the attack (a,b)
-
isAcceptable
Determines whether the argument 'arg' is defended by the set 'ext'- Parameters:
arg
- some argumentext
- some set of arguments- Returns:
- "true" iff 'arg' is defended by 'ext'
-
isAdmissible
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
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
Computes the set of attackers of 'attack'- Parameters:
attack
- some attack- Returns:
- the attackers of 'attack'
-
getAttackers
Computes the set of attackers of 'argument'- Parameters:
argument
- some argument- Returns:
- the attackers of 'argument'
-
getAttackers
Computes the set of attackers of 'entities'- Parameters:
entities
- a set of arguments and attacks- Returns:
- the attackers of 'entities'
-
getAttacked
Computes the set of Arguments/Attacks attacked by 'argument'- Parameters:
argument
- some argument- Returns:
- the set of Arguments/Attacks attacked by 'argument'
-
getAttacked
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
Transforms the extended theory into a standard dung theory by flattening the extended attacks via creating meta-arguments- Returns:
- the flattened theory
-
contains
- Specified by:
contains
in interfaceCollection<Argument>
- Overrides:
contains
in classBeliefSet<Argument,
DungSignature>
-
add
- Specified by:
add
in interfaceCollection<Argument>
- Overrides:
add
in classBeliefSet<Argument,
DungSignature>
-
addAttack
-
addAttack
-
remove
- Specified by:
remove
in interfaceCollection<Argument>
- Overrides:
remove
in classBeliefSet<Argument,
DungSignature>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<Argument>
- Overrides:
removeAll
in classBeliefSet<Argument,
DungSignature>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<Argument>
- Overrides:
retainAll
in classBeliefSet<Argument,
DungSignature>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Argument>
- Overrides:
clear
in classBeliefSet<Argument,
DungSignature>
-
isAttacked
Description copied from interface:ArgumentationFramework
Determines whether a given argument is attacked by any arguments in the specified extension.- Specified by:
isAttacked
in interfaceArgumentationFramework<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 extensionext
, false otherwise.
-
isAttacked
-
isAttacked
-
getNodes
Description copied from interface:ArgumentationFramework
Retrieves all the nodes (arguments) of this argumentation framework.- Specified by:
getNodes
in interfaceArgumentationFramework<Argument>
- Returns:
- a collection of all arguments (nodes) within this framework.
-
getAllAttacks
Computes the set of all attacks in the theory- Returns:
- the set of all attacks of the theory
-
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
Computes the set of all binary attacks, i.e., the attacks between arguments- Returns:
- the set of binary attacks of the theory
-
getMinimalSignature
Description copied from interface:BeliefBase
Returns the signature of the language of this knowledge base.- Specified by:
getMinimalSignature
in interfaceBeliefBase
- Returns:
- the signature of the language of this knowledge base.
-
prettyPrint
Pretty Prints the extended theory- Returns:
- a string representation of the extended theory
-