public class DungTheory extends BeliefSet<Argument> implements Graph<Argument>, java.lang.Comparable<DungTheory>
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<DungTheory,java.util.Collection<Graph<Argument>>> |
archivedSubgraphs
For archiving sub graphs
|
private java.util.Set<Attack> |
attacks
The set of attacks
|
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS
Constructor and Description |
---|
DungTheory()
Default constructor; initializes empty sets of arguments and attacks
|
DungTheory(Graph<Argument> graph)
Creates a new theory from the given graph.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Attack attack)
Adds the given attack to this dung theory.
|
boolean |
add(DungTheory theory)
Adds all arguments and attacks of the given theory to
this theory
|
boolean |
add(Edge<Argument> edge)
Adds the given edge to this graph.
|
boolean |
addAllAttacks(java.util.Collection<? extends Attack> c)
Adds the set of attacks to this Dung theory.
|
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.
|
int |
compareTo(DungTheory o) |
boolean |
contains(java.lang.Object o)
Returns "true" when this graph contains the given
node or edge.
|
boolean |
containsAll(java.util.Collection<?> c) |
private boolean |
dfs(int i,
java.util.List<Argument> arguments,
boolean[] dfn,
boolean[] inProgress)
Depth-First-Search to find a cycle in the theory.
|
boolean |
equals(java.lang.Object obj) |
boolean |
existsDirectedPath(Argument node1,
Argument node2)
Checks whether there is a (directed) path from node1 to node2.
|
Extension |
faf(Extension extension)
The characteristic function of an abstract argumentation framework: F_AF(S) = {A|A is acceptable wrt.
|
Matrix |
getAdjancyMatrix()
Returns the adjacency matrix of this graph (the order
of the nodes is the same as returned by "iterator()").
|
java.util.Set<Argument> |
getAttacked(Argument argument)
Computes the set {A | (argument,A) in attacks}.
|
java.util.Set<Argument> |
getAttackers(Argument argument)
Computes the set {A | (A,argument) in attacks}.
|
java.util.Set<Attack> |
getAttacks()
Returns all attacks of this theory.
|
java.util.Collection<Argument> |
getChildren(Node node)
Returns the set of children (node connected via an undirected edge or a directed edge
where the given node is the parent) of the given node.
|
DungTheory |
getComplementGraph(int selfloops)
Returns the complement graph of this graph, i.e.
|
Edge<Argument> |
getEdge(Argument a,
Argument b)
Returns the corresponding edge (a,b) if a and b are adjacent.
|
java.util.Collection<? extends Edge<? extends Argument>> |
getEdges()
Returns the edges of this graph.
|
java.util.Collection<Argument> |
getNeighbors(Argument node)
Returns the set of neighbors of the given node.
|
java.util.Collection<Argument> |
getNodes()
Returns the nodes of this graph.
|
int |
getNumberOfNodes()
Returns the number of nodes in this graph.
|
java.util.Collection<Argument> |
getParents(Node node)
Returns the set of parents (node connected via an undirected edge or a directed edge
where the given node is the child) of the given node.
|
Graph<Argument> |
getRestriction(java.util.Collection<Argument> arguments)
Returns copy of this graph consisting only of the given
nodes and all corresponding edges.
|
Signature |
getSignature()
Returns the signature of the language of this knowledge base.
|
java.util.Collection<java.util.Collection<Argument>> |
getStronglyConnectedComponents()
Returns the strongly connected components of this graph.
|
java.util.Collection<Graph<Argument>> |
getSubgraphs()
Returns the set of sub graphs of this graph.
|
int |
hashCode() |
boolean |
hasSelfLoops()
Returns "true" iff the graph has a self loop (an edge from a node to itself).
|
boolean |
isAttacked(Argument argument,
Extension ext)
returns true if some argument of
|
boolean |
isAttacked(Extension ext1,
Extension ext2)
returns true if some argument of
|
boolean |
isAttackedBy(Argument arg1,
Argument arg2)
Checks whether arg1 is attacked by arg2.
|
boolean |
isAttackedBy(Argument argument,
java.util.Collection<Argument> ext)
returns true if some argument of
|
boolean |
isAttackingAllOtherArguments(Extension ext)
returns true if
|
boolean |
isCoherent()
Determines if the theory is coherent, i.e., if each preferred extension is stable
|
boolean |
isIndirectAttack(Argument arg1,
Argument arg2)
Checks whether "arg1" indirectly attacks "arg2", i.e.
|
private boolean |
isIndirectAttack(Argument arg1,
Argument arg2,
java.util.Set<Argument> visited)
Checks whether "arg1" indirectly attacks "arg2", i.e.
|
boolean |
isRelativelyCoherent()
Determines if the theory is relatively coherent, i.e., if the grounded extension coincides with the intersection of all preferred extensions
|
boolean |
isSupport(Argument arg1,
Argument arg2)
Checks whether "arg1" supports "arg2", i.e.
|
private boolean |
isSupport(Argument arg1,
Argument arg2,
java.util.Set<Argument> visited)
Checks whether "arg1" supports "arg2", i.e.
|
boolean |
isWeightedGraph()
Checks whether this graph only contains weighted edges.
|
boolean |
isWellFounded()
returns true iff the theory is well-founded, i.e., there is no infinite sequence A1,A2,...
|
java.lang.String |
prettyPrint()
Pretty print of the theory.
|
boolean |
remove(Argument a)
Removes the argument and all its attacks
|
boolean |
remove(Attack attack)
Removes the given attack from this Dung theory.
|
boolean |
removeAll(java.util.Collection<?> c) |
java.lang.String |
toString() |
add, addAll, clear, instantiateSet, isEmpty, iterator, remove, retainAll, size, toArray, toArray
private static java.util.Map<DungTheory,java.util.Collection<Graph<Argument>>> archivedSubgraphs
private java.util.Set<Attack> attacks
public DungTheory()
public Signature getSignature()
BeliefBase
getSignature
in interface BeliefBase
getSignature
in class BeliefSet<Argument>
public boolean isAttackingAllOtherArguments(Extension ext)
ext
- An extension contains a set of arguments.public boolean isWellFounded()
private boolean dfs(int i, java.util.List<Argument> arguments, boolean[] dfn, boolean[] inProgress)
i
- current nodearguments
- list of all nodes (arguments)dfn
- array which keeps track whether a node has been visitedinProgress
- array which keeps track which nodes are currently being processedpublic boolean isCoherent()
public boolean isRelativelyCoherent()
public java.util.Set<Argument> getAttackers(Argument argument)
argument
- an argumentpublic java.util.Set<Argument> getAttacked(Argument argument)
argument
- an argumentpublic boolean isAttacked(Argument argument, Extension ext)
argument
- an argumentext
- an extension, ie. a set of argumentspublic boolean isAttackedBy(Argument argument, java.util.Collection<Argument> ext)
argument
- an argumentext
- an extension, ie. a set of argumentspublic boolean isAttacked(Extension ext1, Extension ext2)
ext1
- an extension, ie. a set of argumentsext2
- an extension, ie. a set of argumentspublic Extension faf(Extension extension)
extension
- an extension (a set of arguments).public boolean isAttackedBy(Argument arg1, Argument arg2)
arg1
- an argument.arg2
- an argument.public boolean isIndirectAttack(Argument arg1, Argument arg2)
arg1
- an AbstractArgument.arg2
- an AbstractArgument.private boolean isIndirectAttack(Argument arg1, Argument arg2, java.util.Set<Argument> visited)
arg1
- an AbstractArgument.arg2
- an AbstractArgument.visited
- already visited arguments.public boolean isSupport(Argument arg1, Argument arg2)
arg1
- an AbstractArgument.arg2
- an AbstractArgument.private boolean isSupport(Argument arg1, Argument arg2, java.util.Set<Argument> visited)
arg1
- an AbstractArgument.arg2
- an AbstractArgument.visited
- already visited arguments.public java.lang.String prettyPrint()
public java.lang.String toString()
public boolean add(Attack attack)
attack
- an attackpublic boolean remove(Attack attack)
attack
- an attackpublic boolean remove(Argument a)
a
- some argumentpublic boolean removeAll(java.util.Collection<?> c)
public boolean contains(java.lang.Object o)
Graph
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<Argument>
containsAll
in class BeliefSet<Argument>
public boolean addAllAttacks(java.util.Collection<? extends Attack> c)
c
- a collection of attackspublic boolean add(DungTheory theory)
theory
- some Dung theorypublic java.util.Set<Attack> getAttacks()
public Graph<Argument> getRestriction(java.util.Collection<Argument> arguments)
Graph
getRestriction
in interface Graph<Argument>
arguments
- a set of nodespublic int hashCode()
public boolean equals(java.lang.Object obj)
public boolean add(Edge<Argument> edge)
Graph
public java.util.Collection<Argument> getNodes()
Graph
public int getNumberOfNodes()
Graph
getNumberOfNodes
in interface Graph<Argument>
public boolean areAdjacent(Argument a, Argument b)
Graph
areAdjacent
in interface Graph<Argument>
a
- some nodeb
- some nodepublic java.util.Collection<? extends Edge<? extends Argument>> getEdges()
Graph
public java.util.Collection<Argument> getChildren(Node node)
Graph
getChildren
in interface Graph<Argument>
node
- some node (must be in the graph).public java.util.Collection<Argument> getParents(Node node)
Graph
getParents
in interface Graph<Argument>
node
- some node (must be in the graph).public boolean existsDirectedPath(Argument node1, Argument node2)
Graph
existsDirectedPath
in interface Graph<Argument>
node1
- some node.node2
- some node.public java.util.Collection<Argument> getNeighbors(Argument node)
Graph
getNeighbors
in interface Graph<Argument>
node
- some node (must be in the graph).public Matrix getAdjancyMatrix()
Graph
getAdjancyMatrix
in interface Graph<Argument>
public DungTheory getComplementGraph(int selfloops)
Graph
getComplementGraph
in interface Graph<Argument>
selfloops
- Indicates how to deal with selfloops:public boolean hasSelfLoops()
Graph
hasSelfLoops
in interface Graph<Argument>
public Edge<Argument> getEdge(Argument a, Argument b)
Graph
public boolean isWeightedGraph()
Graph
isWeightedGraph
in interface Graph<Argument>
public java.util.Collection<java.util.Collection<Argument>> getStronglyConnectedComponents()
Graph
getStronglyConnectedComponents
in interface Graph<Argument>
public java.util.Collection<Graph<Argument>> getSubgraphs()
Graph
getSubgraphs
in interface Graph<Argument>
public int compareTo(DungTheory o)
compareTo
in interface java.lang.Comparable<DungTheory>