avrora.stack
Class StateCache

java.lang.Object
  extended byavrora.stack.StateCache

public class StateCache
extends java.lang.Object

The StateSpace class represents the reachable state space as it is explored by the Analyzer class. It stores reachable states and the outgoing edges that connect them.


Nested Class Summary
 class StateCache.Set
           
 class StateCache.State
          The State class represents an immutable state within the state space of the program.
 
Constructor Summary
StateCache(Program p)
          The constructor for the StateSpace accepts a program as a parameter.
 
Method Summary
 StateCache.State getEdenState()
          The getEdenState() method gets the starting state of the abstract interpretation.
 StateCache.State getStateFor(MutableState s)
          The getCachedState() method searches the state cache for an immutable state that corresponds to the given mutable state.
 java.util.Iterator getStateIterator()
           
 long getTotalStateCount()
          The getTotalStateCount() method returns the internally recorded number of states created in this state space.
 StateCache.Set newSet()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateCache

public StateCache(Program p)
The constructor for the StateSpace accepts a program as a parameter. This is currently unused, but is reserved for use later.

Parameters:
p - the program to create the state space for
Method Detail

getEdenState

public StateCache.State getEdenState()
The getEdenState() method gets the starting state of the abstract interpretation.

Returns:
the initial state to begin abstract interpretation

getStateFor

public StateCache.State getStateFor(MutableState s)
The getCachedState() method searches the state cache for an immutable state that corresponds to the given mutable state. If no immutable state exists in the cache, one will be created and inserted.

Parameters:
s - the state to search for
Returns:
an instance of the StateSpace.State immutable state that corresponds to the given mutable state

getTotalStateCount

public long getTotalStateCount()
The getTotalStateCount() method returns the internally recorded number of states created in this state space. This is mainly used for reporting purposes.

Returns:
the total number of states in the state cache

getStateIterator

public java.util.Iterator getStateIterator()

newSet

public StateCache.Set newSet()