Class WeightedArgumentationFramework<T>
java.lang.Object
org.tweetyproject.commons.BeliefSet<Argument,DungSignature>
org.tweetyproject.arg.dung.syntax.DungTheory
org.tweetyproject.arg.weighted.syntax.WeightedArgumentationFramework<T>
- Type Parameters:
T
- Type
- All Implemented Interfaces:
Comparable<DungTheory>
,Iterable<Argument>
,Collection<Argument>
,ArgumentationFramework<Argument>
,BeliefBase
,GeneralGraph<Argument>
,Graph<Argument>
This class implements a weighted abstract argumentation theory (WAF) using a C-Semiring.
See
Bistarelli et al. "A novel weighted defence and its relaxation in abstract argumentation." International Journal of Approximate Reasoning 92 (2018): 66-86.
See
Bistarelli et al. "A novel weighted defence and its relaxation in abstract argumentation." International Journal of Approximate Reasoning 92 (2018): 66-86.
- Author:
- Sandra Hoffmann
-
Field Summary
Fields inherited from class org.tweetyproject.commons.BeliefSet
EQUALS_USES_SIGNATURE
Fields inherited from interface org.tweetyproject.graphs.Graph
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS
-
Constructor Summary
ConstructorDescriptiondefault constructor returns classic Dung style AF using a Boolean SemiringWeightedArgumentationFramework
(Semiring<T> semiring) Constructor for WAF with specific SemiringWeightedArgumentationFramework
(Semiring<T> semiring, Graph<Argument> graph) Constructor for WAF from a graph with a specific Semiring.WeightedArgumentationFramework
(Semiring<T> semiring, Graph<Argument> graph, Map<String, T> weightMap) Constructs a Weighted Argumentation Framework using the specified semiring, graph, and weight map. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds the given attacks to this dung theory.boolean
Adds the given attack to this weighted Dung theory.boolean
Adds the given attacks to this dung theory.boolean
Adds the given attack to this weighted Dung theory.boolean
add
(DungTheory theory) Adds all arguments and attacks of the given theory to this theory.boolean
addAllAttacks
(Collection<? extends Attack> c) Adds the set of attacks to this Weighted Dung theory.boolean
addAllAttacks
(Map<String, T> weights) Adds the set of attacks to this Weighted Dung theory.boolean
Adds an attack from the first argument to the second to this weighted Dung theory.boolean
Adds an attack from the first argument to the second to this weighted Dung theory.boolean
Adds the given attack to this weighted Dung theory.clone()
compareWeights
(Attack attackA, Attack attackB) Compares the weights of two attacks and returns the weight of the stronger attack.boolean
gDefence
(T gamma, Extension<DungTheory> e) Determines if the given extension can defend itself from all attacks up to a specified threshold gamma.boolean
Determines if the given extension can defend itself from a set of attackers up to a specified threshold gamma.boolean
Determines if the given extension can defend itself and specific arguments from a set of attackers up to a specified threshold gamma.boolean
gDefence
(T gamma, Argument a, Extension<DungTheory> e) Determines if the given extension can defend itself and argument a from all attacks up to a specified threshold gamma.Retrieves the set of arguments defended by the given argument.double
getNumericWeight
(Attack attack) Retrieves the numeric value of the weight associated with a given attack in the framework.Retrieves the semiring used in the framework.Returns the set of attacks (b,a) such that a is in ext and there is no c in ext such that (c,b) is an attack.Retrieves the weight of a given attack in the framework.Retrieves all weights in the framework.int
hashCode()
boolean
isAcceptable
(Argument argument, Extension<DungTheory> ext) returns true if every attacker onargument
is successfully attacked by some accepted argument wrt.boolean
isAlphaConflictFree
(T alpha, Extension<DungTheory> ext) Determines if the given extension is alpha-conflict-free.boolean
isAlphaGammaAdmissible
(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is both alpha-conflict-free and gamma-defensible.boolean
isAlphaGammaComplete
(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is both alpha-gamma-complete.boolean
isAlphaGammaPreferred
(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is alpha-gamma-preferred.boolean
isAlphaGammaStable
(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is alpha-gamma-stable.boolean
isAttacked
(Extension<DungTheory> ext1, Extension<DungTheory> ext2) returns true if some argument ofext2
attacks some argument inext1
and ext1 cannot w-defend itselfboolean
isAttacked
(Argument argument, Extension<? extends ArgumentationFramework<?>> ext) returns true if some argument ofext
attacks argument and argument cannot w-defend itself.boolean
isAttackedBy
(Argument attacker, Collection<Argument> ext) returns true if some argument ofext
is attacked by argument and cannot be w-defended by ext.boolean
isAttackedBy
(Argument arg1, Argument arg2) Checks whether arg1 is attacked by arg2 and cannot w-defend itself.boolean
Determines if the theory is coherent, i.e., if each preferred extension is stableboolean
isCoherent
(T alpha, T gamma) Determines if the theory is coherent, i.e., if each alpha gamma preferred extension is stableboolean
Determines if the theory is relatively coherent, i.e., if the grounded extension coincides with the intersection of all preferred extensionsboolean
isRelativelyCoherent
(T alpha, T gamma) Determines if the theory is relatively coherent, i.e., if the alpha gamma grounded extension coincides with the intersection of all alpha gamma preferred extensionsboolean
isSMA
(Extension<DungTheory> attacker, Extension<DungTheory> attacked) Determines whether the given attacker Extension is a set-maximal attack on the attacked Extension.boolean
isStronglyDefendedBy
(Argument arg, Collection<Argument> ext) Checks whether a specified argument is strongly defended by the given set of arguments.boolean
Checks whether "arg1" supports "arg2", i.e.boolean
Indicates whether the framework is weighted.boolean
returns true iff the theory is well-founded, i.e., there is no infinite sequence A1,A2,...Pretty print of the theory.boolean
Removes the argument and all its attacks and the corresponding weightsboolean
Removes the given attack from this weighted Dung theory.void
Sets the weight of an attack between the specified attacker and attacked arguments in the framework.void
Sets the weight of a given attack in the framework.strongerAttack
(Attack attackA, Attack attackB) Determines the stronger attack between two given attacks based on their weights.toString()
Generates a string representation of the framework.boolean
Determines if the given extension can defend itself from all attacks.boolean
wDefence
(Extension<DungTheory> e, Set<Argument> attackers) Determines if the given extension can defend itself from a set of attackers.boolean
Determines if the given extension can defend itself and specific arguments from a set of attackers.boolean
wDefence
(Argument a, Extension<DungTheory> e) Determines if the given extension can defend a specific argument from all attacks.Methods inherited from class org.tweetyproject.arg.dung.syntax.DungTheory
add, add, areAdjacent, compareTo, contains, containsAll, containsAttack, containsCycle, containsOddCycle, equals, equalsIn, existsDirectedPath, faf, getAdjacencyMatrix, getAttacked, getAttacked, getAttackers, getAttackers, getAttacks, getBidirectionalAttacks, getChildren, getComplementGraph, getComponents, getEdge, getEdges, getInducedSubgraphs, getMinimalSignature, getNeighbors, getNodes, getNumberOfEdges, getNumberOfNodes, getParents, getReduct, getRestriction, getStronglyConnectedComponents, getSubgraphs, getUnattackedAttackers, hasAttackBranch, hasDefenseBranch, hasSelfLoops, isAdmissible, isAttackBranch, isAttackingAllOtherArguments, isComplete, isConflictFree, isConflictFree, isDefenseBranch, isIndirectAttack, isStable, removeAll
Methods inherited from class org.tweetyproject.commons.BeliefSet
add, addAll, clear, getSignature, isEmpty, iterator, remove, retainAll, setSignature, size, toArray, toArray, toString
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
WeightedArgumentationFramework
public WeightedArgumentationFramework()default constructor returns classic Dung style AF using a Boolean Semiring -
WeightedArgumentationFramework
-
WeightedArgumentationFramework
Constructor for WAF from a graph with a specific Semiring. The weights will be initialized to the zeroElement of the Semiring.- Parameters:
semiring
- The semiring used to model the weightsgraph
- The graph representing the argumentation framework.
-
WeightedArgumentationFramework
public WeightedArgumentationFramework(Semiring<T> semiring, Graph<Argument> graph, Map<String, T> weightMap) Constructs a Weighted Argumentation Framework using the specified semiring, graph, and weight map.- Parameters:
semiring
- The semiring used to model the weightsgraph
- The graph representing the argumentation framework.weightMap
- A map associating argument identifiers (as strings) with their corresponding weights.
-
-
Method Details
-
clone
- Overrides:
clone
in classDungTheory
-
add
Adds the given attack to this weighted Dung theory. The weight will be set to the strongest Attack (zeroElement) of the Semiring.- Overrides:
add
in classDungTheory
- Parameters:
attack
- an attack- Returns:
true
if the set of attacks has been modified.
-
add
-
add
Adds the given attacks to this dung theory. The weights will be set to the strongest Attack (zeroElement) of the Semiring.- Overrides:
add
in classDungTheory
- Parameters:
attacks
- some attacks- Returns:
true
if the set of attacks has been modified.
-
add
-
add
Adds all arguments and attacks of the given theory to this theory. The weights will be set to the strongest Attack (zeroElement) of the Semiring.- Overrides:
add
in classDungTheory
- Parameters:
theory
- some Dung theory- Returns:
true
if this Weighted Dung Theory has been modified
-
addAttack
Adds the given attack to this weighted Dung theory. The weight will be set to the strongest Attack (zeroElement) of the Semiring.- Parameters:
attack
- an attack- Returns:
true
if the set of attacks has been modified.
-
addAttack
Adds an attack from the first argument to the second to this weighted Dung theory. The weight will be set to the strongest Attack (zeroElement) of the Semiring.- Overrides:
addAttack
in classDungTheory
- Parameters:
attacker
- some argumentattacked
- some argument- Returns:
true
if the set of attacks has been modified.
-
addAttack
-
addAllAttacks
Adds the set of attacks to this Weighted Dung theory. The weights will be set to the strongest Attack (zeroElement) of the Semiring.- Overrides:
addAllAttacks
in classDungTheory
- Parameters:
c
- a collection of attacks- Returns:
true
if this Dung theory has been modified.
-
addAllAttacks
-
remove
Removes the given attack from this weighted Dung theory.- Overrides:
remove
in classDungTheory
- Parameters:
attack
- an attack- Returns:
true
if the set of attacks has been modified.
-
remove
Removes the argument and all its attacks and the corresponding weights- Overrides:
remove
in classDungTheory
- Parameters:
a
- some argument- Returns:
true
if this structure has been changed
-
strongerAttack
Determines the stronger attack between two given attacks based on their weights.- Parameters:
attackA
- The first attack for comparison.attackB
- The second attack for comparison.- Returns:
- The stronger attack, considering their weights according to the specified semiring.
-
compareWeights
-
isAcceptable
returns true if every attacker onargument
is successfully attacked by some accepted argument wrt. the given theory. This corresponds to the wDefence ofargument
.- Overrides:
isAcceptable
in classDungTheory
- Parameters:
argument
- an argumentext
- an extension (the knowledge base)- Returns:
true
if every attacker onargument
is attacked by some accepted argument wrt. the given theory.
-
wDefence
Determines if the given extension can defend itself from all attacks.- Parameters:
e
- The extension to be checked for weighted defensibility.- Returns:
true
if the extension can defend itself from all attacks.
-
wDefence
Determines if the given extension can defend a specific argument from all attacks.- Parameters:
a
- The argument to be defended.e
- The extension to w-defend a.- Returns:
true
if the extension can defend the argument from all attacks.
-
wDefence
Determines if the given extension can defend itself from a set of attackers.- Parameters:
e
- The extension to w-defend itself.attackers
- The set of arguments representing attackers.- Returns:
true
if the extension can defend itself from the specified attackers.
-
wDefence
Determines if the given extension can defend itself and specific arguments from a set of attackers.- Parameters:
e
- The extension to w-defend itself and attacked.attackers
- The set of arguments representing attackers.attacked
- The set of arguments that need to be defended by e.- Returns:
true
if the extension can defend itself and the specified arguments from the attackers.
-
gDefence
Determines if the given extension can defend itself from all attacks up to a specified threshold gamma.- Parameters:
gamma
- The threshold for defense, representing the maximum allowable difference between the attack and defense weights.e
- The extension to g-defend itself.- Returns:
true
if the extension can defend itself from all attacks within the specified threshold.
-
gDefence
Determines if the given extension can defend itself and argument a from all attacks up to a specified threshold gamma.- Parameters:
gamma
- The threshold for defense, representing the maximum allowable difference between the attack and defense weights.a
- The argument to be defended by e.e
- The extension to g-defend itself.- Returns:
true
if the extension can defend itself from all attacks within the specified threshold;false
otherwise.
-
gDefence
Determines if the given extension can defend itself from a set of attackers up to a specified threshold gamma.- Parameters:
gamma
- The threshold for defense, representing the maximum allowable difference between the attack and defense weights.e
- The extension to g-defend itself.attackers
- The set of arguments representing attackers.- Returns:
true
if the extension can defend itself from the specified attackers within the specified threshold.
-
gDefence
public boolean gDefence(T gamma, Extension<DungTheory> e, Set<Argument> attackers, Set<Argument> attacked) Determines if the given extension can defend itself and specific arguments from a set of attackers up to a specified threshold gamma.- Parameters:
gamma
- he threshold for defense, representing the maximum allowable difference between the attack and defense weights.e
- The extension to g-defend itself.attackers
- The set of arguments representing attackers.attacked
- The set of arguments that need to be defended by the extension.- Returns:
true
if the extension can defend itself and the specified arguments from the attackers within the specified threshold.
-
isAttacked
returns true if some argument ofext
attacks argument and argument cannot w-defend itself.- Specified by:
isAttacked
in interfaceArgumentationFramework<T>
- Overrides:
isAttacked
in classDungTheory
- Parameters:
argument
- an argumentext
- an extension, ie. a set of arguments- Returns:
true
if some argument ofext
successfully attacks argument.
-
isAttackedBy
returns true if some argument ofext
is attacked by argument and cannot be w-defended by ext.- Overrides:
isAttackedBy
in classDungTheory
- Parameters:
attacker
- an argumentext
- an extension, ie. a set of arguments- Returns:
true
if some argument ofext
is attacked by argument.
-
isAttacked
returns true if some argument ofext2
attacks some argument inext1
and ext1 cannot w-defend itself- Overrides:
isAttacked
in classDungTheory
- Parameters:
ext1
- an extension, ie. a set of argumentsext2
- an extension, ie. a set of arguments- Returns:
true
if some argument ofext2
attacks some argument inext1
-
isAttackedBy
Checks whether arg1 is attacked by arg2 and cannot w-defend itself.- Overrides:
isAttackedBy
in classDungTheory
- Parameters:
arg1
- an argument.arg2
- an argument.- Returns:
true
if arg1 is attacked by arg2
-
isAlphaConflictFree
Determines if the given extension is alpha-conflict-free.- Parameters:
alpha
- The threshold representing the maximum allowable combined weight of internal attacks.ext
- The extension to be checked for alpha-conflict-freeness.- Returns:
true
if the extension is alpha-conflict-free.
-
isAlphaGammaAdmissible
Determines if the given extension is both alpha-conflict-free and gamma-defensible.- Parameters:
alpha
- The threshold representing the maximum allowable combined weight of internal attacks.gamma
- The threshold for defense, representing the maximum allowable difference between the aggregated weights of attack and defense.ext
- The extension to be checked for alpha-gamma-admissibility.- Returns:
true
if the extension is alpha-conflict-free and gamma-defensible.
-
isAlphaGammaComplete
Determines if the given extension is both alpha-gamma-complete.- Parameters:
alpha
- The threshold representing the maximum allowable combined weight of internal attacks.gamma
- The threshold for defense, representing the maximum allowable difference between the aggregated weights of attack and defense.ext
- The extension to be checked for alpha-gamma-completeness.- Returns:
true
if the extension is alpha-gamma-complete.
-
isAlphaGammaPreferred
Determines if the given extension is alpha-gamma-preferred.- Parameters:
alpha
- The threshold representing the maximum allowable combined weight of internal attacks.gamma
- The threshold for defense, representing the maximum allowable difference between the aggregated weights of attack and defense.ext
- The extension to be checked for alpha-gamma-preference.- Returns:
true
if the extension is alpha-gamma-preferred.
-
isAlphaGammaStable
Determines if the given extension is alpha-gamma-stable.- Parameters:
alpha
- The threshold representing the maximum allowable combined weight of internal attacks.gamma
- The threshold for defense, representing the maximum allowable difference between the aggregated weights of attack and defense.ext
- The extension to be checked for alpha-gamma-stability.- Returns:
true
if the extension is alpha-gamma-stable.
-
isSMA
Determines whether the given attacker Extension is a set-maximal attack on the attacked Extension.- Parameters:
attacker
- The set to be checked for set-maximal attack.attacked
- The set that is potentially being attacked.- Returns:
- true if the attacker is a set-maximal attack on the attacked set, false otherwise.
-
isWellFounded
public boolean isWellFounded()returns true iff the theory is well-founded, i.e., there is no infinite sequence A1,A2,... of SMAs with Ai+1 w-defending Ai- Overrides:
isWellFounded
in classDungTheory
- Returns:
- true iff the theory is well-founded
-
isCoherent
public boolean isCoherent()Determines if the theory is coherent, i.e., if each preferred extension is stable- Overrides:
isCoherent
in classDungTheory
- Returns:
- true if the theory is coherent
-
isCoherent
-
isRelativelyCoherent
public boolean isRelativelyCoherent()Determines if the theory is relatively coherent, i.e., if the grounded extension coincides with the intersection of all preferred extensions- Overrides:
isRelativelyCoherent
in classDungTheory
- Returns:
- true if the theory is relatively coherent
-
isRelativelyCoherent
Determines if the theory is relatively coherent, i.e., if the alpha gamma grounded extension coincides with the intersection of all alpha gamma preferred extensions- Parameters:
alpha
- the alpha valuegamma
- the gammavalue- Returns:
- true if the theory is relatively coherent
-
setWeight
-
setWeight
-
getWeight
-
getWeights
-
getNumericWeight
Retrieves the numeric value of the weight associated with a given attack in the framework.- Parameters:
attack
- The attack for which the numeric weight is retrieved.- Returns:
- The numeric value of the weight of the specified attack.
-
getSemiring
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<T>
- Overrides:
hashCode
in classDungTheory
-
isWeightedGraph
public boolean isWeightedGraph()Indicates whether the framework is weighted.- Specified by:
isWeightedGraph
in interfaceGraph<T>
- Overrides:
isWeightedGraph
in classDungTheory
- Returns:
- true
-
isSupport
Checks whether "arg1" supports "arg2", i.e. whether there is a path of supporting arguments between "arg1" and "arg2".- Overrides:
isSupport
in classDungTheory
- Parameters:
arg1
- an AbstractArgument.arg2
- an AbstractArgument.- Returns:
- "true" iff "arg1" supports "arg2".
-
getDefendedArguments
Retrieves the set of arguments defended by the given argument. In order for b to be defended by a, all attackers of b that are also attacked by a have to be defeated by a. E.g if (c,b) and (d,b) as well as (a,c) and (a,d) are attacks, then w(a,c) + w(a,d) >= w(c,b) + w(d,b) is required for b to be defended by a.- Parameters:
arg
- The argument for which defended arguments are to be retrieved.- Returns:
- A set of arguments defended by the given argument.
-
isStronglyDefendedBy
Description copied from class:DungTheory
Checks whether a specified argument is strongly defended by the given set of arguments.- Overrides:
isStronglyDefendedBy
in classDungTheory
- Parameters:
arg
- some argumentext
- a set of arguments- Returns:
- true, iff the specified argument is strongly defended by the set
-
getUndefendedAttacks
Description copied from class:DungTheory
Returns the set of attacks (b,a) such that a is in ext and there is no c in ext such that (c,b) is an attack.- Overrides:
getUndefendedAttacks
in classDungTheory
- Parameters:
ext
- some set of arguments.- Returns:
- the set of attacks (b,a) such that a is in ext and there is no c in ext such that (c,b) is an attack.
-
prettyPrint
Pretty print of the theory.- Overrides:
prettyPrint
in classDungTheory
- Returns:
- the pretty print of the theory.
-
toString
Generates a string representation of the framework.- Specified by:
toString
in interfaceBeliefBase
- Specified by:
toString
in interfaceGraph<T>
- Overrides:
toString
in classDungTheory
- Returns:
- The string representation of the framework.
-