No edit summary |
|||
| Line 58: | Line 58: | ||
We will illustrate the state space that ProB generates using the various search strategies when limiting the search to 10 nodes. For this we use the command-line version as follows (as there we can provide exactly how many states should be explored): | We will illustrate the state space that ProB generates using the various search strategies when limiting the search to 10 nodes. For this we use the command-line version as follows (as there we can provide exactly how many states should be explored): | ||
$ probcli phonebook7.mch -p MAX_OPERATIONS | $ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode <MODE> | ||
However, you can also obtain a similar effect with the Tcl/Tk version by starting the model checker and then quickly pressing the Cancel button and then inspecting the state space (Statespace command in the Visualise menu; see [[Tutorial_First_Model_Checking]]). | However, you can also obtain a similar effect with the Tcl/Tk version by starting the model checker and then quickly pressing the Cancel button and then inspecting the state space (Statespace command in the Visualise menu; see [[Tutorial_First_Model_Checking]]). | ||
Below we show the output of the above command for the various choices of <MODE>. | Below we show the output of the above command for the various choices of <MODE>. | ||
| Line 66: | Line 66: | ||
$ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode bf | $ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode bf | ||
[[file:ProB_Phonebook7_spdot_bf.png|center]] | [[file:ProB_Phonebook7_spdot_bf.png|600px|center]] | ||
=== Depth-First === | === Depth-First === | ||
$ probcli phonebook7.mch -p MAX_OPERATIONS | $ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode df | ||
[[file:ProB_Phonebook7_spdot_df.png|center]] | [[file:ProB_Phonebook7_spdot_df.png|300px|center]] | ||
=== Mixed === | === Mixed === | ||
| Line 84: | Line 84: | ||
=== Random === | === Random === | ||
$ probcli phonebook7.mch -p MAX_OPERATIONS | $ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode random | ||
[[file:ProB_Phonebook7_spdot_random1.png|center]] | [[file:ProB_Phonebook7_spdot_random1.png|600px|center]] | ||
[[file:ProB_Phonebook7_spdot_random2.png|center]] | [[file:ProB_Phonebook7_spdot_random2.png|600px|center]] | ||
=== Hash === | === Hash === | ||
$ probcli phonebook7.mch -p MAX_OPERATIONS | $ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode hash | ||
[[file:ProB_Phonebook7_spdot_hash.png|center]] | [[file:ProB_Phonebook7_spdot_hash.png|600px|center]] | ||
=== Out-Degree === | === Out-Degree === | ||
$ probcli phonebook7.mch -p MAX_OPERATIONS | $ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode dlk | ||
[[file:ProB_Phonebook7_spdot_dlk.png|center]] | [[file:ProB_Phonebook7_spdot_dlk.png|600px|center]] | ||
We assume that you have completed Tutorial First Model Checking and Complete model checking.
Here we will look a bit closer at the search strategy options of the ProB model checker. You can set the mode using the -mc_mode <M> command-line switch of probcli. In the Tcl/Tk version you can select the strategy in the model checking dialog box (which you obtain via the"Model Check..." command in the "Verify" menu):

The following values are possible:
To illustrate the effect of the search strategy we use the following simple example:
MACHINE phonebook7
SETS
Name ; Code = {c1,c2,c3,c4}
VARIABLES db, active, activec
DEFINITIONS
scope_Name == 1..4
INVARIANT
db : Name +-> Code & active:POW(Name) & activec:POW(Code) &
dom(db) = active & ran(db) = activec
ASSERTIONS
card(active) >= card(activec)
INITIALISATION
db := {} || active := {} || activec := {}
OPERATIONS
dd <-- getdom = dd:= dom(db);
cc <-- lookup(nn) =
PRE
nn : Name & nn : active
THEN
cc:=db(nn)
END;
add(nn,cc) =
PRE
nn:Name & cc:Code & nn /: active
THEN
db := db \/ { nn |-> cc} || active := active \/ {nn} || activec := activec \/ {cc}
END;
delete(nn,cc) =
PRE
nn:Name & cc:Code & nn: active & cc: activec & db(nn) = cc
THEN
db := db - { nn |-> cc} || active := active - {nn} || activec := db[(active - {nn})]
END
END
We will illustrate the state space that ProB generates using the various search strategies when limiting the search to 10 nodes. For this we use the command-line version as follows (as there we can provide exactly how many states should be explored):
$ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode <MODE>
However, you can also obtain a similar effect with the Tcl/Tk version by starting the model checker and then quickly pressing the Cancel button and then inspecting the state space (Statespace command in the Visualise menu; see Tutorial_First_Model_Checking). Below we show the output of the above command for the various choices of <MODE>.
$ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode bf

$ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode df

$ probcli phonebook7.mch -p MAX_OPERATIONS 200 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode mixed


$ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode random


$ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode hash

$ probcli phonebook7.mch -p MAX_OPERATIONS 99 -mc 10 -spdot out.dot -p DOT_LEAVES FALSE -mc_mode dlk
