|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.bisim.equiv.ConfigurationGraph
public class ConfigurationGraph
A graph representation of the possible combinations of states from two LTSs (S,T). The possible compound configurations of a bisimulation game can be expressed by a configuration graph, in which nodes represents pairs of states, one from the left LTS and one from the right LTS.
Uses
A configuration graph 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, which represents a winning configuration for the attacker. 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 approximate bisimularity of states in the following way: Each configuration is annotated with its distance to the accept node (which represents the losing configuration for the defender). At each step, if the defender cannot go to a node in the same block as the attacker's node, it chooses a node in a configuration with the greatest distance (preferably a node from which the accept node cannot be reached).
It is also used to detect cycles in seen configurations, which is used to detect a possibly infinite game, in which case the defender should be declared the winner of the game. A perfect attacker can always avoid configuration cycles, since he does not need to visit the same state twice.
Construction
A configuration graph G = (C,E) consists of a set of nodes, or configurations, and a set of edges. A configuration C = (L,R, id) consists of two LTS states, one from the left LTS and one from the right LTS, and an ID. An edge records actions and block numbers of target states. A graph is constructed from a partitioned state space and two LTSs as follows:
An accept node is created. This node marks a winning configuration for the attacker, meaning that the attacker has taken a step in one LTS that the defender cannot mimick in the other LTS.
Given the two initial nodes of the LTSs, an initial configuration (L0,R0) is created. From this initial configuration, edges are added to possible combinations of successors, and the new configurations are added to a work set, until all have been processed. If there exists a unique action in one LTS, an edge to the accept node is created.
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. |
Method Summary | |
---|---|
void |
annotateNodes()
Annotate nodes with a distance to the accept node. |
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)
|
CGNode |
getNode(att.grappa.Node left,
att.grappa.Node right)
Test if there already exists a CGNode 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. |
private java.util.ArrayList<CGNode> |
getTailNodes(CGNode node)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.HashSet<CGEdge> edges
private java.util.HashSet<CGNode> nodes
private CGNode accept
Constructor Detail |
---|
public ConfigurationGraph(StateSpace ss)
ss
- A state spaceMethod Detail |
---|
private void build(StateSpace ss)
ss
- A state space.public void annotateNodes()
private java.util.ArrayList<CGNode> getTailNodes(CGNode node)
private java.util.HashSet<CGEdge> getProperInEdges(CGNode node)
node
- A node for which to get in-edges
private java.util.HashSet<CGEdge> getOutEdges(CGNode node)
node
- A node for which to get out-edges
private CGNode getNode(int nodeId)
public CGNode getNode(att.grappa.Node left, att.grappa.Node right)
left
- A left noderight
- A right node
public java.util.HashMap<CGNode,Strategy> buildPerfectAttackerStrategy()
public java.util.HashSet<CGNode> getSuspiciousNodes()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |