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:
 
- Author:
 - Sebastian Franke, Lars Bengel
 - See Also:
 
- 
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 TypeMethodDescriptionbooleanAdd argument to SetAfbooleanAdds all arguments and attacks of the given theory to this theorybooleanReturn whether the attack was added or notbooleanadd(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()clones the SetAfintbooleanReturns "true" when this DirHyperGraph contains the given node or edge.booleancontainsAll(Collection<?> c) Checks if the argumentation framework contains all the elements in the given collection.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) Return whether the path existsThe 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(Collection<Argument> arguments) Computes the set of arguments collectively attacked byarguments.getAttackers(Argument node) Computes the set {A | (A,argument) in attacks}.Return all attacksgetChildren(Set<Argument> node) Return the children of the nodegetChildren(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) Return the edge between the twoReturns 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) Return the arguments' parentsgetParents(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>> Return the subgraphs of the SetAfinthashCode()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.booleanisAdmissible(Extension<SetAf> ext) returns true if every accepted argument of this is defended by some accepted argument wrt.booleanisAttacked(Argument argument, Extension<? extends ArgumentationFramework<?>> ext) 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(Extension<SetAf> arguments) returns true if one arguments inargumentsattacks another within this attack relation.booleanChecks whether the given extension is stable wrt.booleanChecks whether this DirHyperGraph only contains weighted edges.iterator()Return the powerset ofPretty prints the SetAfbooleanRemoves 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
public SetAf()Initializes a new enpty SetAf - 
SetAf
Creates a new theory from the given DirHyperGraph.- Parameters:
 graph- some DirHyperGraph
 
 - 
 - 
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
 - 
isConflictFree
 - 
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. 
 - 
isAdmissible
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 sets of arguments that attack 
argument. 
 - 
getAttacked
Computes the set of arguments collectively attacked byarguments.- Parameters:
 arguments- a set of arguments- Returns:
 - set of arguments collectively attacked by 
arguments 
 - 
isAttacked
returns true if some argument ofextattacks argument.- Specified by:
 isAttackedin interfaceArgumentationFramework<Argument>- Parameters:
 argument- an argumentext- an extension, i.e. 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, i.e. a set of arguments- Returns:
 - true if some argument of 
extis attacked by argument. 
 - 
isAttackedBy
 - 
isStable
 - 
faf
 - 
add
Add argument to SetAf- Specified by:
 addin interfaceCollection<Argument>- Specified by:
 addin interfaceDirHyperGraph<Argument>- Overrides:
 addin classBeliefSet<Argument,SetAfSignature> - Parameters:
 arg- some argument- Returns:
 - true if argument has been added
 
 - 
addAttack
 - 
addAttack
 - 
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
Description copied from interface:ArgumentationFrameworkChecks if the argumentation framework contains all the elements in the given collection.- Specified by:
 containsAllin interfaceArgumentationFramework<Argument>- Specified by:
 containsAllin interfaceCollection<Argument>- Overrides:
 containsAllin classBeliefSet<Argument,SetAfSignature> - Parameters:
 c- the collection of elements to be checked for containment.- Returns:
 - true if this framework contains all elements in the specified collection, false otherwise.
 
 - 
containsAttack
Checks whether this theory contains the given attack.- Parameters:
 att- some attack- Returns:
 - "true" iff this theory contains the given attack.
 
 - 
addAllAttacks
 - 
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
Return whether the attack was added or not- Parameters:
 edge- attack- Returns:
 - whether the attack 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
 - 
getDirEdge
 - 
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
Return the children of the node- 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
Return the arguments' parents- Parameters:
 node- an argument- Returns:
 - the arguments' parents
 
 - 
existsDirectedPath
 - 
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
 - 
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
Return the subgraphs of the SetAf- Parameters:
 g- the SetAf- Returns:
 - the subgraphs of the SetAf
 
 - 
prettyPrint
 
 -