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 SummaryFields inherited from class org.tweetyproject.commons.BeliefSetEQUALS_USES_SIGNATUREFields inherited from interface org.tweetyproject.graphs.DirHyperGraphIGNORE_SELFLOOPS, INVERT_SELFLOOPS, REMOVE_SELFLOOPS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.BeliefSetadd, addAll, clear, getSignature, isEmpty, remove, retainAll, setSignature, toArray, toArray, toStringMethods inherited from interface java.util.CollectionparallelStream, removeIf, spliterator, stream, toArray
- 
Constructor Details- 
SetAfpublic SetAf()Initializes a new enpty SetAf
- 
SetAfCreates a new theory from the given DirHyperGraph.- Parameters:
- graph- some DirHyperGraph
 
 
- 
- 
Method Details- 
sizepublic int size()- Specified by:
- sizein interface- Collection<Argument>
- Overrides:
- sizein class- BeliefSet<Argument,- SetAfSignature> 
 
- 
iterator- Specified by:
- iteratorin interface- Collection<Argument>
- Specified by:
- iteratorin interface- DirHyperGraph<Argument>
- Specified by:
- iteratorin interface- Iterable<Argument>
- Overrides:
- iteratorin class- BeliefSet<Argument,- SetAfSignature> 
 
- 
clone
- 
getMinimalSignatureDescription copied from interface:BeliefBaseReturns the signature of the language of this knowledge base.- Specified by:
- getMinimalSignaturein interface- BeliefBase
- Returns:
- the signature of the language of this knowledge base.
 
- 
isAttackingAllOtherArguments
- 
isConflictFree
- 
isAcceptablereturns true if every attacker onargumentis attacked by some accepted argument wrt. the given theory.- Parameters:
- argument- an argument
- ext- an extension (the knowledge base)
- Returns:
- true if every attacker on argumentis attacked by some accepted argument wrt. the given theory.
 
- 
isAdmissiblereturns 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.
 
- 
getAttackersComputes the set {A | (A,argument) in attacks}.- Parameters:
- node- an argument
- Returns:
- the set of all sets of arguments that attack argument.
 
- 
getAttackedComputes the set of arguments collectively attacked byarguments.- Parameters:
- arguments- a set of arguments
- Returns:
- set of arguments collectively attacked by arguments
 
- 
isAttackedreturns true if some argument ofextattacks argument.- Specified by:
- isAttackedin interface- ArgumentationFramework<Argument>
- Parameters:
- argument- an argument
- ext- an extension, i.e. a set of arguments
- Returns:
- true if some argument of extattacks argument.
 
- 
isAttackedByreturns true if some argument ofextis attacked by argument.- Parameters:
- arg2- an argument
- ext- an extension, i.e. a set of arguments
- Returns:
- true if some argument of extis attacked by argument.
 
- 
isAttackedBy
- 
isStable
- 
faf
- 
addAdd argument to SetAf- Specified by:
- addin interface- Collection<Argument>
- Specified by:
- addin interface- DirHyperGraph<Argument>
- Overrides:
- addin class- BeliefSet<Argument,- SetAfSignature> 
- Parameters:
- arg- some argument
- Returns:
- true if argument has been added
 
- 
addAttack
- 
addAttack
- 
removeRemoves the given attack from this SetAf theory.- Parameters:
- attack- an attack
- Returns:
- "true" if the set of attacks has been modified.
 
- 
removeRemoves the argument and all its attacks- Parameters:
- a- some argument
- Returns:
- true if this structure has been changed
 
- 
removeAll- Specified by:
- removeAllin interface- Collection<Argument>
- Overrides:
- removeAllin class- BeliefSet<Argument,- SetAfSignature> 
 
- 
containsAllDescription copied from interface:ArgumentationFrameworkChecks if the argumentation framework contains all the elements in the given collection.- Specified by:
- containsAllin interface- ArgumentationFramework<Argument>
- Specified by:
- containsAllin interface- Collection<Argument>
- Overrides:
- containsAllin class- BeliefSet<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.
 
- 
containsAttackChecks whether this theory contains the given attack.- Parameters:
- att- some attack
- Returns:
- "true" iff this theory contains the given attack.
 
- 
addAllAttacks
- 
addAdds 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
 
- 
hashCodepublic int hashCode()- Specified by:
- hashCodein interface- Collection<Argument>
- Overrides:
- hashCodein class- BeliefSet<Argument,- SetAfSignature> 
 
- 
equals- Specified by:
- equalsin interface- Collection<Argument>
- Overrides:
- equalsin class- BeliefSet<Argument,- SetAfSignature> 
 
- 
compareTo- Specified by:
- compareToin interface- Comparable<SetAf>
 
- 
addReturn whether the attack was added or not- Parameters:
- edge- attack
- Returns:
- whether the attack was added or not
 
- 
getNodesDescription copied from interface:DirHyperGraphReturns the nodes of this DirHyperGraph.- Specified by:
- getNodesin interface- ArgumentationFramework<Argument>
- Specified by:
- getNodesin interface- DirHyperGraph<Argument>
- Specified by:
- getNodesin interface- GeneralGraph<Argument>
- Returns:
- the nodes of this DirHyperGraph.
 
- 
getNumberOfNodespublic int getNumberOfNodes()Description copied from interface:DirHyperGraphReturns the number of nodes in this DirHyperGraph.- Specified by:
- getNumberOfNodesin interface- DirHyperGraph<Argument>
- Returns:
- the number of nodes in this DirHyperGraph.
 
- 
areAdjacentDescription 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 interface- DirHyperGraph<Argument>
- Parameters:
- a- some node
- b- some node
- Returns:
- "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.
 
- 
getEdgeDescription copied from interface:DirHyperGraphReturns the corresponding edge (a,b) if a and b are adjacent. Otherwise it returns null.- Specified by:
- getEdgein interface- DirHyperGraph<Argument>
- Parameters:
- a- some node
- b- some node
- Returns:
- the edge (a,b) or null.
 
- 
getAttacks
- 
getDirEdge
- 
getEdgesDescription copied from interface:DirHyperGraphReturns the edges of this DirHyperGraph.- Specified by:
- getEdgesin interface- DirHyperGraph<Argument>
- Specified by:
- getEdgesin interface- GeneralGraph<Argument>
- Returns:
- the edges of this DirHyperGraph.
 
- 
containsDescription copied from interface:DirHyperGraphReturns "true" when this DirHyperGraph contains the given node or edge.- Specified by:
- containsin interface- Collection<Argument>
- Specified by:
- containsin interface- DirHyperGraph<Argument>
- Overrides:
- containsin class- BeliefSet<Argument,- SetAfSignature> 
- Parameters:
- obj- an object
- Returns:
- "true" if this DirHyperGraph contains the given node or edge.
 
- 
getChildrenReturn the children of the node- Parameters:
- node- the node
- Returns:
- the children of the node
 
- 
getParentsDescription 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 interface- DirHyperGraph<Argument>
- Parameters:
- node- some node (must be in the DirHyperGraph).
- Returns:
- the set of parents of the given node.
 
- 
getParentsReturn the arguments' parents- Parameters:
- node- an argument
- Returns:
- the arguments' parents
 
- 
existsDirectedPath
- 
existsDirectedPathDescription copied from interface:DirHyperGraphChecks whether there is a (directed) path from node1 to node2.- Specified by:
- existsDirectedPathin interface- DirHyperGraph<Argument>
- Parameters:
- node1- some node.
- node2- some node.
- Returns:
- "true" if there is a directed path from node1 to node2.
 
- 
getNeighborsDescription copied from interface:DirHyperGraphReturns the set of neighbors of the given node.- Specified by:
- getNeighborsin interface- DirHyperGraph<Argument>
- Parameters:
- node- some node (must be in the DirHyperGraph).
- Returns:
- the set of neighbors of the given node.
 
- 
getAdjacencyMatrixDescription 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 interface- DirHyperGraph<Argument>
- Returns:
- the adjacency matrix of this DirHyperGraph
 
- 
powerSet
- 
getComplementGraphDescription 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 interface- DirHyperGraph<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.
 
- 
getStronglyConnectedComponentsDescription 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 interface- DirHyperGraph<Argument>
- Returns:
- the strongly connected components of this DirHyperGraph.
 
- 
getSubgraphsReturns the set of sub graphs of the given graph.- Parameters:
- g- a graph
- Returns:
- the set of sub graphs of the given graph.
 
- 
getRestrictionDescription copied from interface:DirHyperGraphReturns copy of this DirHyperGraph consisting only of the given nodes and all corresponding edges.- Specified by:
- getRestrictionin interface- DirHyperGraph<Argument>
- Specified by:
- getRestrictionin interface- GeneralGraph<Argument>
- Parameters:
- nodes- a set of nodes
- Returns:
- a DirHyperGraph.
 
- 
hasSelfLoopspublic 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 interface- DirHyperGraph<Argument>
- Returns:
- "true" iff the DirHyperGraph has a self loop (an edge from a node to itself).
 
- 
isWeightedGraphpublic boolean isWeightedGraph()Description copied from interface:DirHyperGraphChecks whether this DirHyperGraph only contains weighted edges.- Specified by:
- isWeightedGraphin interface- DirHyperGraph<Argument>
- Returns:
- "true" if all edges are weighted in this DirHyperGraph.
 
- 
addDescription 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 interface- DirHyperGraph<Argument>
- Parameters:
- edge- some edge.
- Returns:
- "true" iff the edge has been added successfully.
 
- 
toString- Specified by:
- toStringin interface- BeliefBase
- Specified by:
- toStringin interface- DirHyperGraph<Argument>
- Overrides:
- toStringin class- BeliefSet<Argument,- SetAfSignature> 
 
- 
getChildrenDescription 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 interface- DirHyperGraph<Argument>
- Parameters:
- node- some node (must be in the DirHyperGraph).
- Returns:
- the set of children of the given node.
 
- 
getSubGraphsDescription copied from interface:DirHyperGraphReturns the set of sub DirHyperGraphs of this DirHyperGraph.- Specified by:
- getSubGraphsin interface- DirHyperGraph<Argument>
- Returns:
- the set of sub DirHyperGraphs of this DirHyperGraph.
 
- 
getSubgraphsHelperReturn the subgraphs of the SetAf- Parameters:
- g- the SetAf
- Returns:
- the subgraphs of the SetAf
 
- 
prettyPrint
 
-