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_SIGNATUREFields inherited from interface org.tweetyproject.graphs.Graph
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS -
Constructor Summary
ConstructorsConstructorDescriptiondefault 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 TypeMethodDescriptionbooleanAdds the given attacks to this dung theory.booleanAdds the given attack to this weighted Dung theory.booleanAdds the given attacks to this dung theory.booleanAdds the given attack to this weighted Dung theory.booleanadd(DungTheory theory) Adds all arguments and attacks of the given theory to this theory.booleanaddAllAttacks(Collection<? extends Attack> c) Adds the set of attacks to this Weighted Dung theory.booleanaddAllAttacks(Map<String, T> weights) Adds the set of attacks to this Weighted Dung theory.booleanAdds an attack from the first argument to the second to this weighted Dung theory.booleanAdds an attack from the first argument to the second to this weighted Dung theory.booleanAdds 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.booleangDefence(T gamma, Extension<DungTheory> e) Determines if the given extension can defend itself from all attacks up to a specified threshold gamma.booleanDetermines if the given extension can defend itself from a set of attackers up to a specified threshold gamma.booleanDetermines if the given extension can defend itself and specific arguments from a set of attackers up to a specified threshold gamma.booleangDefence(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.doublegetNumericWeight(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.inthashCode()booleanisAcceptable(Argument argument, Extension<DungTheory> ext) returns true if every attacker onargumentis successfully attacked by some accepted argument wrt.booleanisAlphaConflictFree(T alpha, Extension<DungTheory> ext) Determines if the given extension is alpha-conflict-free.booleanisAlphaGammaAdmissible(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is both alpha-conflict-free and gamma-defensible.booleanisAlphaGammaComplete(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is both alpha-gamma-complete.booleanisAlphaGammaPreferred(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is alpha-gamma-preferred.booleanisAlphaGammaStable(T alpha, T gamma, Extension<DungTheory> ext) Determines if the given extension is alpha-gamma-stable.booleanisAttacked(Extension<DungTheory> ext1, Extension<DungTheory> ext2) returns true if some argument ofext2attacks some argument inext1and ext1 cannot w-defend itselfbooleanisAttacked(Argument argument, Extension<? extends ArgumentationFramework<?>> ext) returns true if some argument ofextattacks argument and argument cannot w-defend itself.booleanisAttackedBy(Argument attacker, Collection<Argument> ext) returns true if some argument ofextis attacked by argument and cannot be w-defended by ext.booleanisAttackedBy(Argument arg1, Argument arg2) Checks whether arg1 is attacked by arg2 and cannot w-defend itself.booleanDetermines if the theory is coherent, i.e., if each preferred extension is stablebooleanisCoherent(T alpha, T gamma) Determines if the theory is coherent, i.e., if each alpha gamma preferred extension is stablebooleanDetermines if the theory is relatively coherent, i.e., if the grounded extension coincides with the intersection of all preferred extensionsbooleanisRelativelyCoherent(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 extensionsbooleanisSMA(Extension<DungTheory> attacker, Extension<DungTheory> attacked) Determines whether the given attacker Extension is a set-maximal attack on the attacked Extension.booleanisStronglyDefendedBy(Argument arg, Collection<Argument> ext) Checks whether a specified argument is strongly defended by the given set of arguments.booleanChecks whether "arg1" supports "arg2", i.e.booleanIndicates whether the framework is weighted.booleanreturns true iff the theory is well-founded, i.e., there is no infinite sequence A1,A2,...Pretty print of the theory.booleanRemoves the argument and all its attacks and the corresponding weightsbooleanRemoves the given attack from this weighted Dung theory.voidSets the weight of an attack between the specified attacker and attacked arguments in the framework.voidSets 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.booleanDetermines if the given extension can defend itself from all attacks.booleanwDefence(Extension<DungTheory> e, Set<Argument> attackers) Determines if the given extension can defend itself from a set of attackers.booleanDetermines if the given extension can defend itself and specific arguments from a set of attackers.booleanwDefence(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, getConnectedComponents, getEdge, getEdges, getInducedSubgraphs, getMinimalSignature, getNeighbors, getNodes, getNumberOfEdges, getNumberOfNodes, getParents, getReduct, getReduct, getRestriction, getStronglyConnectedComponents, getSubgraphs, getUnattackedAttackers, hasAttackBranch, hasDefenseBranch, hasSelfLoops, isAdmissible, isAttackBranch, isAttackingAllOtherArguments, isComplete, isConflictFree, isConflictFree, isDefenseBranch, isIndirectAttack, isPreferred, isStable, removeAllMethods inherited from class org.tweetyproject.commons.BeliefSet
add, addAll, clear, getSignature, isEmpty, iterator, remove, retainAll, setSignature, size, toArray, toArray, toStringMethods 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:
clonein 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:
addin classDungTheory- Parameters:
attack- an attack- Returns:
trueif 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:
addin classDungTheory- Parameters:
attacks- some attacks- Returns:
trueif 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:
addin classDungTheory- Parameters:
theory- some Dung theory- Returns:
trueif 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:
trueif 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:
addAttackin classDungTheory- Parameters:
attacker- some argumentattacked- some argument- Returns:
trueif 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:
addAllAttacksin classDungTheory- Parameters:
c- a collection of attacks- Returns:
trueif this Dung theory has been modified.
-
addAllAttacks
-
remove
Removes the given attack from this weighted Dung theory.- Overrides:
removein classDungTheory- Parameters:
attack- an attack- Returns:
trueif the set of attacks has been modified.
-
remove
Removes the argument and all its attacks and the corresponding weights- Overrides:
removein classDungTheory- Parameters:
a- some argument- Returns:
trueif 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 onargumentis successfully attacked by some accepted argument wrt. the given theory. This corresponds to the wDefence ofargument.- Overrides:
isAcceptablein classDungTheory- Parameters:
argument- an argumentext- an extension (the knowledge base)- Returns:
trueif every attacker onargumentis 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif the extension can defend itself from all attacks within the specified threshold;falseotherwise.
-
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:
trueif 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:
trueif the extension can defend itself and the specified arguments from the attackers within the specified threshold.
-
isAttacked
returns true if some argument ofextattacks argument and argument cannot w-defend itself.- Specified by:
isAttackedin interfaceArgumentationFramework<T>- Overrides:
isAttackedin classDungTheory- Parameters:
argument- an argumentext- an extension, ie. a set of arguments- Returns:
trueif some argument ofextsuccessfully attacks argument.
-
isAttackedBy
returns true if some argument ofextis attacked by argument and cannot be w-defended by ext.- Overrides:
isAttackedByin classDungTheory- Parameters:
attacker- an argumentext- an extension, ie. a set of arguments- Returns:
trueif some argument ofextis attacked by argument.
-
isAttacked
returns true if some argument ofext2attacks some argument inext1and ext1 cannot w-defend itself- Overrides:
isAttackedin classDungTheory- Parameters:
ext1- an extension, ie. a set of argumentsext2- an extension, ie. a set of arguments- Returns:
trueif some argument ofext2attacks some argument inext1
-
isAttackedBy
Checks whether arg1 is attacked by arg2 and cannot w-defend itself.- Overrides:
isAttackedByin classDungTheory- Parameters:
arg1- an argument.arg2- an argument.- Returns:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
trueif 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:
isWellFoundedin 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:
isCoherentin 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:
isRelativelyCoherentin 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:
hashCodein interfaceCollection<T>- Overrides:
hashCodein classDungTheory
-
isWeightedGraph
public boolean isWeightedGraph()Indicates whether the framework is weighted.- Specified by:
isWeightedGraphin interfaceGraph<T>- Overrides:
isWeightedGraphin classDungTheory- Returns:
- true
-
isSupport
Checks whether "arg1" supports "arg2", i.e. whether there is a path of supporting arguments between "arg1" and "arg2".- Overrides:
isSupportin 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:DungTheoryChecks whether a specified argument is strongly defended by the given set of arguments.- Overrides:
isStronglyDefendedByin 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:DungTheoryReturns 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:
getUndefendedAttacksin 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:
prettyPrintin classDungTheory- Returns:
- the pretty print of the theory.
-
toString
Generates a string representation of the framework.- Specified by:
toStringin interfaceBeliefBase- Specified by:
toStringin interfaceGraph<T>- Overrides:
toStringin classDungTheory- Returns:
- The string representation of the framework.
-