<< Chapter < Page | Chapter >> Page > |
After loading or typing a program, it's always a good idea to check your typing. In the "Run" menu, use "Run Syntax Check".It will report and highlight the first syntax error, if any.
Before the first run, you need to specify some parameters, even if those are the defaults.From the "Run" menu, select the "Set Simulation Parameters" option. Change the "Display Mode" defaults, by making sure that the"MSC" and "Data Values" panels are each selected, as well as each featureunder the "Data Values" panel. Use the "Start" button to start the run.This opens three new windows. From the "Simulation Output" window, you can choose to single-step therun or let it finish. For now, choose "Run". The body of this window displays each step taken.Throughout the run, the "Data Values" window displays the values of variables. The "Message Sequence Chart" displays changesto each process and variable. Each column represents a separate process or variable, and the verticalaxis represents time. For now, the only changes to processes arewhen they stop.
Each process gets a unique process identifier number, starting with 0. These are displayed in the output of the various windows. Later , we will see how to access these IDs from within the Promela program.
For additional runs, from the "Run" menu of the main window, you can select"(Re)Run Simulation". However, each run will be identical, because it makes the same choicesfor interleaving. To vary runs, or traces , change the "Seed Value" in thesimulation options. Also, be sure to try the "Interactive" simulation style, where you make each choice in the interleaving.
xspin
run opens several new windows,
without closing the old ones.The easiest way to close the windows for a run is to use the "Cancel"
button in the "Simulation Output" window.spin
than
xspin
,
since you don't need to setany of the simulation parameters:
prompt>spin
filename .pml
How many traces are possible for the
previous example's code ?
Does each end with the same value for
bal
?
Did you see each one using SPIN?
Each trace ends with
bal
equal to 0, as expected.
show
introduces transitions and states to display their
changing values. We have omitted these.Notification Switch
Would you like to follow the 'Model checking concurrent programs' conversation and receive update notifications?