File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,8 +211,8 @@ pirates:
211211 --model=demo/pirates/alice.pml \
212212 --phi=demo/pirates/phi.pml \
213213 --Q=demo/pirates/bob.pml \
214- --IO=demo/pirates/IO.txt \
215- --max_attacks=10 \
214+ --IO=demo/pirates/IO.txt \
215+ --max_attacks=1 \
216216 --with_recovery=True \
217217 --name=pirates \
218218 --characterize=True
Original file line number Diff line number Diff line change @@ -8,12 +8,29 @@ bool aliceRetired = false
88active proctype alice () {
99SCOPING:
1010 if
11+ /* When Alice is scoping for Bob, as soon as she
12+ * notices him, she immediately attacks, _regardless_
13+ * of what flags he waves.
14+ */
1115 :: bob2alice ? _ -> goto PIRATESTUFF;
1216 fi
1317PIRATESTUFF:
18+ /* When Alice attacks, she first hoists the pirate
19+ * flag, to make it clear that she is, in fact, a big
20+ * scary pirate.
21+ */
1422 alice2bob ! pirate;
1523 if
24+ /* If Bob shows the white flag of surrender then Alice
25+ * takes his loot and then returns to the high sea to
26+ * scope for another ship to plunder.
27+ */
1628 :: bob2alice ? white -> goto SCOPING;
29+ /* On the other hand, if Bob hoists the official colors of
30+ * Her Majesty's Royal Navy, then Alice will surrender,
31+ * because she knows that she is no match for the Royal
32+ * Navy in battle!
33+ */
1734 :: bob2alice ? royal -> goto end;
1835 fi
1936end:
Original file line number Diff line number Diff line change 11active proctype bob () {
22FISHING:
33 do
4+ /* When Bob sees Alice, he offers to trade. */
45 :: bob2alice ! trading;
6+ /* If Alice says she is a pirate then Bob
7+ * surrenders immediately. He has a peaceful soul.
8+ */
59 :: alice2bob ? pirate -> bob2alice ! white;
610 od
711end:
You can’t perform that action at this time.
0 commit comments