|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.bisimulationGame.equiv.StateSpace
public class StateSpace
A representation of all nodes of two LTSs (S,T) partitioned into one or more blocks. Initially a state space contains one block, which contains all nodes. A state space is created when one player plays against the computer, and is used to calculate winning strategies. A successor map is used for partitioning the state space. This map is created in the GrappaModel, based on the chosen bisimulation type. After partitioning the state space, two processes are bisimilar iff the initial nodes of S and T lie in the same block. From a partitioned state space, a computer defender or attacker may create a winning strategy.
This class contains a method 'partition' for partitioning the state space, which is inspired by the partition function in the source code of the Edinburgh Concurrency Workbench.
Field Summary | |
---|---|
private java.util.Vector<Block> |
blocks
Blocks making up the partition. |
private java.util.HashMap<att.grappa.Node,java.util.Vector<Capability>> |
capabilityMap
A map from nodes to their capabilities. |
private att.grappa.Node |
initialNodeLeft
The initial nodes of the left and right LTSs. |
private att.grappa.Node |
initialNodeRight
The initial nodes of the left and right LTSs. |
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> |
leftSuccessorMap
|
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> |
rightSuccessorMap
|
Constructor Summary | |
---|---|
StateSpace(att.grappa.Node initialNodeLeft,
att.grappa.Node initialNodeRight,
java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> leftSuccessorMap,
java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> rightSuccessorMap)
Constructs a state space based on a successor map, but does not partition it. |
Method Summary | |
---|---|
private boolean |
checkBlock(Block block)
Checks if all nodes in a block have equal capabilities. |
private java.util.Vector<Capability> |
computeNodeCapability(att.grappa.Node node)
Lookup if the capability has already been computed. |
private void |
createBlock(java.util.Set<att.grappa.Node> nodes)
Creates a block with running block number and a set of nodes, adds the block to the block vector, and increments running block number. |
private Block |
getBlockByNumber(int blockNumber)
|
int |
getBlockNumber(att.grappa.Node node)
Returns the block number of a node. |
java.util.Vector<att.grappa.Node> |
getChoices(int side,
att.grappa.Node from,
java.lang.String action)
Find all nodes that are head of an edge with label=action and which has tail=from. |
att.grappa.Node |
getInitialNodeLeft()
Returns the initial node of the left LTS |
att.grappa.Node |
getInitialNodeRight()
Returns the initial node of the right LTS |
java.util.Vector<Capability> |
getNodeCapability(att.grappa.Node node)
Retrieve the capability of a node. |
att.grappa.Node |
getNodeInBlock(int side,
att.grappa.Node from,
java.lang.String action,
int blockNumber)
Find a node that is head of an edge with label=action and which has tail=from, such that the node is in the block with number=blockNumber. |
boolean |
partition()
Partitions the state space according to strong bisimulation and returns true if the two initial nodes are in the same block (partition). |
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.Vector<Block> blocks
private java.util.HashMap<att.grappa.Node,java.util.Vector<Capability>> capabilityMap
private att.grappa.Node initialNodeLeft
private att.grappa.Node initialNodeRight
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> leftSuccessorMap
private java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> rightSuccessorMap
Constructor Detail |
---|
public StateSpace(att.grappa.Node initialNodeLeft, att.grappa.Node initialNodeRight, java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> leftSuccessorMap, java.util.HashMap<att.grappa.Node,java.util.Vector<Successor>> rightSuccessorMap)
initialNodeLeft
- The initial node of the left LTSinitialNodeRight
- The initial node of the right LTSleftSuccessorMap
- The successor map of the left LTSrightSuccessorMap
- The successor map of the right LTSMethod Detail |
---|
private void createBlock(java.util.Set<att.grappa.Node> nodes)
nodes
- Nodes in the new blockpublic java.util.Vector<Capability> getNodeCapability(att.grappa.Node node)
node
- A node
private java.util.Vector<Capability> computeNodeCapability(att.grappa.Node node)
node
- A node
public int getBlockNumber(att.grappa.Node node)
node
- A node
private boolean checkBlock(Block block)
block
- The block (partition) to consider
public boolean partition()
public java.lang.String toString()
toString
in class java.lang.Object
private Block getBlockByNumber(int blockNumber)
public att.grappa.Node getNodeInBlock(int side, att.grappa.Node from, java.lang.String action, int blockNumber)
side
- The side (left/right)from
- The from-nodeaction
- The action nameblockNumber
- The block number of the to-node
public java.util.Vector<att.grappa.Node> getChoices(int side, att.grappa.Node from, java.lang.String action)
side
- The side (left/right)from
- The from-nodeaction
- The action name
public att.grappa.Node getInitialNodeLeft()
public att.grappa.Node getInitialNodeRight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |