Class SetAf

All Implemented Interfaces:
Comparable<SetAf>, Iterable<Argument>, Collection<Argument>, ArgumentationFramework<Argument>, BeliefBase, DirHyperGraph<Argument>, GeneralGraph<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.
Author:
Sebastian Franke
  • Constructor Details

    • SetAf

      public SetAf(SetAf DirHyperGraph)
      Creates a new theory from the given DirHyperGraph.
      Parameters:
      DirHyperGraph - some DirHyperGraph
    • SetAf

      public SetAf()
      constructor
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface Collection<Argument>
      Overrides:
      size in class BeliefSet<Argument,SetAfSignature>
    • iterator

      public Iterator<Argument> iterator()
      Specified by:
      iterator in interface Collection<Argument>
      Specified by:
      iterator in interface DirHyperGraph<Argument>
      Specified by:
      iterator in interface Iterable<Argument>
      Overrides:
      iterator in class BeliefSet<Argument,SetAfSignature>
    • clone

      public SetAf clone()
    • getMinimalSignature

      public Signature getMinimalSignature()
      Description copied from interface: BeliefBase
      Returns the signature of the language of this knowledge base.
      Specified by:
      getMinimalSignature in interface BeliefBase
      Returns:
      the signature of the language of this knowledge base.
    • isAttackingAllOtherArguments

      public boolean isAttackingAllOtherArguments(Extension<SetAf> ext)
      returns true if arguments attack all other arguments in the theory
      Parameters:
      ext - An extension contains a set of arguments.
      Returns:
      true if arguments attack 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

      public boolean isConflictFree(Collection<? extends Argument> arguments)
      returns true if one arguments in arguments attacks another within this attack relation.
      Parameters:
      arguments - a list of arguments
      Returns:
      returns true if one arguments in arguments attacks another.
    • isAcceptable

      public boolean isAcceptable(Argument argument, Extension<SetAf> ext)
      returns true if every attacker on argument is 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 argument is attacked by some accepted argument wrt. the given theory.
    • isConflictFree

      public boolean isConflictFree(Extension<SetAf> ext)
      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

      public boolean isAdmissable(Extension<SetAf> ext)
      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

      public Set<Set<Argument>> getAttackers(Argument node)
      Computes the set {A | (A,argument) in attacks}.
      Parameters:
      node - an argument
      Returns:
      the set of all arguments that attack argument.
    • getAttacked

      public Set<Argument> getAttacked(Argument node)
      Computes the set {A | (argument,A) in attacks}.
      Parameters:
      node - an argument
      Returns:
      the set of all arguments that are attacked by argument.
    • isAttacked

      public boolean isAttacked(Argument a, Extension<? extends ArgumentationFramework> setAfExtension)
      returns true if some argument of ext attacks argument.
      Specified by:
      isAttacked in interface ArgumentationFramework<Argument>
      Parameters:
      a - an argument
      setAfExtension - an extension, ie. a set of arguments
      Returns:
      true if some argument of ext attacks argument.
    • isAttackedBy

      public boolean isAttackedBy(Argument arg2, Collection<Argument> ext)
      returns true if some argument of ext is attacked by argument.
      Parameters:
      arg2 - an argument
      ext - an extension, ie. a set of arguments
      Returns:
      true if some argument of ext is attacked by argument.
    • isAttacked

      public boolean isAttacked(Extension<SetAf> ext1, Extension<SetAf> ext2)
      returns true if some argument of ext2 attacks some argument in ext1
      Parameters:
      ext1 - an extension, ie. a set of arguments
      ext2 - an extension, ie. a set of arguments
      Returns:
      true if some argument of ext2 attacks some argument in ext1
    • isStable

      public boolean isStable(Extension<SetAf> e)
      Checks whether the given extension is stable wrt. this theory.
      Parameters:
      e - some extension
      Returns:
      "true" iff the extension is stable.
    • faf

      public Extension<SetAf> faf(Extension<SetAf> extension)
      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

      public boolean isAttackedBy(Argument arg1, Argument arg2)
      Checks whether arg1 is attacked by arg2.
      Parameters:
      arg1 - an argument.
      arg2 - an argument.
      Returns:
      "true" if arg1 is attacked by arg2
    • add

      public boolean add(Argument arg)
      Description copied from interface: DirHyperGraph
      Adds the given node to this DirHyperGraph.
      Specified by:
      add in interface Collection<Argument>
      Specified by:
      add in interface DirHyperGraph<Argument>
      Overrides:
      add in class BeliefSet<Argument,SetAfSignature>
      Parameters:
      arg - some node.
      Returns:
      "true" iff the edge has been added successfully.
    • addAttack

      public boolean addAttack(HashSet<Argument> hashSet, Argument attacked)
      Adds an attack from the first argument to the second to this SetAf theory.
      Parameters:
      hashSet - some arguments
      attacked - some argument
      Returns:
      "true" if the set of attacks has been modified.
    • addAttack

      public boolean addAttack(Argument attacker, Argument attacked)
      Adds an attack from the first argument to the second to this SetAf theory.
      Parameters:
      attacker - some argument
      attacked - some argument
      Returns:
      "true" if the set of attacks has been modified.
    • remove

      public boolean remove(SetAttack attack)
      Removes the given attack from this SetAf theory.
      Parameters:
      attack - an attack
      Returns:
      "true" if the set of attacks has been modified.
    • remove

      public boolean remove(Argument a)
      Removes the argument and all its attacks
      Parameters:
      a - some argument
      Returns:
      true if this structure has been changed
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<Argument>
      Overrides:
      removeAll in class BeliefSet<Argument,SetAfSignature>
    • containsAll

      public boolean containsAll(Collection<?> c)
      Specified by:
      containsAll in interface ArgumentationFramework<Argument>
      Specified by:
      containsAll in interface Collection<Argument>
      Overrides:
      containsAll in class BeliefSet<Argument,SetAfSignature>
      Parameters:
      c - parameter
      Returns:
      containsAll
    • containsAttack

      public boolean containsAttack(SetAttack att)
      Checks whether this theory contains the given attack.
      Parameters:
      att - some attack
      Returns:
      "true" iff this theory contains the given attack.
    • addAllAttacks

      public boolean addAllAttacks(Set<SetAttack> edges2)
      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

      public boolean add(SetAf theory)
      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:
      hashCode in interface Collection<Argument>
      Overrides:
      hashCode in class BeliefSet<Argument,SetAfSignature>
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Collection<Argument>
      Overrides:
      equals in class BeliefSet<Argument,SetAfSignature>
    • compareTo

      public int compareTo(SetAf o)
      Specified by:
      compareTo in interface Comparable<SetAf>
    • add

      public boolean add(SetAttack edge)
      Parameters:
      edge - attack
      Returns:
      whether the atttack was added or not
    • getNodes

      public Collection<Argument> getNodes()
      Description copied from interface: DirHyperGraph
      Returns the nodes of this DirHyperGraph.
      Specified by:
      getNodes in interface ArgumentationFramework<Argument>
      Specified by:
      getNodes in interface DirHyperGraph<Argument>
      Specified by:
      getNodes in interface GeneralGraph<Argument>
      Returns:
      the nodes of this DirHyperGraph.
    • getNumberOfNodes

      public int getNumberOfNodes()
      Description copied from interface: DirHyperGraph
      Returns the number of nodes in this DirHyperGraph.
      Specified by:
      getNumberOfNodes in interface DirHyperGraph<Argument>
      Returns:
      the number of nodes in this DirHyperGraph.
    • areAdjacent

      public boolean areAdjacent(Argument a, Argument b)
      Description copied from interface: DirHyperGraph
      Returns "true" iff the two nodes are connected by a directed edge from a to b or an undirected edge.
      Specified by:
      areAdjacent in 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.
    • getEdge

      public SetAttack getEdge(Argument a, Argument b)
      Description copied from interface: DirHyperGraph
      Returns the corresponding edge (a,b) if a and b are adjacent. Otherwise it returns null.
      Specified by:
      getEdge in interface DirHyperGraph<Argument>
      Parameters:
      a - some node
      b - some node
      Returns:
      the edge (a,b) or null.
    • getAttacks

      public Set<SetAttack> getAttacks()
      Returns:
      all attacks
    • getDirEdge

      public SetAttack getDirEdge(Set<Argument> node1, Node b)
      Parameters:
      node1 - an attacking set
      b - an argument
      Returns:
      the edge between the two
    • getEdges

      public Collection getEdges()
      Description copied from interface: DirHyperGraph
      Returns the edges of this DirHyperGraph.
      Specified by:
      getEdges in interface DirHyperGraph<Argument>
      Specified by:
      getEdges in interface GeneralGraph<Argument>
      Returns:
      the edges of this DirHyperGraph.
    • contains

      public boolean contains(Object obj)
      Description copied from interface: DirHyperGraph
      Returns "true" when this DirHyperGraph contains the given node or edge.
      Specified by:
      contains in interface Collection<Argument>
      Specified by:
      contains in interface DirHyperGraph<Argument>
      Overrides:
      contains in class BeliefSet<Argument,SetAfSignature>
      Parameters:
      obj - an object
      Returns:
      "true" if this DirHyperGraph contains the given node or edge.
    • getChildren

      public Collection<Argument> getChildren(Set<Argument> node)
      Parameters:
      node - the node
      Returns:
      the children of the node
    • getParents

      public Collection<Argument> getParents(Node node)
      Description copied from interface: DirHyperGraph
      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.
      Specified by:
      getParents in interface DirHyperGraph<Argument>
      Parameters:
      node - some node (must be in the DirHyperGraph).
      Returns:
      the set of parents of the given node.
    • getParents

      public Collection<Set<Argument>> getParents(Argument node)
      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 setAf
      node1 - an argument
      node2 - an argument
      Returns:
      whether the path exists
    • existsDirectedPath

      public boolean existsDirectedPath(Argument node1, Argument node2)
      Description copied from interface: DirHyperGraph
      Checks whether there is a (directed) path from node1 to node2.
      Specified by:
      existsDirectedPath in interface DirHyperGraph<Argument>
      Parameters:
      node1 - some node.
      node2 - some node.
      Returns:
      "true" if there is a directed path from node1 to node2.
    • getNeighbors

      public Collection<Argument> getNeighbors(Argument node)
      Description copied from interface: DirHyperGraph
      Returns the set of neighbors of the given node.
      Specified by:
      getNeighbors in interface DirHyperGraph<Argument>
      Parameters:
      node - some node (must be in the DirHyperGraph).
      Returns:
      the set of neighbors of the given node.
    • getAdjacencyMatrix

      public Matrix getAdjacencyMatrix()
      Description copied from interface: DirHyperGraph
      Returns the adjacency matrix of this DirHyperGraph (the order of the nodes is the same as returned by "iterator()").
      Specified by:
      getAdjacencyMatrix in interface DirHyperGraph<Argument>
      Returns:
      the adjacency matrix of this DirHyperGraph
    • powerSet

      public Set<Set<Argument>> powerSet(Set<Argument> originalSet)
      Parameters:
      originalSet - original set
      Returns:
      the powerset of
    • getComplementGraph

      public SetAf getComplementGraph(int selfloops)
      Description copied from interface: DirHyperGraph
      Returns 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:
      getComplementGraph in 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.
    • getStronglyConnectedComponents

      public Collection getStronglyConnectedComponents()
      Description copied from interface: DirHyperGraph
      Returns 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:
      getStronglyConnectedComponents in interface DirHyperGraph<Argument>
      Returns:
      the strongly connected components of this DirHyperGraph.
    • getSubgraphs

      public Collection<SetAf> getSubgraphs(SetAf g)
      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

      public SetAf getRestriction(Collection<Argument> nodes)
      Description copied from interface: DirHyperGraph
      Returns copy of this DirHyperGraph consisting only of the given nodes and all corresponding edges.
      Specified by:
      getRestriction in interface DirHyperGraph<Argument>
      Specified by:
      getRestriction in interface GeneralGraph<Argument>
      Parameters:
      nodes - a set of nodes
      Returns:
      a DirHyperGraph.
    • hasSelfLoops

      public boolean hasSelfLoops()
      Description copied from interface: DirHyperGraph
      Returns "true" iff the DirHyperGraph has a self loop (an edge from a node to itself).
      Specified by:
      hasSelfLoops in interface DirHyperGraph<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: DirHyperGraph
      Checks whether this DirHyperGraph only contains weighted edges.
      Specified by:
      isWeightedGraph in interface DirHyperGraph<Argument>
      Returns:
      "true" if all edges are weighted in this DirHyperGraph.
    • add

      public boolean add(GeneralEdge edge)
      Description copied from interface: DirHyperGraph
      Adds 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:
      add in interface DirHyperGraph<Argument>
      Parameters:
      edge - some edge.
      Returns:
      "true" iff the edge has been added successfully.
    • toString

      public String toString()
      Specified by:
      toString in interface BeliefBase
      Specified by:
      toString in interface DirHyperGraph<Argument>
      Overrides:
      toString in class BeliefSet<Argument,SetAfSignature>
    • getChildren

      public Collection<Argument> getChildren(Node node)
      Description copied from interface: DirHyperGraph
      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.
      Specified by:
      getChildren in interface DirHyperGraph<Argument>
      Parameters:
      node - some node (must be in the DirHyperGraph).
      Returns:
      the set of children of the given node.
    • getSubGraphs

      public Collection<DirHyperGraph<Argument>> getSubGraphs()
      Description copied from interface: DirHyperGraph
      Returns the set of sub DirHyperGraphs of this DirHyperGraph.
      Specified by:
      getSubGraphs in interface DirHyperGraph<Argument>
      Returns:
      the set of sub DirHyperGraphs of this DirHyperGraph.
    • getSubgraphsHelper

      public static Collection<DirHyperGraph<Argument>> getSubgraphsHelper(SetAf g)
      Parameters:
      g - the SetAf
      Returns:
      the subgraphs of the SetAf