|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.bisim.equiv.StateSpace
public class StateSpace
A representation of all nodes of two LTSs (S,T) partitioned into one or more blocks.
The state space of nodes in the two LTSs can be partitioned according to the capabilities of a node. This is an approach also taken in the Edinburgh CWB. If the two systems are bisimilar, each block in the partitioned state space contains at least one node from both LTSs. In particular, the initial nodes are in the same block. If the two systems are not bisimilar, the initial nodes are not in the same block.
Partitioning a state space is done by comparing the capability of nodes: Nodes with the same capability end up in the same block, and new blocks are created when differences are encountered.
The capability of a node is a set of pairs of actions from that node and a
block number of the target node. Note that while partitioning the state space, the
capabilities of a node change due to changing block numbers.
Initially a state space contains one block, which contains all nodes.
A successor map is used for partitioning the state space. This map is created in
the LTSModel, 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.ArrayList<Block> |
blocks
Blocks making up the partition. |
private java.util.HashMap<att.grappa.Node,java.util.ArrayList<Capability>> |
capabilityMap
A map from nodes to their capabilities. |
private att.grappa.Node |
initialNodeLeft
The initial nodes of the left LTS. |
private att.grappa.Node |
initialNodeRight
The initial node of the right LTS. |
private java.util.HashMap<att.grappa.Node,java.util.ArrayList<Successor>> |
leftSuccessorMap
|
private java.util.HashMap<att.grappa.Node,java.util.ArrayList<Successor>> |
rightSuccessorMap
|
Constructor Summary | |
---|---|
StateSpace(att.grappa.Node initialNodeLeft,
att.grappa.Node initialNodeRight,
java.util.HashMap<att.grappa.Node,java.util.ArrayList<Successor>> leftSuccessorMap,
java.util.HashMap<att.grappa.Node,java.util.ArrayList<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.ArrayList<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 ArrayList, 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.ArrayList<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.ArrayList<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.ArrayList<Block> blocks
private java.util.HashMap<att.grappa.Node,java.util.ArrayList<Capability>> capabilityMap
private att.grappa.Node initialNodeLeft
private att.grappa.Node initialNodeRight
private java.util.HashMap<att.grappa.Node,java.util.ArrayList<Successor>> leftSuccessorMap
private java.util.HashMap<att.grappa.Node,java.util.ArrayList<Successor>> rightSuccessorMap
Constructor Detail |
---|
public StateSpace(att.grappa.Node initialNodeLeft, att.grappa.Node initialNodeRight, java.util.HashMap<att.grappa.Node,java.util.ArrayList<Successor>> leftSuccessorMap, java.util.HashMap<att.grappa.Node,java.util.ArrayList<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.ArrayList<Capability> getNodeCapability(att.grappa.Node node)
node
- A node
private java.util.ArrayList<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.ArrayList<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 |