Package net.sf.tweety.arg.bipolar.syntax
Class BipolarArgFramework
- java.lang.Object
-
- net.sf.tweety.commons.BeliefSet<Argument,DungSignature>
-
- net.sf.tweety.arg.dung.syntax.DungTheory
-
- net.sf.tweety.arg.bipolar.syntax.BipolarArgFramework
-
- All Implemented Interfaces:
java.lang.Comparable<DungTheory>
,java.lang.Iterable<Argument>
,java.util.Collection<Argument>
,BeliefBase
,Graph<Argument>
- Direct Known Subclasses:
EvidentialArgSystem
public class BipolarArgFramework extends DungTheory
This class implements a bipolar abstract argumentation theory with support in a deductive sense. ie. if a supports b, then the acceptance of a implies the acceptance of b and as a consequence the non-acceptance of b implies the non-acceptance of a.
See
Cayrol, Lagasquie-Schiex. Bipolarity in argumentation graphs: Towards a better understanding. 2013
and
Boella et al. Support in Abstract Argumentation. 2010
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<BipolarArgFramework,java.util.Collection<Graph<Argument>>>
archivedSubgraphs
For archiving sub graphsprivate java.util.Map<Argument,java.util.Set<Argument>>
supportChildren
private java.util.Map<Argument,java.util.Set<Argument>>
supportParents
explicit listing of direct supporters and supported (for efficiency reasons)-
Fields inherited from class net.sf.tweety.commons.BeliefSet
EQUALS_USES_SIGNATURE, signature
-
Fields inherited from interface net.sf.tweety.graphs.Graph
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS
-
-
Constructor Summary
Constructors Constructor Description BipolarArgFramework()
Default constructor; initializes empty sets of arguments, attacks and supportsBipolarArgFramework(Graph<Argument> graph)
Creates a new theory from the given graph.
-
Method Summary
Modifier and Type Method Description boolean
add(BipolarArgFramework baf)
Adds all arguments, attacks and supports of the given framework to this frameworkboolean
add(Support support)
Adds the given support to this bipolar argumentation framework.boolean
addAllSupports(java.util.Collection<? extends Support> c)
Adds the set of supports to this bipolar argumentation framework.boolean
addSupport(Argument supporter, Argument supported)
Adds a support from the first argument to the second to this bipolar argumentation framework.boolean
areAdjacent(Argument a, Argument b)
Returns "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.boolean
contains(java.lang.Object o)
Returns "true" when this graph contains the given node or edge.boolean
containsSupport(Support supp)
Checks whether this theory contains the given support.DungTheory
getCompleteAssociatedDungTheory()
constructs the complete associated dung theory of this bipolar argumentation framework# i.e.java.util.Set<Attack>
getComplexAttacks()
Calculates the set of complex attacks in this bipolar argumentation framework i.e.java.util.Set<Attack>
getDeductiveComplexAttacks()
Calculates the set of deductive complex attacks (d-attacks) in this bipolar argumentation framework i.e.java.util.Set<Argument>
getDirectSupported(Argument argument)
Computes the set {A | (argument,A) in supports}.java.util.Set<Argument>
getDirectSupporters(Argument argument)
Computes the set {A | (A,argument) in supports}.java.util.Set<Attack>
getMediatedAttacks(Argument arg1)
Calculates the set of mediated attack from "arg1" to other arguments "y", i.e.DungTheory
getMetaFramework()
constructs the meta dung theory of this bipolar argumentation framework by adding meta-arguments for every attack and support relationjava.util.Set<Argument>
getSupported(java.util.Collection<Argument> ext)
Computes the set {A | there is a sequence of direct supports from an element ofext
to Ajava.util.Set<Argument>
getSupported(Argument argument)
Computes the set {A | there is a sequence of direct supports from argument to Aprivate java.util.Set<Argument>
getSupported(Argument argument, java.util.Set<Argument> visited)
Computes the set {A | there is a sequence of direct supports from argument to A}.java.util.Set<Attack>
getSupportedAttacks(Argument arg1)
Calculates the set of supported attack from "arg1" to other arguments "y", i.e.java.util.Set<Argument>
getSupporters(Argument argument)
Computes the set {A | there is a sequence of direct supports from A to argumentprivate java.util.Set<Argument>
getSupporters(Argument argument, java.util.Set<Argument> visited)
Computes the set {A | there is a sequence of direct supports from A to argument}.java.util.Set<Support>
getSupports()
Returns all supports of this framework.boolean
isClosed(Extension ext)
Determines if ext is closed under the support relation of this framework i.e., if all arguments supported by ext are an element of extboolean
isDirectSupportedBy(Argument arg1, Argument arg2)
Checks whether arg1 is directly supported by arg2.boolean
isMediatedAttack(Argument arg1, Argument arg2)
Checks whether there exists a mediated attack from "arg1" to "arg2", i.e.boolean
isSuperMediatedAttack(Argument arg1, Argument arg2)
Checks whether there exists a super-mediated attack from "arg1" to "arg2", i.e.boolean
isSupported(Extension ext1, Extension ext2)
returns true if some argument ofext2
supports some argument inext1
boolean
isSupported(Argument argument, Extension ext)
returns true if some argument ofext
supports argument.boolean
isSupportedAttack(Argument arg1, Argument arg2)
Checks whether there exists a supported attack from "arg1" to "arg2", i.e.boolean
isSupportedBy(Argument argument, java.util.Collection<Argument> ext)
returns true if some argument ofext
is supported by argument.boolean
isSupportedBy(Argument arg1, Argument arg2)
Checks whether there is a sequence of direct supports from arg1 to arg2.java.lang.String
prettyPrint()
Pretty print of the framework.boolean
remove(Support support)
Removes the given support from this bipolar argumentation framework.boolean
remove(Argument a)
Removes the argument and all its attacks and supportsboolean
removeAll(java.util.Collection<?> c)
-
Methods inherited from class net.sf.tweety.arg.dung.syntax.DungTheory
add, add, add, add, addAllAttacks, addAttack, compareTo, containsAll, containsAttack, containsCycle, equals, existsDirectedPath, faf, getAdjacencyMatrix, getAttacked, getAttackers, getAttacks, getChildren, getComplementGraph, getComponents, getEdge, getEdges, getMinimalSignature, getNeighbors, getNodes, getNumberOfNodes, getParents, getRestriction, getStronglyConnectedComponents, getSubgraphs, hasAttackBranch, hasDefenseBranch, hashCode, hasSelfLoops, instantiateSignature, isAttackBranch, isAttacked, isAttacked, isAttackedBy, isAttackedBy, isAttackingAllOtherArguments, isCoherent, isDefenseBranch, isIndirectAttack, isRelativelyCoherent, isStable, isSupport, isWeightedGraph, isWellFounded, remove, toString
-
Methods inherited from class net.sf.tweety.commons.BeliefSet
addAll, clear, getSignature, instantiateSet, isEmpty, iterator, remove, retainAll, setSignature, size, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
archivedSubgraphs
private static java.util.Map<BipolarArgFramework,java.util.Collection<Graph<Argument>>> archivedSubgraphs
For archiving sub graphs
-
supportParents
private java.util.Map<Argument,java.util.Set<Argument>> supportParents
explicit listing of direct supporters and supported (for efficiency reasons)
-
-
Method Detail
-
isClosed
public boolean isClosed(Extension ext)
Determines if ext is closed under the support relation of this framework i.e., if all arguments supported by ext are an element of ext- Parameters:
ext
- an extension- Returns:
- true if ext is closed under R_sup
-
getDeductiveComplexAttacks
public java.util.Set<Attack> getDeductiveComplexAttacks()
Calculates the set of deductive complex attacks (d-attacks) in this bipolar argumentation framework i.e. all direct, supported, mediated and super-mediated attacks- Returns:
- set of d-attacks in this bipolar argumentation framework
-
getComplexAttacks
public java.util.Set<Attack> getComplexAttacks()
Calculates the set of complex attacks in this bipolar argumentation framework i.e. all direct, supported and mediated attacks- Returns:
- set of complex attacks in this bipolar argumentation framework
-
getMediatedAttacks
public java.util.Set<Attack> getMediatedAttacks(Argument arg1)
Calculates the set of mediated attack from "arg1" to other arguments "y", i.e. whether there is a sequence of direct supports from "y" to "x" and a direct attack from "arg1" to "x".- Parameters:
arg1
- an argument.- Returns:
- set of mediated attacks starting from "arg1".
-
isMediatedAttack
public boolean isMediatedAttack(Argument arg1, Argument arg2)
Checks whether there exists a mediated attack from "arg1" to "arg2", i.e. whether there is a sequence of direct supports from "arg2" to "x" and a direct attack from "arg1" to "x".- Parameters:
arg1
- an argument.arg2
- an argument.- Returns:
- "true" iff there is a mediated attack from "arg1" to "arg2".
-
isSuperMediatedAttack
public boolean isSuperMediatedAttack(Argument arg1, Argument arg2)
Checks whether there exists a super-mediated attack from "arg1" to "arg2", i.e. whether there is a sequence of direct supports from "arg2" to "x" and a direct or supported attack from "arg1" to "x".- Parameters:
arg1
- an argument.arg2
- an argument.- Returns:
- "true" iff there is a super-mediated attack from "arg1" to "arg2".
-
getSupportedAttacks
public java.util.Set<Attack> getSupportedAttacks(Argument arg1)
Calculates the set of supported attack from "arg1" to other arguments "y", i.e. whether there is a sequence of direct supports from "arg1" to "x" and a direct attack from "x" to "y".- Parameters:
arg1
- an argument.- Returns:
- set of supported attacks starting from "arg1".
-
isSupportedAttack
public boolean isSupportedAttack(Argument arg1, Argument arg2)
Checks whether there exists a supported attack from "arg1" to "arg2", i.e. whether there is a sequence of direct supports from "arg1" to "x" and a direct attack from "x" to "arg2".- Parameters:
arg1
- an argument.arg2
- an argument.- Returns:
- "true" iff there is a supported attack from "arg1" to "arg2".
-
getSupported
public java.util.Set<Argument> getSupported(java.util.Collection<Argument> ext)
Computes the set {A | there is a sequence of direct supports from an element ofext
to A- Parameters:
ext
- an extension ie. a set of arguments- Returns:
- the set of all arguments that are supported by
ext
.
-
getSupported
public java.util.Set<Argument> getSupported(Argument argument)
Computes the set {A | there is a sequence of direct supports from argument to A- Parameters:
argument
- an argument- Returns:
- the set of all arguments that are supported by
argument
.
-
getSupported
private java.util.Set<Argument> getSupported(Argument argument, java.util.Set<Argument> visited)
Computes the set {A | there is a sequence of direct supports from argument to A}.- Parameters:
argument
- an argumentvisited
- already visited arguments- Returns:
- the set of all arguments that are supported by
argument
.
-
getDirectSupported
public java.util.Set<Argument> getDirectSupported(Argument argument)
Computes the set {A | (argument,A) in supports}.- Parameters:
argument
- an argument- Returns:
- the set of all arguments that are supported by
argument
.
-
getSupporters
public java.util.Set<Argument> getSupporters(Argument argument)
Computes the set {A | there is a sequence of direct supports from A to argument- Parameters:
argument
- an argument- Returns:
- the set of all arguments that support
argument
.
-
getSupporters
private java.util.Set<Argument> getSupporters(Argument argument, java.util.Set<Argument> visited)
Computes the set {A | there is a sequence of direct supports from A to argument}.- Parameters:
argument
- an argumentvisited
- already visited arguments- Returns:
- the set of all arguments that support
argument
.
-
getDirectSupporters
public java.util.Set<Argument> getDirectSupporters(Argument argument)
Computes the set {A | (A,argument) in supports}.- Parameters:
argument
- an argument- Returns:
- the set of all arguments that support
argument
.
-
isSupported
public boolean isSupported(Argument argument, Extension ext)
returns true if some argument ofext
supports argument.- Parameters:
argument
- an argumentext
- an extension, ie. a set of arguments- Returns:
- true if some argument of
ext
supports argument.
-
isSupportedBy
public boolean isSupportedBy(Argument argument, java.util.Collection<Argument> ext)
returns true if some argument ofext
is supported by argument.- Parameters:
argument
- an argumentext
- an extension, ie. a set of arguments- Returns:
- true if some argument of
ext
is supported by argument.
-
isSupported
public boolean isSupported(Extension ext1, Extension ext2)
returns true if some argument ofext2
supports some argument inext1
- Parameters:
ext1
- an extension, ie. a set of argumentsext2
- an extension, ie. a set of arguments- Returns:
- true if some argument of
ext2
supports some argument inext1
-
isSupportedBy
public boolean isSupportedBy(Argument arg1, Argument arg2)
Checks whether there is a sequence of direct supports from arg1 to arg2.- Parameters:
arg1
- an argument.arg2
- an argument.- Returns:
- "true" if arg1 is supported by arg2
-
isDirectSupportedBy
public boolean isDirectSupportedBy(Argument arg1, Argument arg2)
Checks whether arg1 is directly supported by arg2.- Parameters:
arg1
- an argument.arg2
- an argument.- Returns:
- "true" if arg1 is directly supported by arg2
-
prettyPrint
public java.lang.String prettyPrint()
Pretty print of the framework.- Overrides:
prettyPrint
in classDungTheory
- Returns:
- the pretty print of the framework.
-
add
public boolean add(Support support)
Adds the given support to this bipolar argumentation framework.- Parameters:
support
- a support- Returns:
- "true" if the set of supports has been modified.
-
addSupport
public boolean addSupport(Argument supporter, Argument supported)
Adds a support from the first argument to the second to this bipolar argumentation framework.- Parameters:
supporter
- some argumentsupported
- some argument- Returns:
- "true" if the set of supports has been modified.
-
remove
public boolean remove(Support support)
Removes the given support from this bipolar argumentation framework.- Parameters:
support
- a support- Returns:
- "true" if the set of supports has been modified.
-
remove
public boolean remove(Argument a)
Removes the argument and all its attacks and supports- Overrides:
remove
in classDungTheory
- Parameters:
a
- some argument- Returns:
- true if this structure has been changed
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<Argument>
- Overrides:
removeAll
in classDungTheory
-
contains
public boolean contains(java.lang.Object o)
Description copied from interface:Graph
Returns "true" when this graph contains the given node or edge.
-
containsSupport
public boolean containsSupport(Support supp)
Checks whether this theory contains the given support.- Parameters:
supp
- some support- Returns:
- "true" iff this theory contains the given support.
-
addAllSupports
public boolean addAllSupports(java.util.Collection<? extends Support> c)
Adds the set of supports to this bipolar argumentation framework.- Parameters:
c
- a collection of supports- Returns:
- "true" if this bipolar argumentation framework has been modified.
-
add
public boolean add(BipolarArgFramework baf)
Adds all arguments, attacks and supports of the given framework to this framework- Parameters:
baf
- some bipolar argumentation framework- Returns:
- "true" if this bipolar argumentation framework has been modified
-
getSupports
public java.util.Set<Support> getSupports()
Returns all supports of this framework.- Returns:
- all supports of this framework.
-
getCompleteAssociatedDungTheory
public DungTheory getCompleteAssociatedDungTheory()
constructs the complete associated dung theory of this bipolar argumentation framework# i.e. constructs all deductive complex attacks of BAF and returns dung theory without supports- Returns:
- the complete associated Dung Theory of this bipolar argumentation framework
-
getMetaFramework
public DungTheory getMetaFramework()
constructs the meta dung theory of this bipolar argumentation framework by adding meta-arguments for every attack and support relation- Returns:
- the meta dung theory of this bipolar argumentation framework
-
areAdjacent
public boolean areAdjacent(Argument a, Argument b)
Description copied from interface:Graph
Returns "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.- Specified by:
areAdjacent
in interfaceGraph<Argument>
- Overrides:
areAdjacent
in classDungTheory
- Parameters:
a
- some nodeb
- some node- Returns:
- "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.
-
-