dk.brics.bisimulationGame.equiv
Class ConfigurationGraph

java.lang.Object
  extended by dk.brics.bisimulationGame.equiv.ConfigurationGraph

public class ConfigurationGraph
extends java.lang.Object

A graph representation of the possible combinations of states from two LTSs (S,T). It is used by an attacker to compute a winning strategy, which is a path from the initial configuration (S_init, T_init) to an accept node. All edges into the accept node represents steps that can only occur in one of the two LTSs, hence will make the defender lose. It is also used by a non-perfect defender to retrieve a set of suspicious nodes (configurations). These are nodes with edges to the accept node. If a defender has more choices at any configuration, it will attempt to avoid going to a suspicious configuration.

In a configuration graph, each node is made up of two nodes, from the left and right LTS. An edge records actions and block numbers of target states. A graph is constructed from a partitioned state space. An attacker uses buildPerfectAttackerStrategy to get a strategy. A defender uses getSuspiciousNodes to try to avoid a set of configurations.

Author:
Martin Mosegaard martinm@daimi.au.dk

Field Summary
private  CGNode accept
          The accept node marks a winning configuration for the attacker, i.e. one where the attacker has taken a step that can't be mimicked by the defender.
private  java.util.HashSet<CGEdge> edges
          The set of edges in the graph.
private  java.util.HashSet<CGNode> nodes
          The set of nodes in the graph.
 
Constructor Summary
ConfigurationGraph(StateSpace ss)
          Constructs a graph from a state space and computes a perfect attacker strategy.
 
Method Summary
private  void build(StateSpace ss)
          Builds a graph from a state space.
 java.util.HashMap<CGNode,Strategy> buildPerfectAttackerStrategy()
          Computes a strategy for the attacker.
private  CGNode getNode(int nodeId)
           
private  CGNode getNode(att.grappa.Node left, att.grappa.Node right)
          Test if there already exists a PGNode with these left and right nodes.
private  java.util.HashSet<CGEdge> getOutEdges(CGNode node)
          Returns all out-edges of a node.
private  java.util.HashSet<CGEdge> getProperInEdges(CGNode node)
          Used for computing an attacker strategy.
 java.util.HashSet<CGNode> getSuspiciousNodes()
          Used by a defender to get the set of nodes which have edges to the accept node.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

edges

private java.util.HashSet<CGEdge> edges
The set of edges in the graph.


nodes

private java.util.HashSet<CGNode> nodes
The set of nodes in the graph.


accept

private CGNode accept
The accept node marks a winning configuration for the attacker, i.e. one where the attacker has taken a step that can't be mimicked by the defender.

Constructor Detail

ConfigurationGraph

public ConfigurationGraph(StateSpace ss)
Constructs a graph from a state space and computes a perfect attacker strategy.

Parameters:
ss - A state space
Method Detail

build

private void build(StateSpace ss)
Builds a graph from a state space. Construction: Start with a work set containing a pair node made from the two initial nodes. If their capabilities are equal wrt. actions (not necessarily block numbers), create out-edges. Also create new pair nodes, if these have not been processed already.

Parameters:
ss - A state space.

getProperInEdges

private java.util.HashSet<CGEdge> getProperInEdges(CGNode node)
Used for computing an attacker strategy. Returns all in-edges of a node with the properties that:
  1. They are not self-loop edges.
  2. At most one part of the edge (left/right) may be weak.
  3. If there are more edges with the same tail, one must be chosen instead of the others. Criteria: An edge is not chosen if there is also another edge with the same actions going to a different node than the 'node' parameter.
  4. If the tail of an edge is a node with a similar edge going go itself (a self-loop), do not consider this edge. This is because there is a non-deterministic defender choice at the tail node, allowing the defender to 'hide' in a weak cycle (SCC) on its LTS. (Similar is with respect to the left and right action names and weaknesses.) Characteristics of weak cycles in terms of a configuration graph: There are weak edges to and from each pair of configurations in the cycle (including self-loops for all configurations).

Parameters:
node - A node for which to get in-edges
Returns:
A set of edges

getOutEdges

private java.util.HashSet<CGEdge> getOutEdges(CGNode node)
Returns all out-edges of a node.

Parameters:
node - A node for which to get out-edges
Returns:
A set of edges

getNode

private CGNode getNode(int nodeId)

getNode

private CGNode getNode(att.grappa.Node left,
                       att.grappa.Node right)
Test if there already exists a PGNode with these left and right nodes.

Parameters:
left - A left node
right - A right node
Returns:
The node, if it exists, otherwise null

buildPerfectAttackerStrategy

public java.util.HashMap<CGNode,Strategy> buildPerfectAttackerStrategy()
Computes a strategy for the attacker. A strategy consists of, at each configuration (pair of nodes), a side (left/right), an action, and the name of the target state. Construction:

Returns:
An attacker strategy as a map from configurations to strategies

getSuspiciousNodes

public java.util.HashSet<CGNode> getSuspiciousNodes()
Used by a defender to get the set of nodes which have edges to the accept node.

Returns:
The set of suspicious nodes

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object