Check out the new USENIX Web site. next up previous
Next: Checking Correctness Properties Up: CMC Model Checking Algorithm Previous: Generating the Initial State

Generating Successor States

To generate the state graph on-the-fly, CMC needs to be able to compute the set of possible immediate successors of a state. Each state in the state space of the system may have several successors because of nondeterminism, which arises from several sources: the choice of which process to execute, the choice of which enabled transition within the process to execute, and nondeterministic values returned by calls to CMCChoose.

From a given state, CMC chooses a process and one of its enabled event handlers to schedule. Next, CMC restores the context of the process by copying the contents of the heap and the global variables of the process from the state. The event handler is then called. This function eventually returns because it is guaranteed to be atomic. At this point, the context of the process state is saved, yielding a new system state. CMC generates all successors of a state by repeating the above process for all nondeterministic choices.

Figure 3: Pseudocode for the CMC model checking algorithm.
\begin{figure}\small {
\begin{verbatim}void modelCheck(){
SystemState{
share...
...
generate error
StateQ.insert(successor);
}
}
}\end{verbatim}}
\end{figure}


next up previous
Next: Checking Correctness Properties Up: CMC Model Checking Algorithm Previous: Generating the Initial State
Madanlal Musuvathi 2002-10-08