|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.man.cs.rainbow.deadlock.StateEngine
Rewindable state system enumeration engine.
StateEnumerator
,
DeadlockChecker
Inner Class Summary | |
static class |
StateEngine.AlreadyInitialisedException
|
static class |
StateEngine.ChannelEvent
Events that happen on channels during state enumeration. |
static class |
StateEngine.Debug
For debugging. |
static interface |
StateEngine.EntryStack
Path storage mechanism spec. |
class |
StateEngine.EntryStackEager
Path storage mechanism. |
class |
StateEngine.EntryStackLazy
Path storage mechanism. |
static class |
StateEngine.EntryStore
Visited state storage mechanism. |
static interface |
StateEngine.EventStack
A stack of channel events. |
class |
StateEngine.EventStackEager
Stack of channel events. |
class |
StateEngine.EventStackLazy
Stack of channel events. |
static class |
StateEngine.ExecuteResult
Used to indicate what happened during an execute step. |
class |
StateEngine.Failing
Encapsulate state info when falling back from a possible failure state. |
class |
StateEngine.Listener
Channel event recording mechanism. |
static class |
StateEngine.MajorState
Major state. |
static class |
StateEngine.StackEntry
An entry on the stack. |
Field Summary | |
static PrintStream |
DEBUGGING
Where a trace of debugging actions is printed. |
static int |
EAGER_POP
Indicate that all pops are to be carried out as soon as possible. |
static int |
LAZY_POP
Indicate that all pops are to be carried out as late as possible. |
Constructor Summary | |
StateEngine(StateEnumerator enumerator)
Create a new state enumeration engine with no automata attached. |
|
StateEngine(StateEnumerator enumerator,
AutomataState automata)
Create a new state enumeration engine attached to control automata. |
|
StateEngine(StateEnumerator enumerator,
AutomataState automata,
int popStyle)
Create a new state enumeration engine attached to control automata. |
Method Summary | |
protected Data[] |
advanceEpsilons()
Advance the system over epsilon steps. |
boolean |
backtrack()
Make the system backtrack. |
boolean |
backtrack(boolean stateValue)
Make the system backtrack. |
StateEngine.ExecuteResult |
execute()
Try to execute a non-empty transition to a new state. |
StateEngine.ExecuteResult |
execute(boolean resetCounter)
Try to execute a non-empty transition to a new state. |
long |
getActionCount()
Report the number of state-changes that have happened. |
StateEngine.ChannelEvent[][] |
getChannelEvents()
Get the events that have happened on labelled channels. |
StateEngine.ChannelEvent[][] |
getChannelEvents(int index)
Get the events that have happened on labelled channels up to the given depth on the current path. |
long |
getMinorActionCount()
Report the number of times the scheduler has been called. |
int |
getPathLength()
Report the length of the current path. |
int |
getPathMax()
Report the maximum length of the path. |
SavedState |
getState(int index)
Get the state at a given depth on the current path. |
int |
getStateCount()
Report the number of distinct states visited. |
void |
pop()
Pop a state from the stack. |
void |
push()
Save the current state and reset the transition index counter to zero. |
void |
stepPastEnd()
Generate extra state to demonstrate unwanted loop. |
Boolean |
visited()
Has the current state has been visited before? This is useful when the state of the automata changes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final PrintStream DEBUGGING
public static final int EAGER_POP
StateEngine(StateEnumerator,AutomataState,int)
public static final int LAZY_POP
StateEngine(StateEnumerator,AutomataState,int)
Constructor Detail |
public StateEngine(StateEnumerator enumerator) throws RainbowException
enumerator
- The scheduler that this system will analyse.RainbowException
- If the scheduler was initialised, or if something goes wrong
during initialisation.DeadlockChecker
public StateEngine(StateEnumerator enumerator, AutomataState automata) throws RainbowException
enumerator
- The scheduler that this system will analyse.automata
- Reference to the collected state of the automata to attach to.RainbowException
- If the scheduler was initialised, or if something goes wrong
during initialisation.public StateEngine(StateEnumerator enumerator, AutomataState automata, int popStyle) throws RainbowException
enumerator
- The scheduler that this system will analyse.automata
- Reference to the collected state of the automata to attach to.popStyle
- Sets the style of state pop used in the internal stack.StateEngine.AlreadyInitialisedException
- If the state enumerator was already initialised.RainbowException
- If something goes wrong during initialisation.EAGER_POP
,
LAZY_POP
Method Detail |
protected Data[] advanceEpsilons() throws RainbowException
RainbowException
- If something goes wrong during step execution.StateEnumerator.countTransitions()
,
StateEnumerator.executeTransition(int)
,
StateEnumerator.characterise(Data[])
public StateEngine.ExecuteResult execute(boolean resetCounter) throws RainbowException
resetCounter
- Whether to reset the local transition counter first.RainbowException
- If something went wrong during execution of the transition.advanceEpsilons()
,
StateEngine.ExecuteResult
public StateEngine.ExecuteResult execute() throws RainbowException
RainbowException
- If something went wrong during execution of the transition.advanceEpsilons()
,
StateEngine.ExecuteResult
public void push()
pop
.public void pop() throws RainbowException
push
action with which it should be programmatically paired. Does not
put the state backtracked out of into the store.RainbowException
- If the stack is empty.public boolean backtrack() throws RainbowException
RainbowException
- If state reloading fails somehow.public boolean backtrack(boolean stateValue) throws RainbowException
stateValue
- What value is associated with this state in the store?RainbowException
- If state reloading fails somehow.public Boolean visited()
Boolean
that describes the state
if the state has been backtracked out of.public int getPathLength()
public int getPathMax()
public int getStateCount()
public long getActionCount()
advanceEpsilons()
,
execute()
,
execute(boolean)
public long getMinorActionCount()
advanceEpsilons()
,
StateEnumerator.executeTransition(int)
public SavedState getState(int index)
index
- From where in the current path is the saved state to be
returned.NullPointerException
- If the index is negative or indicates a state off the
current path.StateEnumerator.restoreState(SavedState)
public StateEngine.ChannelEvent[][] getChannelEvents()
Channel
,
StateEngine.ChannelEvent
,
execute()
public StateEngine.ChannelEvent[][] getChannelEvents(int index)
index
- From where in the current path is the channel event vector
to be returned.NullPointerException
- If the index is negative or indicates a state off the
current path.Channel
,
StateEngine.ChannelEvent
,
execute()
public void stepPastEnd() throws RainbowException
I have yet to figure out if this has any usefulness to deadlock checking, so the implementation throws an exception there.
RainbowException
- For many reasons, including if the operation isn't supported
with the current stack model.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |