Class SetAf
java.lang.Object
org.tweetyproject.commons.BeliefSet<Argument,SetAfSignature>
org.tweetyproject.arg.setaf.syntax.SetAf
- All Implemented Interfaces:
Comparable<SetAf>,Iterable<Argument>,Collection<Argument>,ArgumentationFramework<Argument>,BeliefBase,DirHyperGraph<Argument>,GeneralGraph<Argument>
public class SetAf
extends BeliefSet<Argument,SetAfSignature>
implements DirHyperGraph<Argument>, Comparable<SetAf>, ArgumentationFramework<Argument>
This class implements a SetAF in the sense of Nielson/Parson:
See
Nielsen, Soren Holbech and Parsons, Simon. A Generalization of Dung's Abstract Framework for Argumentation: Arguing with Sets of Attacking Arguments. Argumentation in Multi-Agent Systems: Third International Workshop, ArgMAS 2006.
See
Nielsen, Soren Holbech and Parsons, Simon. A Generalization of Dung's Abstract Framework for Argumentation: Arguing with Sets of Attacking Arguments. Argumentation in Multi-Agent Systems: Third International Workshop, ArgMAS 2006.
- Author:
- Sebastian Franke
-
Field Summary
Fields inherited from class org.tweetyproject.commons.BeliefSet
EQUALS_USES_SIGNATUREFields inherited from interface org.tweetyproject.graphs.DirHyperGraph
IGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the given node to this DirHyperGraph.booleanAdds all arguments and attacks of the given theory to this theorybooleanbooleanadd(GeneralEdge edge) Adds the given edge to this DirHyperGraph.booleanaddAllAttacks(Set<SetAttack> edges2) Adds the set of attacks to this SetAf theory.booleanAdds an attack from the first argument to the second to this SetAf theory.booleanAdds an attack from the first argument to the second to this SetAf theory.booleanareAdjacent(Argument a, Argument b) Returns "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.clone()intbooleanReturns "true" when this DirHyperGraph contains the given node or edge.booleancontainsAll(Collection<?> c) booleancontainsAttack(SetAttack att) Checks whether this theory contains the given attack.booleanbooleanexistsDirectedPath(Argument node1, Argument node2) Checks whether there is a (directed) path from node1 to node2.static <S extends Node>
booleanexistsDirectedPath(SetAf hyperGraph, Argument node1, Argument node2) The characteristic function of an abstract argumentation framework: F_AF(S) = {A|A is acceptable wrt.Returns the adjacency matrix of this DirHyperGraph (the order of the nodes is the same as returned by "iterator()").getAttacked(Argument node) Computes the set {A | (argument,A) in attacks}.getAttackers(Argument node) Computes the set {A | (A,argument) in attacks}.getChildren(Set<Argument> node) 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.getComplementGraph(int selfloops) Returns the complement DirHyperGraph of this DirHyperGraph, i.e.getDirEdge(Set<Argument> node1, Node b) Returns the corresponding edge (a,b) if a and b are adjacent.getEdges()Returns the edges of this DirHyperGraph.Returns the signature of the language of this knowledge base.getNeighbors(Argument node) Returns the set of neighbors of the given node.getNodes()Returns the nodes of this DirHyperGraph.intReturns the number of nodes in this DirHyperGraph.getParents(Argument node) 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.getRestriction(Collection<Argument> nodes) Returns copy of this DirHyperGraph consisting only of the given nodes and all corresponding edges.Returns the strongly connected components of this DirHyperGraph.Returns the set of sub graphs of the given graph.Returns the set of sub DirHyperGraphs of this DirHyperGraph.static Collection<DirHyperGraph<Argument>>inthashCode()booleanReturns "true" iff the DirHyperGraph has a self loop (an edge from a node to itself).booleanisAcceptable(Argument argument, Extension<SetAf> ext) returns true if every attacker onargumentis attacked by some accepted argument wrt.booleanisAdmissable(Extension<SetAf> ext) returns true if every accepted argument of this is defended by some accepted argument wrt.booleanisAttacked(Extension<SetAf> ext1, Extension<SetAf> ext2) returns true if some argument ofext2attacks some argument inext1booleanisAttacked(Argument a, Extension<? extends ArgumentationFramework> setAfExtension) returns true if some argument ofextattacks argument.booleanisAttackedBy(Argument arg2, Collection<Argument> ext) returns true if some argument ofextis attacked by argument.booleanisAttackedBy(Argument arg1, Argument arg2) Checks whether arg1 is attacked by arg2.booleanreturns true ifargumentsattack all other arguments in the theorybooleanisConflictFree(Collection<? extends Argument> arguments) returns true if one arguments inargumentsattacks another within this attack relation.booleanisConflictFree(Extension<SetAf> ext) returns true if no accepted argument attacks another accepted one in this interpretation wrt.booleanChecks whether the given extension is stable wrt.booleanChecks whether this DirHyperGraph only contains weighted edges.booleanreturns true iff the theory is well-founded, i.e., there is no infinite sequence A1,A2,...iterator()booleanRemoves the argument and all its attacksbooleanRemoves the given attack from this SetAf theory.booleanremoveAll(Collection<?> c) intsize()toString()Methods inherited from class org.tweetyproject.commons.BeliefSet
add, addAll, clear, getSignature, isEmpty, remove, retainAll, setSignature, toArray, toArray, toStringMethods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
SetAf
Creates a new theory from the given DirHyperGraph.- Parameters:
DirHyperGraph- some DirHyperGraph
-
SetAf
public SetAf()constructor
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<Argument>- Overrides:
sizein classBeliefSet<Argument,SetAfSignature>
-
iterator
- Specified by:
iteratorin interfaceCollection<Argument>- Specified by:
iteratorin interfaceDirHyperGraph<Argument>- Specified by:
iteratorin interfaceIterable<Argument>- Overrides:
iteratorin classBeliefSet<Argument,SetAfSignature>
-
clone
-
getMinimalSignature
Description copied from interface:BeliefBaseReturns the signature of the language of this knowledge base.- Specified by:
getMinimalSignaturein interfaceBeliefBase- Returns:
- the signature of the language of this knowledge base.
-
isAttackingAllOtherArguments
returns true ifargumentsattack all other arguments in the theory- Parameters:
ext- An extension contains a set of arguments.- Returns:
- true if
argumentsattack all other arguments in the theory
-
isWellFounded
public boolean isWellFounded()returns true iff the theory is well-founded, i.e., there is no infinite sequence A1,A2,... of arguments with Ai attacking Ai+1- Returns:
- true iff the theory is well-founded
-
isConflictFree
returns true if one arguments inargumentsattacks another within this attack relation.- Parameters:
arguments- a list of arguments- Returns:
- returns true if one arguments in
argumentsattacks another.
-
isAcceptable
returns true if every attacker onargumentis attacked by some accepted argument wrt. the given theory.- Parameters:
argument- an argumentext- an extension (the knowledge base)- Returns:
- true if every attacker on
argumentis attacked by some accepted argument wrt. the given theory.
-
isConflictFree
returns true if no accepted argument attacks another accepted one in this interpretation wrt. the given theory.- Parameters:
ext- an extension.- Returns:
- true if no accepted argument attacks another accepted one in this interpretation wrt. the given theory.
-
isAdmissable
returns true if every accepted argument of this is defended by some accepted argument wrt. the given setaf theory.- Parameters:
ext- an extension.- Returns:
- true if every accepted argument of this is defended by some accepted argument wrt. the given setaf theory.
-
getAttackers
Computes the set {A | (A,argument) in attacks}.- Parameters:
node- an argument- Returns:
- the set of all arguments that attack
argument.
-
getAttacked
Computes the set {A | (argument,A) in attacks}.- Parameters:
node- an argument- Returns:
- the set of all arguments that are attacked by
argument.
-
isAttacked
returns true if some argument ofextattacks argument.- Specified by:
isAttackedin interfaceArgumentationFramework<Argument>- Parameters:
a- an argumentsetAfExtension- an extension, ie. a set of arguments- Returns:
- true if some argument of
extattacks argument.
-
isAttackedBy
returns true if some argument ofextis attacked by argument.- Parameters:
arg2- an argumentext- an extension, ie. a set of arguments- Returns:
- true if some argument of
extis attacked by argument.
-
isAttacked
returns true if some argument ofext2attacks 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
ext2attacks some argument inext1
-
isStable
Checks whether the given extension is stable wrt. this theory.- Parameters:
e- some extension- Returns:
- "true" iff the extension is stable.
-
faf
The characteristic function of an abstract argumentation framework: F_AF(S) = {A|A is acceptable wrt. S}.- Parameters:
extension- an extension (a set of arguments).- Returns:
- an extension (a set of arguments).
-
isAttackedBy
Checks whether arg1 is attacked by arg2.- Parameters:
arg1- an argument.arg2- an argument.- Returns:
- "true" if arg1 is attacked by arg2
-
add
Description copied from interface:DirHyperGraphAdds the given node to this DirHyperGraph.- Specified by:
addin interfaceCollection<Argument>- Specified by:
addin interfaceDirHyperGraph<Argument>- Overrides:
addin classBeliefSet<Argument,SetAfSignature> - Parameters:
arg- some node.- Returns:
- "true" iff the edge has been added successfully.
-
addAttack
Adds an attack from the first argument to the second to this SetAf theory.- Parameters:
hashSet- some argumentsattacked- some argument- Returns:
- "true" if the set of attacks has been modified.
-
addAttack
Adds an attack from the first argument to the second to this SetAf theory.- Parameters:
attacker- some argumentattacked- some argument- Returns:
- "true" if the set of attacks has been modified.
-
remove
Removes the given attack from this SetAf theory.- Parameters:
attack- an attack- Returns:
- "true" if the set of attacks has been modified.
-
remove
Removes the argument and all its attacks- Parameters:
a- some argument- Returns:
- true if this structure has been changed
-
removeAll
- Specified by:
removeAllin interfaceCollection<Argument>- Overrides:
removeAllin classBeliefSet<Argument,SetAfSignature>
-
containsAll
- Specified by:
containsAllin interfaceArgumentationFramework<Argument>- Specified by:
containsAllin interfaceCollection<Argument>- Overrides:
containsAllin classBeliefSet<Argument,SetAfSignature> - Parameters:
c- parameter- Returns:
- containsAll
-
containsAttack
Checks whether this theory contains the given attack.- Parameters:
att- some attack- Returns:
- "true" iff this theory contains the given attack.
-
addAllAttacks
Adds the set of attacks to this SetAf theory.- Parameters:
edges2- a collection of attacks- Returns:
- "true" if this SetAf theory has been modified.
-
add
Adds all arguments and attacks of the given theory to this theory- Parameters:
theory- some SetAf theory- Returns:
- "true" if this SetAf Theory has been modified
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Argument>- Overrides:
hashCodein classBeliefSet<Argument,SetAfSignature>
-
equals
- Specified by:
equalsin interfaceCollection<Argument>- Overrides:
equalsin classBeliefSet<Argument,SetAfSignature>
-
compareTo
- Specified by:
compareToin interfaceComparable<SetAf>
-
add
- Parameters:
edge- attack- Returns:
- whether the atttack was added or not
-
getNodes
Description copied from interface:DirHyperGraphReturns the nodes of this DirHyperGraph.- Specified by:
getNodesin interfaceArgumentationFramework<Argument>- Specified by:
getNodesin interfaceDirHyperGraph<Argument>- Specified by:
getNodesin interfaceGeneralGraph<Argument>- Returns:
- the nodes of this DirHyperGraph.
-
getNumberOfNodes
public int getNumberOfNodes()Description copied from interface:DirHyperGraphReturns the number of nodes in this DirHyperGraph.- Specified by:
getNumberOfNodesin interfaceDirHyperGraph<Argument>- Returns:
- the number of nodes in this DirHyperGraph.
-
areAdjacent
Description copied from interface:DirHyperGraphReturns "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.- Specified by:
areAdjacentin interfaceDirHyperGraph<Argument>- 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.
-
getEdge
Description copied from interface:DirHyperGraphReturns the corresponding edge (a,b) if a and b are adjacent. Otherwise it returns null.- Specified by:
getEdgein interfaceDirHyperGraph<Argument>- Parameters:
a- some nodeb- some node- Returns:
- the edge (a,b) or null.
-
getAttacks
- Returns:
- all attacks
-
getDirEdge
- Parameters:
node1- an attacking setb- an argument- Returns:
- the edge between the two
-
getEdges
Description copied from interface:DirHyperGraphReturns the edges of this DirHyperGraph.- Specified by:
getEdgesin interfaceDirHyperGraph<Argument>- Specified by:
getEdgesin interfaceGeneralGraph<Argument>- Returns:
- the edges of this DirHyperGraph.
-
contains
Description copied from interface:DirHyperGraphReturns "true" when this DirHyperGraph contains the given node or edge.- Specified by:
containsin interfaceCollection<Argument>- Specified by:
containsin interfaceDirHyperGraph<Argument>- Overrides:
containsin classBeliefSet<Argument,SetAfSignature> - Parameters:
obj- an object- Returns:
- "true" if this DirHyperGraph contains the given node or edge.
-
getChildren
- Parameters:
node- the node- Returns:
- the children of the node
-
getParents
Description copied from interface:DirHyperGraphReturns 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.- Specified by:
getParentsin interfaceDirHyperGraph<Argument>- Parameters:
node- some node (must be in the DirHyperGraph).- Returns:
- the set of parents of the given node.
-
getParents
- Parameters:
node- an argument- Returns:
- the arguments' parents
-
existsDirectedPath
public static <S extends Node> boolean existsDirectedPath(SetAf hyperGraph, Argument node1, Argument node2) - Type Parameters:
S- a node- Parameters:
hyperGraph- a setAfnode1- an argumentnode2- an argument- Returns:
- whether the path exists
-
existsDirectedPath
Description copied from interface:DirHyperGraphChecks whether there is a (directed) path from node1 to node2.- Specified by:
existsDirectedPathin interfaceDirHyperGraph<Argument>- Parameters:
node1- some node.node2- some node.- Returns:
- "true" if there is a directed path from node1 to node2.
-
getNeighbors
Description copied from interface:DirHyperGraphReturns the set of neighbors of the given node.- Specified by:
getNeighborsin interfaceDirHyperGraph<Argument>- Parameters:
node- some node (must be in the DirHyperGraph).- Returns:
- the set of neighbors of the given node.
-
getAdjacencyMatrix
Description copied from interface:DirHyperGraphReturns the adjacency matrix of this DirHyperGraph (the order of the nodes is the same as returned by "iterator()").- Specified by:
getAdjacencyMatrixin interfaceDirHyperGraph<Argument>- Returns:
- the adjacency matrix of this DirHyperGraph
-
powerSet
- Parameters:
originalSet- original set- Returns:
- the powerset of
-
getComplementGraph
Description copied from interface:DirHyperGraphReturns the complement DirHyperGraph of this DirHyperGraph, i.e. the DirHyperGraph on the same set of vertices as this DirHyperGraph that connects two vertices v and w with an edge if and only if v and w are not connected in this DirHyperGraph.- Specified by:
getComplementGraphin interfaceDirHyperGraph<Argument>- Parameters:
selfloops- Indicates how to deal with selfloops:
IGNORE_SELFLOOPS - ignore self loops (don't add and don't remove)
INVERT_SELFLOOPS - deal with self loops like ordinary edges (add if not present and remove if present)
REMOVE_SELFLOOPS - simple remove self loops, but don't add new ones.- Returns:
- the complement DirHyperGraph of this DirHyperGraph.
-
getStronglyConnectedComponents
Description copied from interface:DirHyperGraphReturns the strongly connected components of this DirHyperGraph. A set of nodes is strongly connected, if there is a path from each node to each other. A set of nodes is called strongly connected component if it is strongly connected and maximal with respect to set inclusion.- Specified by:
getStronglyConnectedComponentsin interfaceDirHyperGraph<Argument>- Returns:
- the strongly connected components of this DirHyperGraph.
-
getSubgraphs
Returns the set of sub graphs of the given graph.- Parameters:
g- a graph- Returns:
- the set of sub graphs of the given graph.
-
getRestriction
Description copied from interface:DirHyperGraphReturns copy of this DirHyperGraph consisting only of the given nodes and all corresponding edges.- Specified by:
getRestrictionin interfaceDirHyperGraph<Argument>- Specified by:
getRestrictionin interfaceGeneralGraph<Argument>- Parameters:
nodes- a set of nodes- Returns:
- a DirHyperGraph.
-
hasSelfLoops
public boolean hasSelfLoops()Description copied from interface:DirHyperGraphReturns "true" iff the DirHyperGraph has a self loop (an edge from a node to itself).- Specified by:
hasSelfLoopsin interfaceDirHyperGraph<Argument>- Returns:
- "true" iff the DirHyperGraph has a self loop (an edge from a node to itself).
-
isWeightedGraph
public boolean isWeightedGraph()Description copied from interface:DirHyperGraphChecks whether this DirHyperGraph only contains weighted edges.- Specified by:
isWeightedGraphin interfaceDirHyperGraph<Argument>- Returns:
- "true" if all edges are weighted in this DirHyperGraph.
-
add
Description copied from interface:DirHyperGraphAdds the given edge to this DirHyperGraph. If at least one of the nodes the given edge connects is not in the DirHyperGraph, an illegal argument exception is thrown.- Specified by:
addin interfaceDirHyperGraph<Argument>- Parameters:
edge- some edge.- Returns:
- "true" iff the edge has been added successfully.
-
toString
- Specified by:
toStringin interfaceBeliefBase- Specified by:
toStringin interfaceDirHyperGraph<Argument>- Overrides:
toStringin classBeliefSet<Argument,SetAfSignature>
-
getChildren
Description copied from interface:DirHyperGraphReturns 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.- Specified by:
getChildrenin interfaceDirHyperGraph<Argument>- Parameters:
node- some node (must be in the DirHyperGraph).- Returns:
- the set of children of the given node.
-
getSubGraphs
Description copied from interface:DirHyperGraphReturns the set of sub DirHyperGraphs of this DirHyperGraph.- Specified by:
getSubGraphsin interfaceDirHyperGraph<Argument>- Returns:
- the set of sub DirHyperGraphs of this DirHyperGraph.
-
getSubgraphsHelper
- Parameters:
g- the SetAf- Returns:
- the subgraphs of the SetAf
-