From 663e817d1a37813aea62c21e8fda9545d7f39a44 Mon Sep 17 00:00:00 2001 From: Filip Macak Date: Thu, 1 Feb 2024 21:56:34 +0100 Subject: [PATCH] Added models for TAC journal --- models/tac24/case-studies/dpm-b/easy.props | 2 + models/tac24/case-studies/dpm-b/lost.props | 2 + models/tac24/case-studies/dpm-b/power.props | 1 + models/tac24/case-studies/dpm-b/sketch.props | 2 + models/tac24/case-studies/dpm-b/sketch.templ | 266 +++++++++ .../grid-meet-all-obs-1fsc/sketch.props | 6 + .../grid-meet-all-obs-1fsc/sketch.templ | 169 ++++++ .../grid-meet-all-obs-2fsc/sketch.props | 6 + .../grid-meet-all-obs-2fsc/sketch.templ | 264 +++++++++ .../grid-meet-all-obs-3fsc/sketch.props | 6 + .../grid-meet-all-obs-3fsc/sketch.templ | 327 +++++++++++ .../grid-meet-all-obs-sl-1fsc/sketch.props | 6 + .../grid-meet-all-obs-sl-1fsc/sketch.templ | 169 ++++++ .../grid-meet-all-obs-sl-2fsc/sketch.props | 6 + .../grid-meet-all-obs-sl-2fsc/sketch.templ | 264 +++++++++ .../grid-meet-all-obs-sl-3fsc/sketch.props | 6 + .../grid-meet-all-obs-sl-3fsc/sketch.templ | 327 +++++++++++ .../grid-meet-sl-1fsc/sketch.props | 6 + .../grid-meet-sl-1fsc/sketch.templ | 98 ++++ .../grid-meet-sl-2fsc-res/sketch.props | 1 + .../grid-meet-sl-2fsc-res/sketch.templ | 144 +++++ .../grid-meet-sl-2fsc/sketch.props | 6 + .../grid-meet-sl-2fsc/sketch.templ | 148 +++++ .../grid-meet-sl-3fsc/sketch.props | 6 + .../grid-meet-sl-3fsc/sketch.templ | 180 ++++++ .../tac24/case-studies/grid-meet/sketch.props | 6 + .../tac24/case-studies/grid-meet/sketch.templ | 129 +++++ .../case-studies/maze-multi/sketch.props | 5 + .../case-studies/maze-multi/sketch.templ | 96 ++++ models/tac24/dpm-demo/compute.props | 9 + models/tac24/dpm-demo/requests.props | 1 + models/tac24/dpm-demo/sketch.props | 2 + models/tac24/dpm-demo/sketch.templ | 157 +++++ models/tac24/grid-10-sl-4fsc/easy.props | 1 + models/tac24/grid-10-sl-4fsc/sketch.props | 1 + models/tac24/grid-10-sl-4fsc/sketch.templ | 70 +++ models/tac24/grid-av-4fsc/easy.props | 1 + models/tac24/grid-av-4fsc/sketch.props | 1 + models/tac24/grid-av-4fsc/sketch.templ | 102 ++++ models/tac24/grid-meet-2fsc/sketch.props | 6 + models/tac24/grid-meet-2fsc/sketch.templ | 148 +++++ models/tac24/maze-sl-5/easy.props | 1 + models/tac24/maze-sl-5/sketch.props | 1 + models/tac24/maze-sl-5/sketch.templ | 195 +++++++ models/tac24/pole-res/easy.props | 1 + models/tac24/pole-res/sketch.props | 1 + models/tac24/pole-res/sketch.templ | 166 ++++++ models/tac24/pole/easy.props | 1 + models/tac24/pole/sketch.props | 1 + models/tac24/pole/sketch.templ | 166 ++++++ models/tac24/refuel-06-res/sketch.props | 1 + models/tac24/refuel-06-res/sketch.templ | 542 ++++++++++++++++++ 52 files changed, 4229 insertions(+) create mode 100644 models/tac24/case-studies/dpm-b/easy.props create mode 100644 models/tac24/case-studies/dpm-b/lost.props create mode 100644 models/tac24/case-studies/dpm-b/power.props create mode 100644 models/tac24/case-studies/dpm-b/sketch.props create mode 100644 models/tac24/case-studies/dpm-b/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-sl-1fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-sl-1fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-sl-2fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-sl-2fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet-sl-3fsc/sketch.props create mode 100644 models/tac24/case-studies/grid-meet-sl-3fsc/sketch.templ create mode 100644 models/tac24/case-studies/grid-meet/sketch.props create mode 100644 models/tac24/case-studies/grid-meet/sketch.templ create mode 100644 models/tac24/case-studies/maze-multi/sketch.props create mode 100644 models/tac24/case-studies/maze-multi/sketch.templ create mode 100644 models/tac24/dpm-demo/compute.props create mode 100644 models/tac24/dpm-demo/requests.props create mode 100644 models/tac24/dpm-demo/sketch.props create mode 100644 models/tac24/dpm-demo/sketch.templ create mode 100644 models/tac24/grid-10-sl-4fsc/easy.props create mode 100644 models/tac24/grid-10-sl-4fsc/sketch.props create mode 100644 models/tac24/grid-10-sl-4fsc/sketch.templ create mode 100644 models/tac24/grid-av-4fsc/easy.props create mode 100644 models/tac24/grid-av-4fsc/sketch.props create mode 100644 models/tac24/grid-av-4fsc/sketch.templ create mode 100644 models/tac24/grid-meet-2fsc/sketch.props create mode 100644 models/tac24/grid-meet-2fsc/sketch.templ create mode 100644 models/tac24/maze-sl-5/easy.props create mode 100644 models/tac24/maze-sl-5/sketch.props create mode 100644 models/tac24/maze-sl-5/sketch.templ create mode 100644 models/tac24/pole-res/easy.props create mode 100644 models/tac24/pole-res/sketch.props create mode 100644 models/tac24/pole-res/sketch.templ create mode 100644 models/tac24/pole/easy.props create mode 100644 models/tac24/pole/sketch.props create mode 100644 models/tac24/pole/sketch.templ create mode 100644 models/tac24/refuel-06-res/sketch.props create mode 100644 models/tac24/refuel-06-res/sketch.templ diff --git a/models/tac24/case-studies/dpm-b/easy.props b/models/tac24/case-studies/dpm-b/easy.props new file mode 100644 index 000000000..f26d4d693 --- /dev/null +++ b/models/tac24/case-studies/dpm-b/easy.props @@ -0,0 +1,2 @@ +R{"lostH"} <= 1 [ F "finished" ] +R{"power"} <= 140 [ F "finished" ] \ No newline at end of file diff --git a/models/tac24/case-studies/dpm-b/lost.props b/models/tac24/case-studies/dpm-b/lost.props new file mode 100644 index 000000000..28f00f336 --- /dev/null +++ b/models/tac24/case-studies/dpm-b/lost.props @@ -0,0 +1,2 @@ +//R{"lostH"}min = ? [ F "finished" ] +R{"lostL"}min = ? [ F "finished" ] \ No newline at end of file diff --git a/models/tac24/case-studies/dpm-b/power.props b/models/tac24/case-studies/dpm-b/power.props new file mode 100644 index 000000000..7dbe2f696 --- /dev/null +++ b/models/tac24/case-studies/dpm-b/power.props @@ -0,0 +1 @@ +R{"power"}min = ? [ F "finished" ] diff --git a/models/tac24/case-studies/dpm-b/sketch.props b/models/tac24/case-studies/dpm-b/sketch.props new file mode 100644 index 000000000..fb7f3d9c2 --- /dev/null +++ b/models/tac24/case-studies/dpm-b/sketch.props @@ -0,0 +1,2 @@ +R{"lost"} <= 1 [ F "finished" ] +R{"power"}min = ? [ F "finished" ] \ No newline at end of file diff --git a/models/tac24/case-studies/dpm-b/sketch.templ b/models/tac24/case-studies/dpm-b/sketch.templ new file mode 100644 index 000000000..d9d72e515 --- /dev/null +++ b/models/tac24/case-studies/dpm-b/sketch.templ @@ -0,0 +1,266 @@ +dtmc + +// To make it more challenging, we can extend the model and consider low and high priority requests +// using two request queues. + +const int CMAX = 10; + +hole int X11 in {0,1,2}; +hole int X21 in {0,1,2}; +hole int X31 in {0,1,2}; +hole int X41 in {0,1,2}; +hole int X12 in {0,1,2}; +hole int X22 in {0,1,2}; +hole int X32 in {0,1,2}; +hole int X42 in {0,1,2}; +hole int X13 in {0,1,2}; +hole int X23 in {0,1,2}; +hole int X33 in {0,1,2}; +hole int X43 in {0,1,2}; +hole int X14 in {0,1,2}; +hole int X24 in {0,1,2}; +hole int X34 in {0,1,2}; +hole int X44 in {0,1,2}; + + +const int LT1 = 3; +const int LT2 = 5; +const int LT3 = 7; +const int HT1 = 3; +const int HT2 = 5; +const int HT3 = 7; + +// This system can achieve + +//R{"power"}<= 18000 [ F (bat=0) ] + +//R{"lostH"}<= 0.3 [ F (bat=0) ] + +//R{"lostL"}<= 0.6 [ F (bat=0) ] + + +module CLOCK + + c : [0..1]; + + [tick1] bat>0 & c=0 -> (c'=1); + [tick2] bat>0 & c=1 -> (c'=0); + +endmodule + +// POWER MANAGER + +module PM + + pm : [0..3] init 3; + // 0 - go to active + // 1 - go to active for LOW + // 2 - go to idle + // 3 - go to sleep + + + [tick1] qL*10 <= LT1*CMAX & q*10 <= HT1*CMAX -> (pm'=X11); + + [tick1] qL*10 > LT1*CMAX & qL*10 <= LT2*CMAX & q*10 <= HT1*CMAX -> (pm'=X21); + + [tick1] qL*10 > LT2*CMAX & qL*10 <= LT3*CMAX & q*10 <= HT1*CMAX -> (pm'=X31); + + [tick1] qL*10 > LT3*CMAX & q*10 <= HT1*CMAX -> (pm'=X41); + + [tick1] qL*10 <= LT1*CMAX & q*10 > HT1*CMAX & q*10 <= HT2*CMAX -> (pm'=X12); + + [tick1] qL*10 > LT1*CMAX & qL*10 <= LT2*CMAX & q*10 > HT1*CMAX & q*10 <= HT2*CMAX -> (pm'=X22); + + [tick1] qL*10 > LT2*CMAX & qL*10 <= LT3*CMAX & q*10 > HT1*CMAX & q*10 <= HT2*CMAX -> (pm'=X32); + + [tick1] qL*10 > LT3*CMAX & q*10 > HT1*CMAX & q*10 <= HT2*CMAX -> (pm'=X42); + + [tick1] qL*10 <= LT1*CMAX & q*10 > HT2*CMAX & q*10 <= HT3*CMAX -> (pm'=X13); + + [tick1] qL*10 > LT1*CMAX & qL*10 <= LT2*CMAX & q*10 > HT2*CMAX & q*10 <= HT3*CMAX -> (pm'=X23); + + [tick1] qL*10 > LT2*CMAX & qL*10 <= LT3*CMAX & q*10 > HT2*CMAX & q*10 <= HT3*CMAX -> (pm'=X33); + + [tick1] qL*10 > LT3*CMAX & q*10 > HT2*CMAX & q*10 <= HT3*CMAX -> (pm'=X43); + + [tick1] qL*10 <= LT1*CMAX & q*10 > HT3*CMAX -> (pm'=X14); + + [tick1] qL*10 > LT1*CMAX & qL*10 <= LT2*CMAX & q*10 > HT3*CMAX -> (pm'=X24); + + [tick1] qL*10 > LT2*CMAX & qL*10 <= LT3*CMAX & q*10 > HT3*CMAX -> (pm'=X34); + + [tick1] qL*10 > LT3*CMAX & q*10 > HT3*CMAX -> (pm'=X44); + +endmodule + +// SERVICE PROVIDER + +module SP + + sp : [0..8] init 3; + // 0 active + // 1 active for LOW + // 2 idle + // 3 sleep + + // 4 active_both_to_sleep + // 5 idle_to_sleep + + // 6 sleep_to_idle + // 7 sleep_to_active + // 8 sleep_to_active_L + + // states where PM has no control (transient states) + + [tick2] sp=4 -> 0.9 : (sp'=4) + 0.1 : (sp'=3); + [tick2] sp=5 -> 0.9 : (sp'=5) + 0.1 : (sp'=3); + + [tick2] sp=6 -> 0.9 : (sp'=6) + 0.1 : (sp'=2); + + [tick2] sp=7 -> 0.9 : (sp'=7) + 0.1 : (sp'=0); + [tick2] sp=8 -> 0.9 : (sp'=8) + 0.1 : (sp'=1); + + + // states where PM has control + // goto_active + [tick2] sp=0 & pm=0 -> (sp'=0); // from active + [tick2] sp=1 & pm=0 -> (sp'=0); // from activeL + [tick2] sp=2 & pm=0 -> (sp'=0); // from idle + [tick2] sp=3 & pm=0 -> (sp'=7); // from sleep + + + // goto_active_L + [tick2] sp=0 & pm=1 -> (sp'=1); // from active + [tick2] sp=1 & pm=1 -> (sp'=1); // from activeL + [tick2] sp=2 & pm=1 -> (sp'=1); // from idle + [tick2] sp=3 & pm=1 -> (sp'=8); // from sleep + + // goto_idle + [tick2] sp=0 & pm=2 -> (sp'=2); // from active + [tick2] sp=1 & pm=2 -> (sp'=2); // from active_L + [tick2] sp=2 & pm=2 -> (sp'=2); // from idle + [tick2] sp=3 & pm=2 -> (sp'=6); // from sleep + + // goto_sleep + [tick2] sp=0 & pm=3 -> (sp'=4); // from active + [tick2] sp=1 & pm=3 -> (sp'=4); // from active_L + [tick2] sp=2 & pm=3 -> (sp'=5); // idle + [tick2] sp=3 & pm=3 -> (sp'=3); // sleep + +endmodule + + +// SERVICE REQUESTER +module SR + + //a two-queue varinat + + sr : [0..2] init 0; // 0 - idle, 1 - Hreq, 2-Lreq + + [tick2] sr=0 -> 0.898: (sr'=0) + 0.051: (sr'=1) + 0.051: (sr'=2); + [tick2] sr=1 -> 0.254: (sr'=0) + 0.373: (sr'=1) + 0.373: (sr'=2); + [tick2] sr=2 -> 0.254: (sr'=0) + 0.373: (sr'=1) + 0.373: (sr'=2); + +endmodule + + +// SERVICE REQUEST QUEUES +module SRQ + + q : [0..CMAX] init 0; + qL : [0..CMAX] init 0; + + [tick2] sr=0 & sp!=0 & sp!=1 -> true; // do not serve and nothing arrives + + [tick2] sr=1 & sp!=0 & sp!=1 -> (q'=min(q+1,CMAX)); // do not serve and a request arrives + [tick2] sr=2 & sp!=0 & sp!=1 -> (qL'=min(qL+1,CMAX)); // do not serve and a request arrives + + [tick2] sr=0 & sp=0 -> (q'=max(q-1,0)); // serve and nothing arrives + [tick2] sr=0 & sp=1 -> (qL'=max(qL-1,0)); // serve and nothing arrives + + // serve and a request arrives arrives -- it actually performs two actions + [tick2] sr=2 & sp=0 -> (q'=max(q-1,0)) & (qL'=min(qL+1,CMAX)); + [tick2] sr=1 & sp=1 -> (qL'=max(qL-1,0)) & (q'=min(q+1,CMAX)); + + [tick2] sr=1 & sp=0 -> true; + [tick2] sr=2 & sp=1 -> true; + +endmodule + + + + + +// BATTERY +module BAT + + bat : [0..1] init 1; // 0 empty, 1 - operational + + [] bat=0 -> (bat'=0); // loop when battery empty + + [tick2] bat=1 -> 0.001 : (bat'=0) + 0.999 : (bat'=1); + +endmodule + +// queue size +rewards "queueH" + + c=1 : q; + +endrewards + +rewards "queueL" + + c=1 : qL; + +endrewards + +// customers lost +rewards "lostH" + + [tick2] q=CMAX & sr=1 & sp!=0 : 1; + +endrewards + +rewards "lostL" + + [tick2] qL=CMAX & sr=2 & sp!=1 : 1; + +endrewards + +rewards "lost" + + [tick2] q=CMAX & sr=1 & sp!=0 : 1; + [tick2] qL=CMAX & sr=2 & sp!=1 : 1; + +endrewards + + +// power consumption +rewards "power" + +// in contrasr to the PRISM model we assume that the transient states have the power consuption +// equal to the source state + + sp=1 & c=1 : 2.5; + sp=0 & c=1 : 2.5; + sp=4 & c=1 : 2.5; + + sp=2 & c=1 : 1.5; + sp=5 & c=1 : 1.5; + + sp=3 & c=1 : 0.1; + sp=6 & c=1 : 0.1; + sp=7 & c=1 : 0.1; + sp=8 & c=1 : 0.1; + +endrewards + +// time +rewards "time" + + [tick2] true : 1; + +endrewards + +label "finished" = bat = 0; \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.props b/models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.templ b/models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.templ new file mode 100644 index 000000000..1b5c01ceb --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-1fsc/sketch.templ @@ -0,0 +1,169 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0; + +// agent 1 holes + +hole int P1_0__0_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_1 in {1,2,3,4,5}; +hole int P1_0__1_1_0_1 in {1,2,3,4,5}; +hole int P1_0__1_1_1_0 in {1,2,3,4,5}; +hole int P1_0__1_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P1_1__1_0_1_1 in {1,2,3,4,5}; +hole int P1_1__1_1_1_0 in {1,2,3,4,5}; +hole int P1_1__1_1_1_1 in {1,2,3,4,5}; + +// agent 2 holes + +hole int P2_0__0_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_1 in {1,2,3,4,5}; +hole int P2_0__1_1_0_1 in {1,2,3,4,5}; +hole int P2_0__1_1_1_0 in {1,2,3,4,5}; +hole int P2_0__1_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P2_1__1_0_1_1 in {1,2,3,4,5}; +hole int P2_1__1_1_1_0 in {1,2,3,4,5}; +hole int P2_1__1_1_1_1 in {1,2,3,4,5}; + + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=5 -> true; + + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=5 -> true; + + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=5 -> true; + + [move] !r1 & !l1 & P1_0__1_0_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=5 -> true; + + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=5 -> true; + + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=5 -> true; + +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=5 -> true; + + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=5 -> true; + + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=5 -> true; + + [move] !r2 & !l2 & P2_0__1_0_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=5 -> true; + + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=5 -> true; + + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=5 -> true; + +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.props b/models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.templ b/models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.templ new file mode 100644 index 000000000..e98b86378 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-2fsc/sketch.templ @@ -0,0 +1,264 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0; + +// agent 1 holes +hole int M1_0__0_1_1_1 in {0,1}; +hole int M1_0__1_0_1_1 in {0,1}; +hole int M1_0__1_1_0_1 in {0,1}; +hole int M1_0__1_1_1_0 in {0,1}; +hole int M1_0__1_1_1_1 in {0,1}; +hole int M1_0__1_0_1_0 in {0,1}; + +hole int M1_1__1_0_1_1 in {0,1}; +hole int M1_1__1_1_1_0 in {0,1}; +hole int M1_1__1_1_1_1 in {0,1}; + +hole int P1_0__0_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_1 in {1,2,3,4,5}; +hole int P1_0__1_1_0_1 in {1,2,3,4,5}; +hole int P1_0__1_1_1_0 in {1,2,3,4,5}; +hole int P1_0__1_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P1_1__1_0_1_1 in {1,2,3,4,5}; +hole int P1_1__1_1_1_0 in {1,2,3,4,5}; +hole int P1_1__1_1_1_1 in {1,2,3,4,5}; + +// agent 2 holes +hole int M2_0__0_1_1_1 in {0,1}; +hole int M2_0__1_0_1_1 in {0,1}; +hole int M2_0__1_1_0_1 in {0,1}; +hole int M2_0__1_1_1_0 in {0,1}; +hole int M2_0__1_1_1_1 in {0,1}; +hole int M2_0__1_0_1_0 in {0,1}; + +hole int M2_1__1_0_1_1 in {0,1}; +hole int M2_1__1_1_1_0 in {0,1}; +hole int M2_1__1_1_1_1 in {0,1}; + +hole int P2_0__0_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_1 in {1,2,3,4,5}; +hole int P2_0__1_1_0_1 in {1,2,3,4,5}; +hole int P2_0__1_1_1_0 in {1,2,3,4,5}; +hole int P2_0__1_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P2_1__1_0_1_1 in {1,2,3,4,5}; +hole int P2_1__1_1_1_0 in {1,2,3,4,5}; +hole int P2_1__1_1_1_1 in {1,2,3,4,5}; + + +module strategy1 + mem1 : [0..1] init 0; + + [move] mem1=0 & u1 & !r1 & l1 -> (mem1'=M1_0__1_0_1_1); + [move] mem1=0 & u1 & r1 & d1 & l1 -> (mem1'=M1_0__1_1_1_1); + [move] !u1 & r1 & l1 -> (mem1'=M1_0__0_1_1_1); + [move] !r1 & !l1 -> (mem1'=M1_0__1_0_1_0); + [move] mem1=0 & u1 & r1 & d1 & !l1 -> (mem1'=M1_0__1_1_1_0); + [move] u1 & r1 & !d1 & l1 -> (mem1'=M1_0__1_1_0_1); + + [move] mem1=1 & u1 & !r1 & l1 -> (mem1'=M1_1__1_0_1_1); + [move] mem1=1 & u1 & r1 & d1 & l1 -> (mem1'=M1_1__1_1_1_1); + [move] mem1=1 & u1 & r1 & d1 & !l1 -> (mem1'=M1_1__1_1_1_0); + + +endmodule + + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=5 -> true; + + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=5 -> true; + + [move] !r1 & !l1 & P1_0__1_0_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=5 -> true; + + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=5 -> true; + + + + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=5 -> true; + +endmodule + + +module strategy2 + mem2 : [0..1] init 0; + + [move] mem2=0 & u2 & !r2 & l2 -> (mem2'=M2_0__1_0_1_1); + [move] mem2=0 & u2 & r2 & d2 & l2 -> (mem2'=M2_0__1_1_1_1); + [move] !u2 & r2 & l2 -> (mem2'=M2_0__0_1_1_1); + [move] !r2 & !l2 -> (mem2'=M2_0__1_0_1_0); + [move] mem2=0 & u2 & r2 & d2 & !l2 -> (mem2'=M2_0__1_1_1_0); + [move] u2 & r2 & !d2 & l2 -> (mem2'=M2_0__1_1_0_1); + + [move] mem2=1 & u2 & !r2 & l2 -> (mem2'=M2_1__1_0_1_1); + [move] mem2=1 & u2 & r2 & d2 & l2 -> (mem2'=M2_1__1_1_1_1); + [move] mem2=1 & u2 & r2 & d2 & !l2 -> (mem2'=M2_1__1_1_1_0); + +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=5 -> true; + + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=5 -> true; + + [move] !r2 & !l2 & P2_0__1_0_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=5 -> true; + + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=5 -> true; + + + + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=5 -> true; + +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.props b/models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.templ b/models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.templ new file mode 100644 index 000000000..999b9fc92 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-3fsc/sketch.templ @@ -0,0 +1,327 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0; + +// agent 1 holes +hole int M1_0__0_1_1_1 in {0,1,2}; +hole int M1_0__1_0_1_1 in {0,1,2}; +hole int M1_0__1_1_0_1 in {0,1,2}; +hole int M1_0__1_1_1_0 in {0,1,2}; +hole int M1_0__1_1_1_1 in {0,1,2}; +hole int M1_0__1_0_1_0 in {0,1,2}; + +hole int M1_1__1_0_1_1 in {0,1,2}; +hole int M1_1__1_1_1_0 in {0,1,2}; +hole int M1_1__1_1_1_1 in {0,1,2}; + +hole int M1_2__1_0_1_1 in {0,1,2}; +hole int M1_2__1_1_1_0 in {0,1,2}; +hole int M1_2__1_1_1_1 in {0,1,2}; + +hole int P1_0__0_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_1 in {1,2,3,4,5}; +hole int P1_0__1_1_0_1 in {1,2,3,4,5}; +hole int P1_0__1_1_1_0 in {1,2,3,4,5}; +hole int P1_0__1_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P1_1__1_0_1_1 in {1,2,3,4,5}; +hole int P1_1__1_1_1_0 in {1,2,3,4,5}; +hole int P1_1__1_1_1_1 in {1,2,3,4,5}; + +hole int P1_2__1_0_1_1 in {1,2,3,4,5}; +hole int P1_2__1_1_1_0 in {1,2,3,4,5}; +hole int P1_2__1_1_1_1 in {1,2,3,4,5}; + +// agent 2 holes +hole int M2_0__0_1_1_1 in {0,1,2}; +hole int M2_0__1_0_1_1 in {0,1,2}; +hole int M2_0__1_1_0_1 in {0,1,2}; +hole int M2_0__1_1_1_0 in {0,1,2}; +hole int M2_0__1_1_1_1 in {0,1,2}; +hole int M2_0__1_0_1_0 in {0,1,2}; + +hole int M2_1__1_0_1_1 in {0,1,2}; +hole int M2_1__1_1_1_0 in {0,1,2}; +hole int M2_1__1_1_1_1 in {0,1,2}; + +hole int M2_2__1_0_1_1 in {0,1,2}; +hole int M2_2__1_1_1_0 in {0,1,2}; +hole int M2_2__1_1_1_1 in {0,1,2}; + +hole int P2_0__0_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_1 in {1,2,3,4,5}; +hole int P2_0__1_1_0_1 in {1,2,3,4,5}; +hole int P2_0__1_1_1_0 in {1,2,3,4,5}; +hole int P2_0__1_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P2_1__1_0_1_1 in {1,2,3,4,5}; +hole int P2_1__1_1_1_0 in {1,2,3,4,5}; +hole int P2_1__1_1_1_1 in {1,2,3,4,5}; + +hole int P2_2__1_0_1_1 in {1,2,3,4,5}; +hole int P2_2__1_1_1_0 in {1,2,3,4,5}; +hole int P2_2__1_1_1_1 in {1,2,3,4,5}; + + +module strategy1 + mem1 : [0..2] init 0; + + [move] mem1=0 & u1 & !r1 & l1 -> (mem1'=M1_0__1_0_1_1); + [move] mem1=0 & u1 & r1 & d1 & l1 -> (mem1'=M1_0__1_1_1_1); + [move] !u1 & r1 & l1 -> (mem1'=M1_0__0_1_1_1); + [move] !r1 & !l1 -> (mem1'=M1_0__1_0_1_0); + [move] mem1=0 & u1 & r1 & d1 & !l1 -> (mem1'=M1_0__1_1_1_0); + [move] u1 & r1 & !d1 & l1 -> (mem1'=M1_0__1_1_0_1); + + [move] mem1=1 & u1 & !r1 & l1 -> (mem1'=M1_1__1_0_1_1); + [move] mem1=1 & u1 & r1 & d1 & l1 -> (mem1'=M1_1__1_1_1_1); + [move] mem1=1 & u1 & r1 & d1 & !l1 -> (mem1'=M1_1__1_1_1_0); + + [move] mem1=2 & u1 & !r1 & l1 -> (mem1'=M1_2__1_0_1_1); + [move] mem1=2 & u1 & r1 & d1 & l1 -> (mem1'=M1_2__1_1_1_1); + [move] mem1=2 & u1 & r1 & d1 & !l1 -> (mem1'=M1_2__1_1_1_0); + + +endmodule + + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=5 -> true; + + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=5 -> true; + + [move] !r1 & !l1 & P1_0__1_0_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=5 -> true; + + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=5 -> true; + + + + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=5 -> true; + + + + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=5 -> true; + + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=5 -> true; + + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=5 -> true; + +endmodule + + +module strategy2 + mem2 : [0..2] init 0; + + [move] mem2=0 & u2 & !r2 & l2 -> (mem2'=M2_0__1_0_1_1); + [move] mem2=0 & u2 & r2 & d2 & l2 -> (mem2'=M2_0__1_1_1_1); + [move] !u2 & r2 & l2 -> (mem2'=M2_0__0_1_1_1); + [move] !r2 & !l2 -> (mem2'=M2_0__1_0_1_0); + [move] mem2=0 & u2 & r2 & d2 & !l2 -> (mem2'=M2_0__1_1_1_0); + [move] u2 & r2 & !d2 & l2 -> (mem2'=M2_0__1_1_0_1); + + [move] mem2=1 & u2 & !r2 & l2 -> (mem2'=M2_1__1_0_1_1); + [move] mem2=1 & u2 & r2 & d2 & l2 -> (mem2'=M2_1__1_1_1_1); + [move] mem2=1 & u2 & r2 & d2 & !l2 -> (mem2'=M2_1__1_1_1_0); + + [move] mem2=2 & u2 & !r2 & l2 -> (mem2'=M2_2__1_0_1_1); + [move] mem2=2 & u2 & r2 & d2 & l2 -> (mem2'=M2_2__1_1_1_1); + [move] mem2=2 & u2 & r2 & d2 & !l2 -> (mem2'=M2_2__1_1_1_0); + +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=5 -> true; + + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=5 -> true; + + [move] !r2 & !l2 & P2_0__1_0_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=5 -> true; + + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=5 -> true; + + + + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=5 -> true; + + + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=5 -> true; + + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=5 -> true; + + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=5 -> true; + +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.props b/models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.templ b/models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.templ new file mode 100644 index 000000000..e33e08ceb --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-sl-1fsc/sketch.templ @@ -0,0 +1,169 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes + +hole int P1_0__0_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_1 in {1,2,3,4,5}; +hole int P1_0__1_1_0_1 in {1,2,3,4,5}; +hole int P1_0__1_1_1_0 in {1,2,3,4,5}; +hole int P1_0__1_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P1_1__1_0_1_1 in {1,2,3,4,5}; +hole int P1_1__1_1_1_0 in {1,2,3,4,5}; +hole int P1_1__1_1_1_1 in {1,2,3,4,5}; + +// agent 2 holes + +hole int P2_0__0_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_1 in {1,2,3,4,5}; +hole int P2_0__1_1_0_1 in {1,2,3,4,5}; +hole int P2_0__1_1_1_0 in {1,2,3,4,5}; +hole int P2_0__1_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P2_1__1_0_1_1 in {1,2,3,4,5}; +hole int P2_1__1_1_1_0 in {1,2,3,4,5}; +hole int P2_1__1_1_1_1 in {1,2,3,4,5}; + + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & !r1 & l1 & P1_0__1_0_1_1=5 -> true; + + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & d1 & l1 & P1_0__1_1_1_1=5 -> true; + + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=5 -> true; + + [move] !r1 & !l1 & P1_0__1_0_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=5 -> true; + + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=5 -> true; + + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=5 -> true; + +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & !r2 & l2 & P2_0__1_0_1_1=5 -> true; + + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & d2 & l2 & P2_0__1_1_1_1=5 -> true; + + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=5 -> true; + + [move] !r2 & !l2 & P2_0__1_0_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=5 -> true; + + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=5 -> true; + + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=5 -> true; + +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.props b/models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.templ b/models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.templ new file mode 100644 index 000000000..fd6109618 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-sl-2fsc/sketch.templ @@ -0,0 +1,264 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes +hole int M1_0__0_1_1_1 in {0,1}; +hole int M1_0__1_0_1_1 in {0,1}; +hole int M1_0__1_1_0_1 in {0,1}; +hole int M1_0__1_1_1_0 in {0,1}; +hole int M1_0__1_1_1_1 in {0,1}; +hole int M1_0__1_0_1_0 in {0,1}; + +hole int M1_1__1_0_1_1 in {0,1}; +hole int M1_1__1_1_1_0 in {0,1}; +hole int M1_1__1_1_1_1 in {0,1}; + +hole int P1_0__0_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_1 in {1,2,3,4,5}; +hole int P1_0__1_1_0_1 in {1,2,3,4,5}; +hole int P1_0__1_1_1_0 in {1,2,3,4,5}; +hole int P1_0__1_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P1_1__1_0_1_1 in {1,2,3,4,5}; +hole int P1_1__1_1_1_0 in {1,2,3,4,5}; +hole int P1_1__1_1_1_1 in {1,2,3,4,5}; + +// agent 2 holes +hole int M2_0__0_1_1_1 in {0,1}; +hole int M2_0__1_0_1_1 in {0,1}; +hole int M2_0__1_1_0_1 in {0,1}; +hole int M2_0__1_1_1_0 in {0,1}; +hole int M2_0__1_1_1_1 in {0,1}; +hole int M2_0__1_0_1_0 in {0,1}; + +hole int M2_1__1_0_1_1 in {0,1}; +hole int M2_1__1_1_1_0 in {0,1}; +hole int M2_1__1_1_1_1 in {0,1}; + +hole int P2_0__0_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_1 in {1,2,3,4,5}; +hole int P2_0__1_1_0_1 in {1,2,3,4,5}; +hole int P2_0__1_1_1_0 in {1,2,3,4,5}; +hole int P2_0__1_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P2_1__1_0_1_1 in {1,2,3,4,5}; +hole int P2_1__1_1_1_0 in {1,2,3,4,5}; +hole int P2_1__1_1_1_1 in {1,2,3,4,5}; + + +module strategy1 + mem1 : [0..1] init 0; + + [move] mem1=0 & u1 & !r1 & l1 -> (mem1'=M1_0__1_0_1_1); + [move] mem1=0 & u1 & r1 & d1 & l1 -> (mem1'=M1_0__1_1_1_1); + [move] !u1 & r1 & l1 -> (mem1'=M1_0__0_1_1_1); + [move] !r1 & !l1 -> (mem1'=M1_0__1_0_1_0); + [move] mem1=0 & u1 & r1 & d1 & !l1 -> (mem1'=M1_0__1_1_1_0); + [move] u1 & r1 & !d1 & l1 -> (mem1'=M1_0__1_1_0_1); + + [move] mem1=1 & u1 & !r1 & l1 -> (mem1'=M1_1__1_0_1_1); + [move] mem1=1 & u1 & r1 & d1 & l1 -> (mem1'=M1_1__1_1_1_1); + [move] mem1=1 & u1 & r1 & d1 & !l1 -> (mem1'=M1_1__1_1_1_0); + + +endmodule + + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=5 -> true; + + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=5 -> true; + + [move] !r1 & !l1 & P1_0__1_0_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=5 -> true; + + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=5 -> true; + + + + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=5 -> true; + +endmodule + + +module strategy2 + mem2 : [0..1] init 0; + + [move] mem2=0 & u2 & !r2 & l2 -> (mem2'=M2_0__1_0_1_1); + [move] mem2=0 & u2 & r2 & d2 & l2 -> (mem2'=M2_0__1_1_1_1); + [move] !u2 & r2 & l2 -> (mem2'=M2_0__0_1_1_1); + [move] !r2 & !l2 -> (mem2'=M2_0__1_0_1_0); + [move] mem2=0 & u2 & r2 & d2 & !l2 -> (mem2'=M2_0__1_1_1_0); + [move] u2 & r2 & !d2 & l2 -> (mem2'=M2_0__1_1_0_1); + + [move] mem2=1 & u2 & !r2 & l2 -> (mem2'=M2_1__1_0_1_1); + [move] mem2=1 & u2 & r2 & d2 & l2 -> (mem2'=M2_1__1_1_1_1); + [move] mem2=1 & u2 & r2 & d2 & !l2 -> (mem2'=M2_1__1_1_1_0); + +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=5 -> true; + + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=5 -> true; + + [move] !r2 & !l2 & P2_0__1_0_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=5 -> true; + + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=5 -> true; + + + + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=5 -> true; + +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.props b/models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.templ b/models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.templ new file mode 100644 index 000000000..659c03648 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-all-obs-sl-3fsc/sketch.templ @@ -0,0 +1,327 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes +hole int M1_0__0_1_1_1 in {0,1,2}; +hole int M1_0__1_0_1_1 in {0,1,2}; +hole int M1_0__1_1_0_1 in {0,1,2}; +hole int M1_0__1_1_1_0 in {0,1,2}; +hole int M1_0__1_1_1_1 in {0,1,2}; +hole int M1_0__1_0_1_0 in {0,1,2}; + +hole int M1_1__1_0_1_1 in {0,1,2}; +hole int M1_1__1_1_1_0 in {0,1,2}; +hole int M1_1__1_1_1_1 in {0,1,2}; + +hole int M1_2__1_0_1_1 in {0,1,2}; +hole int M1_2__1_1_1_0 in {0,1,2}; +hole int M1_2__1_1_1_1 in {0,1,2}; + +hole int P1_0__0_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_1 in {1,2,3,4,5}; +hole int P1_0__1_1_0_1 in {1,2,3,4,5}; +hole int P1_0__1_1_1_0 in {1,2,3,4,5}; +hole int P1_0__1_1_1_1 in {1,2,3,4,5}; +hole int P1_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P1_1__1_0_1_1 in {1,2,3,4,5}; +hole int P1_1__1_1_1_0 in {1,2,3,4,5}; +hole int P1_1__1_1_1_1 in {1,2,3,4,5}; + +hole int P1_2__1_0_1_1 in {1,2,3,4,5}; +hole int P1_2__1_1_1_0 in {1,2,3,4,5}; +hole int P1_2__1_1_1_1 in {1,2,3,4,5}; + +// agent 2 holes +hole int M2_0__0_1_1_1 in {0,1,2}; +hole int M2_0__1_0_1_1 in {0,1,2}; +hole int M2_0__1_1_0_1 in {0,1,2}; +hole int M2_0__1_1_1_0 in {0,1,2}; +hole int M2_0__1_1_1_1 in {0,1,2}; +hole int M2_0__1_0_1_0 in {0,1,2}; + +hole int M2_1__1_0_1_1 in {0,1,2}; +hole int M2_1__1_1_1_0 in {0,1,2}; +hole int M2_1__1_1_1_1 in {0,1,2}; + +hole int M2_2__1_0_1_1 in {0,1,2}; +hole int M2_2__1_1_1_0 in {0,1,2}; +hole int M2_2__1_1_1_1 in {0,1,2}; + +hole int P2_0__0_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_1 in {1,2,3,4,5}; +hole int P2_0__1_1_0_1 in {1,2,3,4,5}; +hole int P2_0__1_1_1_0 in {1,2,3,4,5}; +hole int P2_0__1_1_1_1 in {1,2,3,4,5}; +hole int P2_0__1_0_1_0 in {1,2,3,4,5}; + +hole int P2_1__1_0_1_1 in {1,2,3,4,5}; +hole int P2_1__1_1_1_0 in {1,2,3,4,5}; +hole int P2_1__1_1_1_1 in {1,2,3,4,5}; + +hole int P2_2__1_0_1_1 in {1,2,3,4,5}; +hole int P2_2__1_1_1_0 in {1,2,3,4,5}; +hole int P2_2__1_1_1_1 in {1,2,3,4,5}; + + +module strategy1 + mem1 : [0..2] init 0; + + [move] mem1=0 & u1 & !r1 & l1 -> (mem1'=M1_0__1_0_1_1); + [move] mem1=0 & u1 & r1 & d1 & l1 -> (mem1'=M1_0__1_1_1_1); + [move] !u1 & r1 & l1 -> (mem1'=M1_0__0_1_1_1); + [move] !r1 & !l1 -> (mem1'=M1_0__1_0_1_0); + [move] mem1=0 & u1 & r1 & d1 & !l1 -> (mem1'=M1_0__1_1_1_0); + [move] u1 & r1 & !d1 & l1 -> (mem1'=M1_0__1_1_0_1); + + [move] mem1=1 & u1 & !r1 & l1 -> (mem1'=M1_1__1_0_1_1); + [move] mem1=1 & u1 & r1 & d1 & l1 -> (mem1'=M1_1__1_1_1_1); + [move] mem1=1 & u1 & r1 & d1 & !l1 -> (mem1'=M1_1__1_1_1_0); + + [move] mem1=2 & u1 & !r1 & l1 -> (mem1'=M1_2__1_0_1_1); + [move] mem1=2 & u1 & r1 & d1 & l1 -> (mem1'=M1_2__1_1_1_1); + [move] mem1=2 & u1 & r1 & d1 & !l1 -> (mem1'=M1_2__1_1_1_0); + + +endmodule + + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & !r1 & l1 & P1_0__1_0_1_1=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & l1 & P1_0__1_1_1_1=5 -> true; + + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !u1 & r1 & l1 & P1_0__0_1_1_1=5 -> true; + + [move] !r1 & !l1 & P1_0__1_0_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] !r1 & !l1 & P1_0__1_0_1_0=5 -> true; + + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=0 & u1 & r1 & d1 & !l1 & P1_0__1_1_1_0=5 -> true; + + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] u1 & r1 & !d1 & l1 & P1_0__1_1_0_1=5 -> true; + + + + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & !r1 & l1 & P1_1__1_0_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & l1 & P1_1__1_1_1_1=5 -> true; + + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=1 & u1 & r1 & d1 & !l1 & P1_1__1_1_1_0=5 -> true; + + + + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=2 & u1 & !r1 & l1 & P1_2__1_0_1_1=5 -> true; + + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & l1 & P1_2__1_1_1_1=5 -> true; + + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] mem1=2 & u1 & r1 & d1 & !l1 & P1_2__1_1_1_0=5 -> true; + +endmodule + + +module strategy2 + mem2 : [0..2] init 0; + + [move] mem2=0 & u2 & !r2 & l2 -> (mem2'=M2_0__1_0_1_1); + [move] mem2=0 & u2 & r2 & d2 & l2 -> (mem2'=M2_0__1_1_1_1); + [move] !u2 & r2 & l2 -> (mem2'=M2_0__0_1_1_1); + [move] !r2 & !l2 -> (mem2'=M2_0__1_0_1_0); + [move] mem2=0 & u2 & r2 & d2 & !l2 -> (mem2'=M2_0__1_1_1_0); + [move] u2 & r2 & !d2 & l2 -> (mem2'=M2_0__1_1_0_1); + + [move] mem2=1 & u2 & !r2 & l2 -> (mem2'=M2_1__1_0_1_1); + [move] mem2=1 & u2 & r2 & d2 & l2 -> (mem2'=M2_1__1_1_1_1); + [move] mem2=1 & u2 & r2 & d2 & !l2 -> (mem2'=M2_1__1_1_1_0); + + [move] mem2=2 & u2 & !r2 & l2 -> (mem2'=M2_2__1_0_1_1); + [move] mem2=2 & u2 & r2 & d2 & l2 -> (mem2'=M2_2__1_1_1_1); + [move] mem2=2 & u2 & r2 & d2 & !l2 -> (mem2'=M2_2__1_1_1_0); + +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & !r2 & l2 & P2_0__1_0_1_1=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & l2 & P2_0__1_1_1_1=5 -> true; + + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !u2 & r2 & l2 & P2_0__0_1_1_1=5 -> true; + + [move] !r2 & !l2 & P2_0__1_0_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] !r2 & !l2 & P2_0__1_0_1_0=5 -> true; + + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=0 & u2 & r2 & d2 & !l2 & P2_0__1_1_1_0=5 -> true; + + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] u2 & r2 & !d2 & l2 & P2_0__1_1_0_1=5 -> true; + + + + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & !r2 & l2 & P2_1__1_0_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & l2 & P2_1__1_1_1_1=5 -> true; + + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=1 & u2 & r2 & d2 & !l2 & P2_1__1_1_1_0=5 -> true; + + + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=2 & u2 & !r2 & l2 & P2_2__1_0_1_1=5 -> true; + + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & l2 & P2_2__1_1_1_1=5 -> true; + + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] mem2=2 & u2 & r2 & d2 & !l2 & P2_2__1_1_1_0=5 -> true; + +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-sl-1fsc/sketch.props b/models/tac24/case-studies/grid-meet-sl-1fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-1fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-sl-1fsc/sketch.templ b/models/tac24/case-studies/grid-meet-sl-1fsc/sketch.templ new file mode 100644 index 000000000..f0fdf5173 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-1fsc/sketch.templ @@ -0,0 +1,98 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes +hole int P1_0_1 in {1,2,3,4}; +hole int P1_0_0 in {1,2,3,4}; + +// agent 2 holes +hole int P2_0_1 in {1,2,3,4}; +hole int P2_0_0 in {1,2,3,4}; + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] r1 & P1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] r1 & P1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] r1 & P1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] r1 & P1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] !r1 & P1_0_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] !r1 & P1_0_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] !r1 & P1_0_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] !r1 & P1_0_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] l2 & P2_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] l2 & P2_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] l2 & P2_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] l2 & P2_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] !l2 & P2_0_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] !l2 & P2_0_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] !l2 & P2_0_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] !l2 & P2_0_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.props b/models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.props new file mode 100644 index 000000000..cd5b6d078 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.props @@ -0,0 +1 @@ +Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.templ b/models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.templ new file mode 100644 index 000000000..929795e8f --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-2fsc-res/sketch.templ @@ -0,0 +1,144 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x x x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x x x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes +hole int M1_0_1 in {0}; +hole int M1_0_0 in {1}; +hole int M1_1_1 in {1}; +hole int M1_1_0 in {1}; +hole int P1_0_1 in {2}; +hole int P1_0_0 in {3}; +hole int P1_1_1 in {2}; +hole int P1_1_0 in {1}; + +// agent 2 holes +hole int M2_0_1 in {0,1}; +hole int M2_0_0 in {0,1}; +hole int M2_1_1 in {0,1}; +hole int M2_1_0 in {0,1}; +hole int P2_0_1 in {1,2,3,4}; +hole int P2_0_0 in {1,2,3,4}; +hole int P2_1_1 in {1,2,3,4}; +hole int P2_1_0 in {1,2,3,4}; + +module strategy1 + pick : [0..5] init 0; + mem : [0..1] init 0; + + [p] pick = 0 & mem = 0 & r1 -> (mem'=M1_0_1) & (pick'=P1_0_1); + [p] pick = 0 & mem = 0 & !r1 -> (mem'=M1_0_0) & (pick'=P1_0_0); + [p] pick = 0 & mem = 1 & r1 -> (mem'=M1_1_1) & (pick'=P1_1_1); + [p] pick = 0 & mem = 1 & !r1 -> (mem'=M1_1_0) & (pick'=P1_1_0); + + [up1] pick=1 -> (pick'=5); + [right1] pick=2 -> (pick'=5); + [down1] pick=3 -> (pick'=5); + [left1] pick=4 -> (pick'=5); + + [r] pick=5 -> (pick'=0); +endmodule + + +module strategy2 + pick2 : [0..5] init 0; + mem2 : [0..1] init 0; + + [p] pick2 = 0 & mem2 = 0 & l2 -> (mem2'=M2_0_1) & (pick2'=P2_0_1); + [p] pick2 = 0 & mem2 = 0 & !l2 -> (mem2'=M2_0_0) & (pick2'=P2_0_0); + [p] pick2 = 0 & mem2 = 1 & l2 -> (mem2'=M2_1_1) & (pick2'=P2_1_1); + [p] pick2 = 0 & mem2 = 1 & !l2 -> (mem2'=M2_1_0) & (pick2'=P2_1_0); + + [up2] pick2=1 -> (pick2'=5); + [right2] pick2=2 -> (pick2'=5); + [down2] pick2=3 -> (pick2'=5); + [left2] pick2=4 -> (pick2'=5); + + [r] pick2=5 -> (pick2'=0); +endmodule + + + + +module grid + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + + [up1] true -> 1-sl: (ya1'=y1u) + sl: true; + [right1] true -> 1-sl: (xa1'=x1r) + sl: true; + [down1] true -> 1-sl: (ya1'=y1d) + sl: true; + [left1] true -> 1-sl: (xa1'=x1l) + sl: true; + + [up2] pick=5 -> 1-sl: (ya2'=y2u) + sl: true; + [right2] pick=5 -> 1-sl: (xa2'=x2r) + sl: true; + [down2] pick=5 -> 1-sl: (ya2'=y2d) + sl: true; + [left2] pick=5 -> 1-sl: (xa2'=x2l) + sl: true; + + +endmodule + +// reward +rewards "steps" + [] pick=0 & pick2=0 : 1; +endrewards + + +rewards "moves" + [up1] true : 1; + [right1] true : 1; + [down1] true : 1; + [left1] true : 1; + + [up2] true : 1; + [right2] true : 1; + [down2] true : 1; + [left2] true : 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-sl-2fsc/sketch.props b/models/tac24/case-studies/grid-meet-sl-2fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-2fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-sl-2fsc/sketch.templ b/models/tac24/case-studies/grid-meet-sl-2fsc/sketch.templ new file mode 100644 index 000000000..fa5b39c03 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-2fsc/sketch.templ @@ -0,0 +1,148 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes +hole int M1_0_1 in {0,1}; +hole int M1_0_0 in {0,1}; +hole int M1_1_1 in {0,1}; +hole int M1_1_0 in {0,1}; +hole int P1_0_1 in {1,2,3,4}; +hole int P1_0_0 in {1,2,3,4}; +hole int P1_1_1 in {1,2,3,4}; +hole int P1_1_0 in {1,2,3,4}; + +// agent 2 holes +hole int M2_0_1 in {0,1}; +hole int M2_0_0 in {0,1}; +hole int M2_1_1 in {0,1}; +hole int M2_1_0 in {0,1}; +hole int P2_0_1 in {1,2,3,4}; +hole int P2_0_0 in {1,2,3,4}; +hole int P2_1_1 in {1,2,3,4}; +hole int P2_1_0 in {1,2,3,4}; + +module strategy1 + mem : [0..1] init 0; + + [move] mem=0 & r1 -> (mem'=M1_0_1); + [move] mem=0 & !r1 -> (mem'=M1_0_0); + [move] mem=1 & r1 -> (mem'=M1_1_1); + [move] mem=1 & !r1 -> (mem'=M1_1_0); +endmodule + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] mem=0 & r1 & P1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=0 & r1 & P1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=0 & r1 & P1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=0 & r1 & P1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=0 & !r1 & P1_0_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=0 & !r1 & P1_0_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=0 & !r1 & P1_0_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=0 & !r1 & P1_0_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=1 & r1 & P1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=1 & r1 & P1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=1 & r1 & P1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=1 & r1 & P1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=1 & !r1 & P1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=1 & !r1 & P1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=1 & !r1 & P1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=1 & !r1 & P1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + +endmodule + + +module strategy2 + mem2 : [0..1] init 0; + + [move] mem2=0 & l2 -> (mem2'=M2_0_1); + [move] mem2=0 & !l2 -> (mem2'=M2_0_0); + [move] mem2=1 & l2 -> (mem2'=M2_1_1); + [move] mem2=1 & !l2 -> (mem2'=M2_1_0); +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] mem2=0 & l2 & P2_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & l2 & P2_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & l2 & P2_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & l2 & P2_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=0 & !l2 & P2_0_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=1 & l2 & P2_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & l2 & P2_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & l2 & P2_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & l2 & P2_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=1 & !l2 & P2_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet-sl-3fsc/sketch.props b/models/tac24/case-studies/grid-meet-sl-3fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-3fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet-sl-3fsc/sketch.templ b/models/tac24/case-studies/grid-meet-sl-3fsc/sketch.templ new file mode 100644 index 000000000..990edb9c2 --- /dev/null +++ b/models/tac24/case-studies/grid-meet-sl-3fsc/sketch.templ @@ -0,0 +1,180 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes +hole int M1_0_1 in {0,1,2}; +hole int M1_0_0 in {0,1,2}; +hole int M1_1_1 in {0,1,2}; +hole int M1_1_0 in {0,1,2}; +hole int M1_2_0 in {0,1,2}; +hole int M1_2_1 in {0,1,2}; +hole int P1_0_1 in {1,2,3,4}; +hole int P1_0_0 in {1,2,3,4}; +hole int P1_1_1 in {1,2,3,4}; +hole int P1_1_0 in {1,2,3,4}; +hole int P1_2_1 in {1,2,3,4}; +hole int P1_2_0 in {1,2,3,4}; + +// agent 2 holes +hole int M2_0_1 in {0,1,2}; +hole int M2_0_0 in {0,1,2}; +hole int M2_1_1 in {0,1,2}; +hole int M2_1_0 in {0,1,2}; +hole int M2_2_1 in {0,1,2}; +hole int M2_2_0 in {0,1,2}; +hole int P2_0_1 in {1,2,3,4}; +hole int P2_0_0 in {1,2,3,4}; +hole int P2_1_1 in {1,2,3,4}; +hole int P2_1_0 in {1,2,3,4}; +hole int P2_2_1 in {1,2,3,4}; +hole int P2_2_0 in {1,2,3,4}; + +module strategy1 + mem : [0..2] init 0; + + [move] mem=0 & r1 -> (mem'=M1_0_1); + [move] mem=0 & !r1 -> (mem'=M1_0_0); + [move] mem=1 & r1 -> (mem'=M1_1_1); + [move] mem=1 & !r1 -> (mem'=M1_1_0); + [move] mem=2 & r1 -> (mem'=M1_2_1); + [move] mem=2 & !r1 -> (mem'=M1_2_0); +endmodule + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] mem=0 & r1 & P1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=0 & r1 & P1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=0 & r1 & P1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=0 & r1 & P1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=0 & !r1 & P1_0_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=0 & !r1 & P1_0_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=0 & !r1 & P1_0_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=0 & !r1 & P1_0_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=1 & r1 & P1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=1 & r1 & P1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=1 & r1 & P1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=1 & r1 & P1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=1 & !r1 & P1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=1 & !r1 & P1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=1 & !r1 & P1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=1 & !r1 & P1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=2 & r1 & P1_2_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=2 & r1 & P1_2_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=2 & r1 & P1_2_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=2 & r1 & P1_2_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=2 & !r1 & P1_2_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=2 & !r1 & P1_2_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=2 & !r1 & P1_2_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=2 & !r1 & P1_2_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + +endmodule + + +module strategy2 + mem2 : [0..2] init 0; + + [move] mem2=0 & l2 -> (mem2'=M2_0_1); + [move] mem2=0 & !l2 -> (mem2'=M2_0_0); + [move] mem2=1 & l2 -> (mem2'=M2_1_1); + [move] mem2=1 & !l2 -> (mem2'=M2_1_0); + [move] mem2=2 & l2 -> (mem2'=M2_2_1); + [move] mem2=2 & !l2 -> (mem2'=M2_2_0); +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] mem2=0 & l2 & P2_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & l2 & P2_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & l2 & P2_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & l2 & P2_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=0 & !l2 & P2_0_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=1 & l2 & P2_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & l2 & P2_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & l2 & P2_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & l2 & P2_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=1 & !l2 & P2_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=2 & l2 & P2_2_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & l2 & P2_2_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & l2 & P2_2_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & l2 & P2_2_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=2 & !l2 & P2_2_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=2 & !l2 & P2_2_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=2 & !l2 & P2_2_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=2 & !l2 & P2_2_0=4 -> 1-sl: (xa2'=x2l) + sl: true; +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/grid-meet/sketch.props b/models/tac24/case-studies/grid-meet/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/case-studies/grid-meet/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/case-studies/grid-meet/sketch.templ b/models/tac24/case-studies/grid-meet/sketch.templ new file mode 100644 index 000000000..c2db3672a --- /dev/null +++ b/models/tac24/case-studies/grid-meet/sketch.templ @@ -0,0 +1,129 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0.1; + +// agent 1 holes +hole int M1_0_1 in {0,1}; +hole int M1_0_0 in {0,1}; +hole int M1_1_1 in {0,1}; +hole int M1_1_0 in {0,1}; +hole int P1_0_1 in {1,2,3,4}; +hole int P1_0_0 in {1,2,3,4}; +hole int P1_1_1 in {1,2,3,4}; +hole int P1_1_0 in {1,2,3,4}; + +// agent 2 holes +hole int M2_0_1 in {0,1}; +hole int M2_0_0 in {0,1}; +hole int M2_1_1 in {0,1}; +hole int M2_1_0 in {0,1}; +hole int P2_0_1 in {1,2,3,4}; +hole int P2_0_0 in {1,2,3,4}; +hole int P2_1_1 in {1,2,3,4}; +hole int P2_1_0 in {1,2,3,4}; + +module strategy1 + pick : [0..5] init 0; + mem : [0..1] init 0; + + [p] pick = 0 & mem = 0 & r1 -> (mem'=M1_0_1) & (pick'=P1_0_1); + [p] pick = 0 & mem = 0 & !r1 -> (mem'=M1_0_0) & (pick'=P1_0_0); + [p] pick = 0 & mem = 1 & r1 -> (mem'=M1_1_1) & (pick'=P1_1_1); + [p] pick = 0 & mem = 1 & !r1 -> (mem'=M1_1_0) & (pick'=P1_1_0); + + [move] true -> (pick'=0); + + +endmodule + + +module strategy2 + pick2 : [0..5] init 0; + mem2 : [0..1] init 0; + + [p] pick2 = 0 & mem2 = 0 & l2 -> (mem2'=M2_0_1) & (pick2'=P2_0_1); + [p] pick2 = 0 & mem2 = 0 & !l2 -> (mem2'=M2_0_0) & (pick2'=P2_0_0); + [p] pick2 = 0 & mem2 = 1 & l2 -> (mem2'=M2_1_1) & (pick2'=P2_1_1); + [p] pick2 = 0 & mem2 = 1 & !l2 -> (mem2'=M2_1_0) & (pick2'=P2_1_0); + + [move] true -> (pick2'=0); + +endmodule + + + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + [move] pick=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] pick=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] pick=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] pick=4 -> 1-sl: (xa1'=x1l) + sl: true; + [move] pick=5 -> true; +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] pick2=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] pick2=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] pick2=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] pick2=4 -> 1-sl: (xa2'=x2l) + sl: true; + [move] pick2=5 -> true; +endmodule + + + + +// reward +rewards "moves" + pick=0 & pick2=0 : 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/case-studies/maze-multi/sketch.props b/models/tac24/case-studies/maze-multi/sketch.props new file mode 100644 index 000000000..cbd7830e8 --- /dev/null +++ b/models/tac24/case-studies/maze-multi/sketch.props @@ -0,0 +1,5 @@ +//R{"steps"}min=? [F goal] +//P<=0.24 [F (x=4 & y=3)] +Pmax=? [F goal] +R{"collect"}>=10 [F (goal | bad)] +R{"faults"}<=7 [F (goal | bad)] \ No newline at end of file diff --git a/models/tac24/case-studies/maze-multi/sketch.templ b/models/tac24/case-studies/maze-multi/sketch.templ new file mode 100644 index 000000000..074570ad6 --- /dev/null +++ b/models/tac24/case-studies/maze-multi/sketch.templ @@ -0,0 +1,96 @@ +pomdp + +// 3 | x x x x x +// 2 | x x x +// 1 | x x x +// 0 | x x x +// y ____________ +// x 0 1 2 3 4 + +// can go in this direction +formula u = y<3; +formula r = y=3 & x<4; +formula d = y>0 & (x=0 | x=2 | x=4); +formula l = y=3 & x>0; + +// target cell +formula goal = x=2 & y=0 & clk=1; +formula bad = (x=0 | x=4) & y=0 & clk=1; + +// updates of coordinates (if possible) +formula yu = u ? (y+1) : y; +formula xr = r ? (x+1) : x; +formula yd = d ? (y-1) : y; +formula xl = l ? (x-1) : x; + +// corresponding observables +observable "u" = clk=1 & u; +observable "r" = clk=1 & r; +observable "d" = clk=1 & d; +observable "l" = clk=1 & l; +observable "goal" = goal; +observable "bad" = bad; + + +// modules + +module clock + // 0 - init, 1 - drive + clk : [0..1] init 0; + + // random placement + [place] clk=0 -> (clk'=1); + + // drive + [up] clk=1 -> true; + [right] clk=1 -> true; + [down] clk=1 -> true; + [left] clk=1 -> true; +endmodule + +module maze + + x : [0..4] init 0; + y : [0..3] init 0; + + // initialisation + [place] true -> + 1/11 : (x'=0)&(y'=1) + + 1/11 : (x'=0)&(y'=2) + + 1/11 : (x'=0)&(y'=3) + + 1/11 : (x'=1)&(y'=3) + + 1/11 : (x'=2)&(y'=1) + + 1/11 : (x'=2)&(y'=2) + + 1/11 : (x'=2)&(y'=3) + + 1/11 : (x'=3)&(y'=3) + + 1/11 : (x'=4)&(y'=1) + + 1/11 : (x'=4)&(y'=2) + + 1/11 : (x'=4)&(y'=3); + + // moving around the maze (all combinations) + + [up] !bad & !goal -> 0.6: (y'=yu) + 0.15: (x'=xr) + 0.15: (x'=xl) + 0.1: (y'=yd); + [right] !bad & !goal -> 0.6: (x'=xr) + 0.15: (y'=yu) + 0.15: (y'=yd) + 0.1: (x'=xl); + [down] !bad & !goal -> 0.6: (y'=yd) + 0.15: (x'=xr) + 0.15: (x'=xl) + 0.1: (y'=yu); + [left] !bad & !goal -> 0.6: (x'=xl) + 0.15: (y'=yu) + 0.15: (y'=yd) + 0.1: (x'=xr); + + [f] bad | goal -> true; + +endmodule + +// rewards + +rewards "steps" + clk=1: 1; +endrewards + +rewards "collect" + clk=1 & x=0 & y=3: 1; + clk=1 & x=2 & y=3: 1; + clk=1 & x=4 & y=3: 1; +endrewards + +rewards "faults" + clk=1 & x=2 & y=2: 1; + clk=1 & x=2 & y=1: 1; +endrewards diff --git a/models/tac24/dpm-demo/compute.props b/models/tac24/dpm-demo/compute.props new file mode 100644 index 000000000..485a91382 --- /dev/null +++ b/models/tac24/dpm-demo/compute.props @@ -0,0 +1,9 @@ +//R{"time"}min=? [ F "finished" ]; +//R{"requests"}min=? [ F "finished" ]; +//R{"served"}min=? [ F "finished" ]; +//R{"requests_lost"}min=? [ F "finished" ]; +//R{"power"}min=? [ F "finished" ]; +//R{"idle_steps"}min=? [ F "finished" ]; +//R{"sleep_steps"}min=? [ F "finished" ]; +//R{"active_steps"}min=? [ F "finished" ]; +R{"idle_active_steps"}min=? [ F "finished" ]; diff --git a/models/tac24/dpm-demo/requests.props b/models/tac24/dpm-demo/requests.props new file mode 100644 index 000000000..096df00f9 --- /dev/null +++ b/models/tac24/dpm-demo/requests.props @@ -0,0 +1 @@ +R{"requests"}max = ? [ F "finished" ] \ No newline at end of file diff --git a/models/tac24/dpm-demo/sketch.props b/models/tac24/dpm-demo/sketch.props new file mode 100644 index 000000000..f84b15a3c --- /dev/null +++ b/models/tac24/dpm-demo/sketch.props @@ -0,0 +1,2 @@ +R{"requests_lost"} <= 1 [ F "finished" ] +R{"power"}min=? [ F "finished" ] diff --git a/models/tac24/dpm-demo/sketch.templ b/models/tac24/dpm-demo/sketch.templ new file mode 100644 index 000000000..5c1fe2467 --- /dev/null +++ b/models/tac24/dpm-demo/sketch.templ @@ -0,0 +1,157 @@ +dtmc + +// timing: +// tick-0: +// queue state is observed and state change is planned (pm) +// request are generated (if service requester is active) +// tick-1: +// requests are served +// state change is executed +// service requester changes its state +// battery depletes + +// initial queue size +const int q_init = 0; + +// ----- synthesized parameters ------------------------------------------------ + +// profiles desired at observation levels +// 0 - sleep, 1 - idle, 2 - active +hole int P1 in {0,1,2}; +hole int P2 in {0,1,2}; +hole int P3 in {0,1,2}; +hole int P4 in {0,1,2}; + +// observation level thresholds +hole double T1 in {0.0,0.1,0.2,0.3,0.4}; +hole double T2 in {0.5}; +hole double T3 in {0.6,0.7,0.8,0.9}; + +// queue size +hole int QMAX in {1,2,3,4,5,6,7,8,9,10}; + +//const int QMAX = 10; + +// ----- modules --------------------------------------------------------------- + + +// clock + +module CLOCK + c : [0..1] init 0; + [tick0] c=0 -> (c'=1); + [tick1] c=1 -> (c'=0); +endmodule + + +// power manager + +module PM + pm : [0..2] init 0; // 0 - sleep, 1 - idle, 2 - active + [tick0] q <= T1*QMAX -> (pm'=P1); + [tick0] q > T1*QMAX & q <= T2*QMAX -> (pm'=P2); + [tick0] q > T2*QMAX & q <= T3*QMAX -> (pm'=P3); + [tick0] q > T3*QMAX -> (pm'=P4); +endmodule + + +// service provider + +module SP + sp : [0..4] init 0; + // 0 - sleep, 1 - idle, 2 - active + // waiting states: 3 - sleep to idle, 4 - idle to active + + // immediate transitions - change to lower-energy (or same) state + [tick1] sp <= 2 & pm <= sp -> (sp'=pm); + + // transitions through waiting states - change to higher-energy state (sleep to idle or idle to active) + [tick1] sp <= 2 & pm > sp -> (sp'=sp+3); + + // waiting states + [tick1] sp = 3 -> 0.9 : (sp'=sp-2) + 0.1 : true; + [tick1] sp = 4 -> 0.7 : (sp'=sp-2) + 0.3 : true; + +endmodule + + +// service requester + +module SR + sr : [0..1] init 0; // 0 - idle, 1 - active + [tick1] sr=0 -> 0.5: true + 0.5: (sr' = 1); + [tick1] sr=1 -> 0.8: true + 0.2: (sr' = 0); +endmodule + + +// service request queue + +module SRQ + q : [0..10000] init q_init; + lost : [0..1] init 0; + + [tick0] true -> (lost'=0); + + [tick1] sr=1 & sp!=2 & q=QMAX -> (lost'=1); + [tick1] sr=1 & sp!=2 & q!=QMAX -> (q'=min(q+1,QMAX)); + [tick1] sr=1 & sp=2 & q=QMAX -> 0.94: true + 0.06: (lost'=1); // serve + [tick1] sr=1 & sp=2 & q!=QMAX -> 0.95: true + 0.05: (q'=min(q+1,QMAX)); // serve + + [tick1] sr=0 & sp=2 -> 0.95: (q'=max(q-1,0)) + 0.05: true; // serve + [tick1] sr=0 & sp!=2 -> true; + +endmodule + +// battery + +module BAT + bat : [0..1] init 1; // 0 empty, 1 - operational + [tick1] bat=0 ->true; + [tick1] bat=1 -> 0.001 : (bat'=0) + 0.999 : true; +endmodule + +// ----- rewards ---------------------------------------------------------------- + +label "finished" = (bat = 0); + +rewards "time" + [tick0] true : 1; +endrewards + +rewards "queuesize" + [tick0] true: q; +endrewards + +rewards "requests" + [tick0] sr=1 : 1; +endrewards + +rewards "served" + [tick1] q > 0 & sp=2 : 1; +endrewards + +rewards "requests_lost" + [tick0] lost=1 : 1; +endrewards + +rewards "power" + [tick1] sp=2 : 100 + 10*q; // active + [tick1] sp=4 : 10; // idle to active + [tick1] sp=3 : 5; // sleep to idle +endrewards + +rewards "idle_steps" + [tick1] sp=1 : 1; +endrewards + +rewards "idle_active_steps" + [tick1] sp=4 : 1; +endrewards + +rewards "sleep_steps" + [tick1] sp=0 : 1; +endrewards + +rewards "active_steps" + [tick1] sp=2 : 1; +endrewards \ No newline at end of file diff --git a/models/tac24/grid-10-sl-4fsc/easy.props b/models/tac24/grid-10-sl-4fsc/easy.props new file mode 100644 index 000000000..197417691 --- /dev/null +++ b/models/tac24/grid-10-sl-4fsc/easy.props @@ -0,0 +1 @@ +R{"steps"}<=100 [ F "goal" ] \ No newline at end of file diff --git a/models/tac24/grid-10-sl-4fsc/sketch.props b/models/tac24/grid-10-sl-4fsc/sketch.props new file mode 100644 index 000000000..31f2e47e8 --- /dev/null +++ b/models/tac24/grid-10-sl-4fsc/sketch.props @@ -0,0 +1 @@ +R{"steps"}min=? [ F "goal" ] \ No newline at end of file diff --git a/models/tac24/grid-10-sl-4fsc/sketch.templ b/models/tac24/grid-10-sl-4fsc/sketch.templ new file mode 100644 index 000000000..61d45812f --- /dev/null +++ b/models/tac24/grid-10-sl-4fsc/sketch.templ @@ -0,0 +1,70 @@ + + +// 4x4 grid +// from Littman, Cassandra and Kaelbling +// Learning policies for partially observable environments: Scaling up +// Technical Report CS, Brown University + +dtmc + +const int Xmax=10; +const int Ymax=10; +const int Xgoal=Xmax/2; +const int Ygoal=Ymax/2; +const double sl=0.1; + +// +// 4-FSC +// +// holes +hole int M_0_1 in {0,1,2,3}; +hole int M_1_1 in {0,1,2,3}; +hole int M_2_1 in {0,1,2,3}; +hole int M_3_1 in {0,1,2,3}; +hole int P_0_1 in {1,2,3,4}; +hole int P_1_1 in {1,2,3,4}; +hole int P_2_1 in {1,2,3,4}; +hole int P_3_1 in {1,2,3,4}; + +module strategy + pick : [0..4] init 0; + mem : [0..3] init 0; + [p] placed = 1 & pick = 0 & mem = 0 -> (mem'=M_0_1) & (pick'=P_0_1); + [p] placed = 1 & pick = 0 & mem = 1 -> (mem'=M_1_1) & (pick'=P_1_1); + [p] placed = 1 & pick = 0 & mem = 2 -> (mem'=M_2_1) & (pick'=P_2_1); + [p] placed = 1 & pick = 0 & mem = 3 -> (mem'=M_3_1) & (pick'=P_3_1); + [north] pick=1 -> (pick'=0); + [east] pick=2 -> (pick'=0); + [south] pick=3 -> (pick'=0); + [west] pick=4 -> (pick'=0); +endmodule + + + +module grid + + x : [0..Xmax]; // x coordinate + y : [0..Ymax]; // y coordinate + placed : [0..1] init 0; + + + // initially randomly placed within the grid (not at the target) + [] placed = 0 -> 1/4 : (x'=0) & (y'=0) & (placed'=1) + + 1/4 : (x'=Xmax) & (y'=0) & (placed'=1) + + 1/4 : (x'=Xmax) & (y'=Ymax) & (placed'=1) + + 1/4 : (x'=0) & (y'=Ymax) & (placed'=1); + + // move around the grid + [east] placed=1 -> sl: true + (1-sl): (x'=min(x+1,Xmax)); + [west] placed=1 -> sl: true + (1-sl): (x'=max(x-1,0)); + [north] placed=1 -> sl: true + (1-sl): (y'=min(y+1,Ymax)); + [south] placed=1 -> sl: true + (1-sl): (y'=max(y-1,0)); + +endmodule + +// reward structure for number of steps to reach the target +rewards "steps" + placed = 1 & pick != 0 : 1; +endrewards + +label "goal" = (x=Xgoal & y=Ygoal); diff --git a/models/tac24/grid-av-4fsc/easy.props b/models/tac24/grid-av-4fsc/easy.props new file mode 100644 index 000000000..436d4e008 --- /dev/null +++ b/models/tac24/grid-av-4fsc/easy.props @@ -0,0 +1 @@ +P>=0.928 [ F "goal" ] \ No newline at end of file diff --git a/models/tac24/grid-av-4fsc/sketch.props b/models/tac24/grid-av-4fsc/sketch.props new file mode 100644 index 000000000..724a7f974 --- /dev/null +++ b/models/tac24/grid-av-4fsc/sketch.props @@ -0,0 +1 @@ +Pmax=? [ F "goal" ] \ No newline at end of file diff --git a/models/tac24/grid-av-4fsc/sketch.templ b/models/tac24/grid-av-4fsc/sketch.templ new file mode 100644 index 000000000..1c94ad8f1 --- /dev/null +++ b/models/tac24/grid-av-4fsc/sketch.templ @@ -0,0 +1,102 @@ + + +// 4x4 grid +// from Littman, Cassandra and Kaelbling +// Learning policies for partially observable environments: Scaling up +// Technical Report CS, Brown University + +dtmc + + +const double sl=0.1; + +// +// 4-FSC +// +// holes +hole int M_0_1 in {0,1,2,3}; +hole int M_1_1 in {0,1,2,3}; +hole int M_2_1 in {0,1,2,3}; +hole int M_3_1 in {0,1,2,3}; +hole int P_0_1 in {1,2,3,4}; +hole int P_1_1 in {1,2,3,4}; +hole int P_2_1 in {1,2,3,4}; +hole int P_3_1 in {1,2,3,4}; + +module strategy + pick : [0..4] init 0; + mem : [0..3] init 0; + [p] pick = 0 & mem = 0 & o = 1 -> (mem'=M_0_1) & (pick'=P_0_1); + [p] pick = 0 & mem = 1 & o = 1 -> (mem'=M_1_1) & (pick'=P_1_1); + [p] pick = 0 & mem = 2 & o = 1 -> (mem'=M_2_1) & (pick'=P_2_1); + [p] pick = 0 & mem = 3 & o = 1 -> (mem'=M_3_1) & (pick'=P_3_1); + [north] pick=1 -> (pick'=0); + [east] pick=2 -> (pick'=0); + [south] pick=3 -> (pick'=0); + [west] pick=4 -> (pick'=0); +endmodule + + + +module grid + + x : [0..3]; // x coordinate + y : [0..3]; // y coordinate + o : [0..3]; // observables + // 0 - initial observation + // 1 - in the grid (not target) + // 2 - observe target + // 3 - bad state + + // initially randomly placed within the grid (not at the target) + [] o=0 -> 1/14 : (o'=1) & (x'=0) & (y'=0) + + 1/14 : (o'=1) & (x'=0) & (y'=1) + + 1/14 : (o'=1) & (x'=0) & (y'=2) + + 1/14 : (o'=1) & (x'=0) & (y'=3) + + 1/14 : (o'=1) & (x'=1) & (y'=0) + //+ 1/15 : (o'=1) & (x'=1) & (y'=1) + + 1/14 : (o'=1) & (x'=1) & (y'=2) + + 1/14 : (o'=1) & (x'=1) & (y'=3) + + 1/14 : (o'=1) & (x'=2) & (y'=0) + + 1/14 : (o'=1) & (x'=2) & (y'=1) + + 1/14 : (o'=1) & (x'=2) & (y'=2) + + 1/14 : (o'=1) & (x'=2) & (y'=3) + // + 1/15 : (o'=1) & (x'=3) & (y'=0) this is the traget + + 1/14 : (o'=1) & (x'=3) & (y'=1) + + 1/14 : (o'=1) & (x'=3) & (y'=2) + + 1/14 : (o'=1) & (x'=3) & (y'=3); + + // move around the grid + [east] o=1 & !(x=2 & y=0) &!(x=0 & y=1) -> (1-sl): (x'=min(x+1,3)) + sl: (x'=x)&(y'=y)&(o'=o); // not reached target + [east] o=1 & x=0 & y=1 -> (1-sl): (x'=1) & (o'=3) + sl: (x'=x)&(y'=y)&(o'=o); // reached bad state + [east] o=1 & x=2 & y=0 -> (1-sl): (x'=min(x+1,3)) & (o'=2) + sl: (x'=x)&(y'=y)&(o'=o); // reached target + + [west] o=1 & !(x=2 & y=1) -> (1-sl): (x'=max(x-1,0)) + sl: (x'=x)&(y'=y)&(o'=o); // not reached target + [west] o=1 & x=2 & y=1 -> (1-sl): (x'=1) & (o'=3) + sl: (x'=x)&(y'=y)&(o'=o); // reached bad state + + [north] o=1 & !(x=1 & y=0)-> (1-sl): (y'=min(y+1,3)) + sl: (x'=x)&(y'=y)&(o'=o); // reached target + [north] o=1 & (x=1 & y=0) -> (1-sl): (y'=1) & (o'=3) + sl: (x'=x)&(y'=y)&(o'=o); //reached bad state + + [south] o=1 & !(x=3 & y=1) & !(x=1 & y=2) -> (1-sl): (y'=max(y-1,0)) + sl: (x'=x)&(y'=y)&(o'=o); // not reached target + [south] o=1 & x=3 & y=1 -> (1-sl): (y'=max(y-1,0)) & (o'=2) + sl: (x'=x)&(y'=y)&(o'=o); // reached target + [south] o=1 & x=1 & y=2 -> (1-sl): (y'=1) & (o'=3) + sl: (x'=x)&(y'=y)&(o'=o); //reached bad state + + // reached target + [done] o=2 -> true; + + //reached bad state + [bad] o=3 -> true; + +endmodule + +// reward structure for number of steps to reach the target +rewards "steps" + [east] true : 1; + [west] true : 1; + [north] true : 1; + [south] true : 1; +endrewards + +// target observation +label "goal" = o=2; +label "bad" = o=3; diff --git a/models/tac24/grid-meet-2fsc/sketch.props b/models/tac24/grid-meet-2fsc/sketch.props new file mode 100644 index 000000000..72165aa76 --- /dev/null +++ b/models/tac24/grid-meet-2fsc/sketch.props @@ -0,0 +1,6 @@ +R{"moves"}min=? [F "goal"] + +//R{"steps"}min=? [F "goal"] + + +//Pmax=? [F "goal"] \ No newline at end of file diff --git a/models/tac24/grid-meet-2fsc/sketch.templ b/models/tac24/grid-meet-2fsc/sketch.templ new file mode 100644 index 000000000..5b200191b --- /dev/null +++ b/models/tac24/grid-meet-2fsc/sketch.templ @@ -0,0 +1,148 @@ + +dtmc + +// 7 | x x x x x x x x +// 6 | x x x +// 5 | x x A x x x x +// 4 | x x x x x x x +// 3 | x x x x x x +// 2 | x x x x x A x +// 1 | x x x x x +// 0 | x x x x x +// y _________________ +// x 0 1 2 3 4 5 6 7 + + +// agent1 can go in this direction +formula u1 = ya1<7 & !(xa1=3 & ya1=2) & !(ya1=5 & xa1>3); +formula r1 = xa1<7 & !(xa1=4 & ya1<4) & !(xa1=2 & (ya1>2 & ya1<7)); +formula d1 = ya1>0 & !(ya1=2 & xa1<2) & !(ya1=7 & xa1>2) & !(ya1=4 & xa1=5); +formula l1 = xa1>0 & !(xa1=2 & ya1<2) & !(xa1=6 & ya1<4) & !(xa1=4 & (ya1>2 & ya1<6)); + +// updates of coordinates (if possible) +formula y1u = u1 ? (ya1+1) : ya1; +formula x1r = r1 ? (xa1+1) : xa1; +formula y1d = d1 ? (ya1-1) : ya1; +formula x1l = l1 ? (xa1-1) : xa1; + + +// agent2 can go in this direction +formula u2 = ya2<7 & !(xa2=3 & ya2=2) & !(ya2=5 & xa2>3); +formula r2 = xa2<7 & !(xa2=4 & ya2<4) & !(xa2=2 & (ya2>2 & ya2<7)); +formula d2 = ya2>0 & !(ya2=2 & xa2<2) & !(ya2=7 & xa2>2) & !(ya2=4 & xa2=5); +formula l2 = xa2>0 & !(xa2=2 & ya2<2) & !(xa2=6 & ya2<4) & !(xa2=4 & (ya2>2 & ya2<6)); + +// updates of coordinates (if possible) +formula y2u = u2 ? (ya2+1) : ya2; +formula x2r = r2 ? (xa2+1) : xa2; +formula y2d = d2 ? (ya2-1) : ya2; +formula x2l = l2 ? (xa2-1) : xa2; + + +const double sl=0; + +// agent 1 holes +hole int M1_0_1 in {0,1}; +hole int M1_0_0 in {0,1}; +hole int M1_1_1 in {0,1}; +hole int M1_1_0 in {0,1}; +hole int P1_0_1 in {1,2,3,4}; +hole int P1_0_0 in {1,2,3,4}; +hole int P1_1_1 in {1,2,3,4}; +hole int P1_1_0 in {1,2,3,4}; + +// agent 2 holes +hole int M2_0_1 in {0,1}; +hole int M2_0_0 in {0,1}; +hole int M2_1_1 in {0,1}; +hole int M2_1_0 in {0,1}; +hole int P2_0_1 in {1,2,3,4}; +hole int P2_0_0 in {1,2,3,4}; +hole int P2_1_1 in {1,2,3,4}; +hole int P2_1_0 in {1,2,3,4}; + +module strategy1 + mem : [0..1] init 0; + + [move] mem=0 & r1 -> (mem'=M1_0_1); + [move] mem=0 & !r1 -> (mem'=M1_0_0); + [move] mem=1 & r1 -> (mem'=M1_1_1); + [move] mem=1 & !r1 -> (mem'=M1_1_0); +endmodule + +module grid1 + + xa1 : [0..7] init 2; // agent1 x coordinate + ya1 : [0..7] init 5; // agent1 y coordinate + + + [move] mem=0 & r1 & P1_0_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=0 & r1 & P1_0_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=0 & r1 & P1_0_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=0 & r1 & P1_0_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=0 & !r1 & P1_0_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=0 & !r1 & P1_0_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=0 & !r1 & P1_0_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=0 & !r1 & P1_0_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=1 & r1 & P1_1_1=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=1 & r1 & P1_1_1=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=1 & r1 & P1_1_1=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=1 & r1 & P1_1_1=4 -> 1-sl: (xa1'=x1l) + sl: true; + + [move] mem=1 & !r1 & P1_1_0=1 -> 1-sl: (ya1'=y1u) + sl: true; + [move] mem=1 & !r1 & P1_1_0=2 -> 1-sl: (xa1'=x1r) + sl: true; + [move] mem=1 & !r1 & P1_1_0=3 -> 1-sl: (ya1'=y1d) + sl: true; + [move] mem=1 & !r1 & P1_1_0=4 -> 1-sl: (xa1'=x1l) + sl: true; + +endmodule + + +module strategy2 + mem2 : [0..1] init 0; + + [move] mem2=0 & l2 -> (mem2'=M2_0_1); + [move] mem2=0 & !l2 -> (mem2'=M2_0_0); + [move] mem2=1 & l2 -> (mem2'=M2_1_1); + [move] mem2=1 & !l2 -> (mem2'=M2_1_0); +endmodule + + +module grid2 + + xa2 : [0..7] init 6; // agent2 x coordinate + ya2 : [0..7] init 2; // agent2 y coordinate + + [move] mem2=0 & l2 & P2_0_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & l2 & P2_0_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & l2 & P2_0_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & l2 & P2_0_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=0 & !l2 & P2_0_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=0 & !l2 & P2_0_0=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=1 & l2 & P2_1_1=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & l2 & P2_1_1=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & l2 & P2_1_1=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & l2 & P2_1_1=4 -> 1-sl: (xa2'=x2l) + sl: true; + + [move] mem2=1 & !l2 & P2_1_0=1 -> 1-sl: (ya2'=y2u) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=2 -> 1-sl: (xa2'=x2r) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=3 -> 1-sl: (ya2'=y2d) + sl: true; + [move] mem2=1 & !l2 & P2_1_0=4 -> 1-sl: (xa2'=x2l) + sl: true; +endmodule + + + + +// reward +rewards "moves" + true: 1; +endrewards + +// target +label "goal" = (xa1=xa2) & (ya1=ya2); + diff --git a/models/tac24/maze-sl-5/easy.props b/models/tac24/maze-sl-5/easy.props new file mode 100644 index 000000000..3a7fda17f --- /dev/null +++ b/models/tac24/maze-sl-5/easy.props @@ -0,0 +1 @@ +R{"steps"}<=7.09 [F goal] \ No newline at end of file diff --git a/models/tac24/maze-sl-5/sketch.props b/models/tac24/maze-sl-5/sketch.props new file mode 100644 index 000000000..1970a3a5b --- /dev/null +++ b/models/tac24/maze-sl-5/sketch.props @@ -0,0 +1 @@ +R{"steps"}min=? [F goal] diff --git a/models/tac24/maze-sl-5/sketch.templ b/models/tac24/maze-sl-5/sketch.templ new file mode 100644 index 000000000..5d5d75c95 --- /dev/null +++ b/models/tac24/maze-sl-5/sketch.templ @@ -0,0 +1,195 @@ +dtmc + +// 3 | x x x x x +// 2 | x x x +// 1 | x x x +// 0 | x x x +// y ____________ +// x 0 1 2 3 4 + +// can go in this direction +formula u = y<8; +formula r = y=8 & x<4; +formula d = y>0 & (x=0 | x=2 | x=4); +formula l = y=8 & x>0; + +// target cell +formula goal = x=2 & y=0; +formula bad = x=4 & y=0; + +// updates of coordinates (if possible) +formula yu = u ? (y+1) : y; +formula xr = r ? (x+1) : x; +formula yd = d ? (y-1) : y; +formula xl = l ? (x-1) : x; + + +// +// 3-FSC +// +// holes +hole int M_0_1 in {0,1,2}; +hole int M_1_1 in {0,1,2}; +hole int M_2_1 in {0,1,2}; + +hole int M_0_2 in {0,1,2}; +hole int M_1_2 in {0,1,2}; +hole int M_2_2 in {0,1,2}; + +hole int M_0_3 in {0,1,2}; +hole int M_1_3 in {0,1,2}; +hole int M_2_3 in {0,1,2}; + +hole int M_0_4 in {0,1,2}; +hole int M_1_4 in {0,1,2}; +hole int M_2_4 in {0,1,2}; + +hole int M_0_5 in {0,1,2}; +hole int M_1_5 in {0,1,2}; +hole int M_2_5 in {0,1,2}; + +hole int M_0_6 in {0,1,2}; +hole int M_1_6 in {0,1,2}; +hole int M_2_6 in {0,1,2}; + +hole int M_0_7 in {0,1,2}; +hole int M_1_7 in {0,1,2}; +hole int M_2_7 in {0,1,2}; + +hole int M_0_8 in {0,1,2}; +hole int M_1_8 in {0,1,2}; +hole int M_2_8 in {0,1,2}; + + +hole int P_0_1 in {1,2,3,4}; +hole int P_1_1 in {1,2,3,4}; +hole int P_2_1 in {1,2,3,4}; + +hole int P_0_2 in {1,2,3,4}; +hole int P_1_2 in {1,2,3,4}; +hole int P_2_2 in {1,2,3,4}; + +hole int P_0_3 in {1,2,3,4}; +hole int P_1_3 in {1,2,3,4}; +hole int P_2_3 in {1,2,3,4}; + +hole int P_0_4 in {1,2,3,4}; +hole int P_1_4 in {1,2,3,4}; +hole int P_2_4 in {1,2,3,4}; + +hole int P_0_5 in {1,2,3,4}; +hole int P_1_5 in {1,2,3,4}; +hole int P_2_5 in {1,2,3,4}; + +hole int P_0_6 in {1,2,3,4}; +hole int P_1_6 in {1,2,3,4}; +hole int P_2_6 in {1,2,3,4}; + +hole int P_0_7 in {1,2,3,4}; +hole int P_1_7 in {1,2,3,4}; +hole int P_2_7 in {1,2,3,4}; + +hole int P_0_8 in {1,2,3,4}; +hole int P_1_8 in {1,2,3,4}; +hole int P_2_8 in {1,2,3,4}; + + + + +// modules + +module strategy + pick : [0..4] init 0; + mem : [0..2] init 0; + + [p] pick = 0 & mem = 0 & u & !r & !d & !l & !goal & !bad -> (mem'=M_0_1) & (pick'=P_0_1); + [p] pick = 0 & mem = 1 & u & !r & !d & !l & !goal & !bad -> (mem'=M_1_1) & (pick'=P_1_1); + [p] pick = 0 & mem = 2 & u & !r & !d & !l & !goal & !bad -> (mem'=M_2_1) & (pick'=P_2_1); + + [p] pick = 0 & mem = 0 & u & !r & d & !l & !goal & !bad -> (mem'=M_0_2) & (pick'=P_0_2); + [p] pick = 0 & mem = 1 & u & !r & d & !l & !goal & !bad -> (mem'=M_1_2) & (pick'=P_1_2); + [p] pick = 0 & mem = 2 & u & !r & d & !l & !goal & !bad -> (mem'=M_2_2) & (pick'=P_2_2); + + [p] pick = 0 & mem = 0 & !u & r & d & !l & !goal & !bad -> (mem'=M_0_3) & (pick'=P_0_3); + [p] pick = 0 & mem = 1 & !u & r & d & !l & !goal & !bad -> (mem'=M_1_3) & (pick'=P_1_3); + [p] pick = 0 & mem = 2 & !u & r & d & !l & !goal & !bad -> (mem'=M_2_3) & (pick'=P_2_3); + + [p] pick = 0 & mem = 0 & !u & r & !d & l & !goal & !bad -> (mem'=M_0_4) & (pick'=P_0_4); + [p] pick = 0 & mem = 1 & !u & r & !d & l & !goal & !bad -> (mem'=M_1_4) & (pick'=P_1_4); + [p] pick = 0 & mem = 2 & !u & r & !d & l & !goal & !bad -> (mem'=M_2_4) & (pick'=P_2_4); + + [p] pick = 0 & mem = 0 & !u & r & d & l & !goal & !bad -> (mem'=M_0_5) & (pick'=P_0_5); + [p] pick = 0 & mem = 1 & !u & r & d & l & !goal & !bad -> (mem'=M_1_5) & (pick'=P_1_5); + [p] pick = 0 & mem = 2 & !u & r & d & l & !goal & !bad -> (mem'=M_2_5) & (pick'=P_2_5); + + [p] pick = 0 & mem = 0 & !u & !r & d & l & !goal & !bad -> (mem'=M_0_6) & (pick'=P_0_6); + [p] pick = 0 & mem = 1 & !u & !r & d & l & !goal & !bad -> (mem'=M_1_6) & (pick'=P_1_6); + [p] pick = 0 & mem = 2 & !u & !r & d & l & !goal & !bad -> (mem'=M_2_6) & (pick'=P_2_6); + + [p] pick = 0 & mem = 0 & u & !r & !d & !l & goal & !bad -> (mem'=M_0_7) & (pick'=P_0_7); + [p] pick = 0 & mem = 1 & u & !r & !d & !l & goal & !bad -> (mem'=M_1_7) & (pick'=P_1_7); + [p] pick = 0 & mem = 2 & u & !r & !d & !l & goal & !bad -> (mem'=M_2_7) & (pick'=P_2_7); + + [p] pick = 0 & mem = 0 & u & !r & !d & !l & !goal & bad -> (mem'=M_0_8) & (pick'=P_0_8); + [p] pick = 0 & mem = 1 & u & !r & !d & !l & !goal & bad -> (mem'=M_1_8) & (pick'=P_1_8); + [p] pick = 0 & mem = 2 & u & !r & !d & !l & !goal & bad -> (mem'=M_2_8) & (pick'=P_2_8); + + [up] pick=1 -> (pick'=0); + [right] pick=2 -> (pick'=0); + [down] pick=3 -> (pick'=0); + [left] pick=4 -> (pick'=0); +endmodule + + + +module clock + // 0 - init, 1 - drive + clk : [0..1] init 0; + + // random placement + [place] clk=0 -> (clk'=1); + + // drive + [up] clk=1 -> true; + [right] clk=1 -> true; + [down] clk=1 -> true; + [left] clk=1 -> true; + [p] clk=1 -> true; +endmodule + +module maze + + x : [0..4] init 0; + y : [0..8] init 0; + + // initialisation + [place] true -> + 1/13 : (x'=0)&(y'=0) + + 1/13 : (x'=0)&(y'=1) + + 1/13 : (x'=0)&(y'=7) + + 1/13 : (x'=0)&(y'=8) + + 1/13 : (x'=1)&(y'=8) + + 1/13 : (x'=2)&(y'=0) + + 1/13 : (x'=2)&(y'=1) + + 1/13 : (x'=2)&(y'=7) + + 1/13 : (x'=2)&(y'=8) + + 1/13 : (x'=3)&(y'=8) + + 1/13 : (x'=4)&(y'=1) + + 1/13 : (x'=4)&(y'=7) + + 1/13 : (x'=4)&(y'=8); + + // moving around the maze (all combinations) + + [up] true -> 0.8: (y'=yu) + 0.08: (x'=xr) + 0.08: (x'=xl) + 0.04: (y'=yd); + [right] true -> 0.8: (x'=xr) + 0.08: (y'=yu) + 0.08: (y'=yd) + 0.04: (x'=xl); + [down] true -> 0.8: (y'=yd) + 0.08: (x'=xr) + 0.08: (x'=xl) + 0.04: (y'=yu); + [left] true -> 0.8: (x'=xl) + 0.08: (y'=yu) + 0.08: (y'=yd) + 0.04: (x'=xr); + +endmodule + +// rewards + +rewards "steps" + clk=1 & pick != 0: 1; +endrewards + diff --git a/models/tac24/pole-res/easy.props b/models/tac24/pole-res/easy.props new file mode 100644 index 000000000..bc9666e44 --- /dev/null +++ b/models/tac24/pole-res/easy.props @@ -0,0 +1 @@ +R{"rounds"}>=16.6566 [ F dead ] \ No newline at end of file diff --git a/models/tac24/pole-res/sketch.props b/models/tac24/pole-res/sketch.props new file mode 100644 index 000000000..572a57225 --- /dev/null +++ b/models/tac24/pole-res/sketch.props @@ -0,0 +1 @@ +R{"rounds"}max=? [ F dead ] \ No newline at end of file diff --git a/models/tac24/pole-res/sketch.templ b/models/tac24/pole-res/sketch.templ new file mode 100644 index 000000000..fc07cff28 --- /dev/null +++ b/models/tac24/pole-res/sketch.templ @@ -0,0 +1,166 @@ +dtmc + +const int CMAX = 0; +//const double THRESHOLD; + +module initialiseN + NN : [0..100] init 0; + NS : [0..100] init 0; + NW : [0..100] init 0; + NE : [0..100] init 0; + [start] true -> 0.8: (NN'=90) & (NS'=2) & (NW'=6) & (NE'=2) + 0.2: (NN'=70) & (NS'=4) & (NW'=16) & (NE'=10); +endmodule + +module initialiseS + SN : [0..100] init 0; + SS : [0..100] init 0; + SW : [0..100] init 0; + SE : [0..100] init 0; + [start] true -> 0.8: (SS'=80) & (SN'=10) & (SW'=6) & (SE'=4) + 0.2: (SS'=60) & (SN'=10) & (SW'=16) & (SE'=14); +endmodule + +module initialiseW + WN : [0..100] init 0; + WS : [0..100] init 0; + WW : [0..100] init 0; + WE : [0..100] init 0; + [start] true -> 0.9: (WW'=90) & (WS'=2) & (WN'=4) & (WE'=4) + 0.1: (WW'=80) & (WS'=7) & (WN'=7) & (WE'=6); +endmodule + +module initialiseE + EN : [0..100] init 0; + ES : [0..100] init 0; + EW : [0..100] init 0; + EE : [0..100] init 0; + [start] true -> 0.2: (EE'=80) & (ES'=10) & (EW'=6) & (EN'=4) + 0.05: (EE'=60) & (ES'=10) & (EW'=16) & (EN'=14) + 0.75: (EE'=90) & (ES'=2) & (EW'=4) & (EN'=4); +endmodule + +module initialiseA + ANOT : [0..100] init 0; + ANW : [0..100] init 0; + ASW : [0..100] init 0; + ANE : [0..100] init 0; + ASE : [0..100] init 0; + [start] true -> 0.8: (ANOT'=20) & (ANW'=20) & (ASW'=20) & (ANE'=20) & (ASE'=20) + + 0.2: (ANOT'=25) & (ANW'=25) & (ASW'=25) & (ANE'=0) & (ASE'=25); +endmodule + + +module arbiter + phase : [0..3] init 0; + [start] phase = 0 -> (phase'=1); + [steer] phase = 1 -> (phase'=2); + [lost] phase = 1 -> (phase'=1); + [north] phase = 2 -> (phase'=3); + [south] phase = 2 -> (phase'=3); + [east] phase = 2 -> (phase'=3); + [west] phase = 2 -> (phase'=3); + [extern] phase = 3 -> (phase'=1); + +endmodule + +const int MAXQ = 6; +const int MAXX = MAXQ; +const int MAXY = MAXQ; +formula dead = (x = 0 | y = 0 | x = MAXX | y = MAXY); + + +hole int M11 in {2,4}; +hole int M12 in {2,4}; +hole int M13 in {2}; +hole int M14 in {2,3}; +hole int M15 in {2,3}; + +hole int M21 in {2,4}; +hole int M22 in {2,4}; +hole int M23 in {2,3,4}; +hole int M24 in {2,3}; +hole int M25 in {2,3}; + +hole int M31 in {4}; +hole int M32 in {1,2,4}; +hole int M33 in {1,2,3,4}; +hole int M34 in {1,2,3}; +hole int M35 in {3}; + +hole int M41 in {4}; +hole int M42 in {1,4}; +hole int M43 in {1,3,4}; +hole int M44 in {1,3}; +hole int M45 in {3}; + +hole int M51 in {1,4}; +hole int M52 in {1}; +hole int M53 in {1}; +hole int M54 in {1}; +hole int M55 in {1,3}; + + + +module strategy + act : [0..4] init 0; + + [lost] dead -> true; + + [steer] act=0 & x = 1 & y = 1 -> (act' = M11); + [steer] act=0 & x = 1 & y = 2 -> (act' = M12); + [steer] act=0 & x = 1 & y = 3 -> (act' = M13); + [steer] act=0 & x = 1 & y = 4 -> (act' = M14); + [steer] act=0 & x = 1 & y = 5 -> (act' = M15); + + [steer] act=0 & x = 2 & y = 1 -> (act' = M21); + [steer] act=0 & x = 2 & y = 2 -> (act' = M22); + [steer] act=0 & x = 2 & y = 3 -> (act' = M23); + [steer] act=0 & x = 2 & y = 4 -> (act' = M24); + [steer] act=0 & x = 2 & y = 5 -> (act' = M25); + + [steer] act=0 & x = 3 & y = 1 -> (act' = M31); + [steer] act=0 & x = 3 & y = 2 -> (act' = M32); + [steer] act=0 & x = 3 & y = 3 -> (act' = M33); + [steer] act=0 & x = 3 & y = 4 -> (act' = M34); + [steer] act=0 & x = 3 & y = 5 -> (act' = M35); + + [steer] act=0 & x = 4 & y = 1 -> (act' = M41); + [steer] act=0 & x = 4 & y = 2 -> (act' = M42); + [steer] act=0 & x = 4 & y = 3 -> (act' = M43); + [steer] act=0 & x = 4 & y = 4 -> (act' = M44); + [steer] act=0 & x = 4 & y = 5 -> (act' = M45); + + [steer] act=0 & x = 5 & y = 1 -> (act' = M51); + [steer] act=0 & x = 5 & y = 2 -> (act' = M52); + [steer] act=0 & x = 5 & y = 3 -> (act' = M53); + [steer] act=0 & x = 5 & y = 4 -> (act' = M54); + [steer] act=0 & x = 5 & y = 5 -> (act' = M55); + + [north] act = 1 -> (act'=0); + [south] act = 2 -> (act'=0); + [west] act = 3 -> (act'=0); + [east] act = 4 -> (act'=0); +endmodule + +module controller + x : [0..MAXX] init MAXX/2; + y : [0..MAXY] init MAXY/2; + + [north] true -> NN/100: (x'=max(0, x-1)) + NS/100: (x'=min(MAXX,x+1)) + NW/100: (y'=max(0,y-1)) + NE/100: (y'=min(MAXY,y+1)); + [south] true -> SN/100: (x'=max(0, x-1)) + SS/100: (x'=min(MAXX,x+1)) + SW/100: (y'=max(0,y-1)) + SE/100: (y'=min(MAXY,y+1)); + [west] true -> WN/100: (x'=max(0, x-1)) + WS/100: (x'=min(MAXX,x+1)) + WW/100: (y'=max(0,y-1)) + WE/100: (y'=min(MAXY,y+1)); + [east] true -> EN/100: (x'=max(0, x-1)) + ES/100: (x'=min(MAXX,x+1)) + EW/100: (y'=max(0,y-1)) + EE/100: (y'=min(MAXY,y+1)); + + [extern] true -> ANOT/100: (x'=x) & (y'=y) + + ANW/100: (x'=max(0, x-1)) & (y'=max(0,y-1)) + + ASW/100: (x'=min(MAXX, x+1)) & (y'=max(0,y-1)) + + ANE/100: (x'=max(0, x-1)) & (y'=min(MAXY,y+1)) + + ASE/100: (x'=min(MAXX, x+1)) & (y'=min(MAXY,y+1)); + +endmodule + +module round_counter + count: [0..CMAX] init 0; + [steer] true -> 1: (count'=min(count+1,CMAX)); +endmodule + +rewards "rounds" + [steer] true : 1; +endrewards + diff --git a/models/tac24/pole/easy.props b/models/tac24/pole/easy.props new file mode 100644 index 000000000..bc9666e44 --- /dev/null +++ b/models/tac24/pole/easy.props @@ -0,0 +1 @@ +R{"rounds"}>=16.6566 [ F dead ] \ No newline at end of file diff --git a/models/tac24/pole/sketch.props b/models/tac24/pole/sketch.props new file mode 100644 index 000000000..572a57225 --- /dev/null +++ b/models/tac24/pole/sketch.props @@ -0,0 +1 @@ +R{"rounds"}max=? [ F dead ] \ No newline at end of file diff --git a/models/tac24/pole/sketch.templ b/models/tac24/pole/sketch.templ new file mode 100644 index 000000000..10c96b97b --- /dev/null +++ b/models/tac24/pole/sketch.templ @@ -0,0 +1,166 @@ +dtmc + +const int CMAX = 0; +//const double THRESHOLD; + +module initialiseN + NN : [0..100] init 0; + NS : [0..100] init 0; + NW : [0..100] init 0; + NE : [0..100] init 0; + [start] true -> 0.8: (NN'=90) & (NS'=2) & (NW'=6) & (NE'=2) + 0.2: (NN'=70) & (NS'=4) & (NW'=16) & (NE'=10); +endmodule + +module initialiseS + SN : [0..100] init 0; + SS : [0..100] init 0; + SW : [0..100] init 0; + SE : [0..100] init 0; + [start] true -> 0.8: (SS'=80) & (SN'=10) & (SW'=6) & (SE'=4) + 0.2: (SS'=60) & (SN'=10) & (SW'=16) & (SE'=14); +endmodule + +module initialiseW + WN : [0..100] init 0; + WS : [0..100] init 0; + WW : [0..100] init 0; + WE : [0..100] init 0; + [start] true -> 0.9: (WW'=90) & (WS'=2) & (WN'=4) & (WE'=4) + 0.1: (WW'=80) & (WS'=7) & (WN'=7) & (WE'=6); +endmodule + +module initialiseE + EN : [0..100] init 0; + ES : [0..100] init 0; + EW : [0..100] init 0; + EE : [0..100] init 0; + [start] true -> 0.2: (EE'=80) & (ES'=10) & (EW'=6) & (EN'=4) + 0.05: (EE'=60) & (ES'=10) & (EW'=16) & (EN'=14) + 0.75: (EE'=90) & (ES'=2) & (EW'=4) & (EN'=4); +endmodule + +module initialiseA + ANOT : [0..100] init 0; + ANW : [0..100] init 0; + ASW : [0..100] init 0; + ANE : [0..100] init 0; + ASE : [0..100] init 0; + [start] true -> 0.8: (ANOT'=20) & (ANW'=20) & (ASW'=20) & (ANE'=20) & (ASE'=20) + + 0.2: (ANOT'=25) & (ANW'=25) & (ASW'=25) & (ANE'=0) & (ASE'=25); +endmodule + + +module arbiter + phase : [0..3] init 0; + [start] phase = 0 -> (phase'=1); + [steer] phase = 1 -> (phase'=2); + [lost] phase = 1 -> (phase'=1); + [north] phase = 2 -> (phase'=3); + [south] phase = 2 -> (phase'=3); + [east] phase = 2 -> (phase'=3); + [west] phase = 2 -> (phase'=3); + [extern] phase = 3 -> (phase'=1); + +endmodule + +const int MAXQ = 6; +const int MAXX = MAXQ; +const int MAXY = MAXQ; +formula dead = (x = 0 | y = 0 | x = MAXX | y = MAXY); + + +hole int M11 in {1,2,3,4}; +hole int M12 in {1,2,3,4}; +hole int M13 in {1,2,3,4}; +hole int M14 in {1,2,3,4}; +hole int M15 in {1,2,3,4}; + +hole int M21 in {1,2,3,4}; +hole int M22 in {1,2,3,4}; +hole int M23 in {1,2,3,4}; +hole int M24 in {1,2,3,4}; +hole int M25 in {1,2,3,4}; + +hole int M31 in {1,2,3,4}; +hole int M32 in {1,2,3,4}; +hole int M33 in {1,2,3,4}; +hole int M34 in {1,2,3,4}; +hole int M35 in {1,2,3,4}; + +hole int M41 in {1,2,3,4}; +hole int M42 in {1,2,3,4}; +hole int M43 in {1,2,3,4}; +hole int M44 in {1,2,3,4}; +hole int M45 in {1,2,3,4}; + +hole int M51 in {1,2,3,4}; +hole int M52 in {1,2,3,4}; +hole int M53 in {1,2,3,4}; +hole int M54 in {1,2,3,4}; +hole int M55 in {1,2,3,4}; + + + +module strategy + act : [0..4] init 0; + + [lost] dead -> true; + + [steer] act=0 & x = 1 & y = 1 -> (act' = M11); + [steer] act=0 & x = 1 & y = 2 -> (act' = M12); + [steer] act=0 & x = 1 & y = 3 -> (act' = M13); + [steer] act=0 & x = 1 & y = 4 -> (act' = M14); + [steer] act=0 & x = 1 & y = 5 -> (act' = M15); + + [steer] act=0 & x = 2 & y = 1 -> (act' = M21); + [steer] act=0 & x = 2 & y = 2 -> (act' = M22); + [steer] act=0 & x = 2 & y = 3 -> (act' = M23); + [steer] act=0 & x = 2 & y = 4 -> (act' = M24); + [steer] act=0 & x = 2 & y = 5 -> (act' = M25); + + [steer] act=0 & x = 3 & y = 1 -> (act' = M31); + [steer] act=0 & x = 3 & y = 2 -> (act' = M32); + [steer] act=0 & x = 3 & y = 3 -> (act' = M33); + [steer] act=0 & x = 3 & y = 4 -> (act' = M34); + [steer] act=0 & x = 3 & y = 5 -> (act' = M35); + + [steer] act=0 & x = 4 & y = 1 -> (act' = M41); + [steer] act=0 & x = 4 & y = 2 -> (act' = M42); + [steer] act=0 & x = 4 & y = 3 -> (act' = M43); + [steer] act=0 & x = 4 & y = 4 -> (act' = M44); + [steer] act=0 & x = 4 & y = 5 -> (act' = M45); + + [steer] act=0 & x = 5 & y = 1 -> (act' = M51); + [steer] act=0 & x = 5 & y = 2 -> (act' = M52); + [steer] act=0 & x = 5 & y = 3 -> (act' = M53); + [steer] act=0 & x = 5 & y = 4 -> (act' = M54); + [steer] act=0 & x = 5 & y = 5 -> (act' = M55); + + [north] act = 1 -> (act'=0); + [south] act = 2 -> (act'=0); + [west] act = 3 -> (act'=0); + [east] act = 4 -> (act'=0); +endmodule + +module controller + x : [0..MAXX] init MAXX/2; + y : [0..MAXY] init MAXY/2; + + [north] true -> NN/100: (x'=max(0, x-1)) + NS/100: (x'=min(MAXX,x+1)) + NW/100: (y'=max(0,y-1)) + NE/100: (y'=min(MAXY,y+1)); + [south] true -> SN/100: (x'=max(0, x-1)) + SS/100: (x'=min(MAXX,x+1)) + SW/100: (y'=max(0,y-1)) + SE/100: (y'=min(MAXY,y+1)); + [west] true -> WN/100: (x'=max(0, x-1)) + WS/100: (x'=min(MAXX,x+1)) + WW/100: (y'=max(0,y-1)) + WE/100: (y'=min(MAXY,y+1)); + [east] true -> EN/100: (x'=max(0, x-1)) + ES/100: (x'=min(MAXX,x+1)) + EW/100: (y'=max(0,y-1)) + EE/100: (y'=min(MAXY,y+1)); + + [extern] true -> ANOT/100: (x'=x) & (y'=y) + + ANW/100: (x'=max(0, x-1)) & (y'=max(0,y-1)) + + ASW/100: (x'=min(MAXX, x+1)) & (y'=max(0,y-1)) + + ANE/100: (x'=max(0, x-1)) & (y'=min(MAXY,y+1)) + + ASE/100: (x'=min(MAXX, x+1)) & (y'=min(MAXY,y+1)); + +endmodule + +module round_counter + count: [0..CMAX] init 0; + [steer] true -> 1: (count'=min(count+1,CMAX)); +endmodule + +rewards "rounds" + [steer] true : 1; +endrewards + diff --git a/models/tac24/refuel-06-res/sketch.props b/models/tac24/refuel-06-res/sketch.props new file mode 100644 index 000000000..8f7d0f781 --- /dev/null +++ b/models/tac24/refuel-06-res/sketch.props @@ -0,0 +1 @@ +Pmax=?["notbad" U "goal"]; \ No newline at end of file diff --git a/models/tac24/refuel-06-res/sketch.templ b/models/tac24/refuel-06-res/sketch.templ new file mode 100644 index 000000000..695462f51 --- /dev/null +++ b/models/tac24/refuel-06-res/sketch.templ @@ -0,0 +1,542 @@ +dtmc + +const int N = 6; +const int fuelCAP = N-1; +const int axMAX = N; +const int ayMAX = N; +const int axMIN = 0; +const int ayMIN = 0; +const double slippery = 0.3; +const int ob1x = axMAX-1; +const int ob1y = ayMAX-1; +const int rf1x = axMIN; +const int rf1y = ayMIN; +const int rf2x = axMIN + ceil((axMAX - axMIN) / 3); +const int rf2y = ayMIN + ceil((ayMAX - ayMIN) / 3); +const int rf3x = axMIN + floor(2 * (axMAX - axMIN) / 3); +const int rf3y = ayMIN + floor(2 * (ayMAX - ayMIN) / 3); + +formula northenabled = ax != axMIN; +formula southenabled = ax != axMAX; +formula westenabled = ay != ayMIN; +formula eastenabled = ay != ayMAX; +formula done = start & ax = axMAX & ay = ayMAX; +formula crash = (ax = ob1x & ay = ob1y); +formula atStation = (ax = rf1x & ay = rf1y) | (ax = rf2x & ay = rf2y) | (ax = rf3x & ay = rf3y); +formula canRefuel = atStation & fuel < fuelCAP; + + +//observables +//start, fuel +formula cangonorth = northenabled; +formula cangosouth = southenabled; +formula cangowest = westenabled; +formula cangoeast = eastenabled; +formula amdone = done; +formula hascrash = crash; +formula refuelAllowed = canRefuel; +formula o_start = start; +formula o_fuel = fuel; + +//holes +//2-FSC +// +hole int M_0_0_5_0__1_0_1_0__0_0 in {0,1}; +hole int M_1_0_5_0__1_0_1_0__0_0 in {0,1}; +hole int M_0_1_0_0__0_0_1_1__0_0 in {0,1}; +hole int M_1_1_0_0__0_0_1_1__0_0 in {0,1}; +hole int M_0_1_0_0__0_1_1_1__0_0 in {0,1}; +hole int M_1_1_0_0__0_1_1_1__0_0 in {0,1}; +hole int M_0_1_0_0__1_0_1_0__0_1 in {0,1}; +hole int M_1_1_0_0__1_0_1_0__0_1 in {0,1}; +hole int M_0_1_0_0__1_0_1_1__0_0 in {0,1}; +hole int M_1_1_0_0__1_0_1_1__0_0 in {0,1}; +hole int M_0_1_0_0__1_1_0_0__0_0 in {0,1}; +hole int M_1_1_0_0__1_1_0_0__0_0 in {0,1}; +hole int M_0_1_0_0__1_1_0_1__0_0 in {0,1}; +hole int M_1_1_0_0__1_1_0_1__0_0 in {0,1}; +hole int M_0_1_0_0__1_1_1_0__0_0 in {0,1}; +hole int M_1_1_0_0__1_1_1_0__0_0 in {0,1}; +hole int M_0_1_0_0__1_1_1_1__0_0 in {0,1}; +hole int M_1_1_0_0__1_1_1_1__0_0 in {0,1}; +hole int M_0_1_0_0__1_1_1_1__0_1 in {0,1}; +hole int M_1_1_0_0__1_1_1_1__0_1 in {0,1}; +hole int M_0_1_0_0__1_1_1_1__1_0 in {0,1}; +hole int M_1_1_0_0__1_1_1_1__1_0 in {0,1}; +hole int M_0_1_1_0__0_0_1_1__0_0 in {0,1}; +hole int M_1_1_1_0__0_0_1_1__0_0 in {0,1}; +hole int M_0_1_1_0__0_1_1_1__0_0 in {0,1}; +hole int M_1_1_1_0__0_1_1_1__0_0 in {0,1}; +hole int M_0_1_1_0__1_0_1_0__0_1 in {0,1}; +hole int M_1_1_1_0__1_0_1_0__0_1 in {0,1}; +hole int M_0_1_1_0__1_0_1_1__0_0 in {0,1}; +hole int M_1_1_1_0__1_0_1_1__0_0 in {0,1}; +hole int M_0_1_1_0__1_1_0_0__0_0 in {0,1}; +hole int M_1_1_1_0__1_1_0_0__0_0 in {0,1}; +hole int M_0_1_1_0__1_1_0_1__0_0 in {0,1}; +hole int M_1_1_1_0__1_1_0_1__0_0 in {0,1}; +hole int M_0_1_1_0__1_1_1_0__0_0 in {0,1}; +hole int M_1_1_1_0__1_1_1_0__0_0 in {0,1}; +hole int M_0_1_1_0__1_1_1_1__0_0 in {0,1}; +hole int M_1_1_1_0__1_1_1_1__0_0 in {0,1}; +hole int M_0_1_1_0__1_1_1_1__0_1 in {0,1}; +hole int M_1_1_1_0__1_1_1_1__0_1 in {0,1}; +hole int M_0_1_1_0__1_1_1_1__1_0 in {0,1}; +hole int M_1_1_1_0__1_1_1_1__1_0 in {0,1}; +hole int M_0_1_2_0__0_0_1_1__0_0 in {0,1}; +hole int M_1_1_2_0__0_0_1_1__0_0 in {0,1}; +hole int M_0_1_2_0__0_1_1_1__0_0 in {0,1}; +hole int M_1_1_2_0__0_1_1_1__0_0 in {0,1}; +hole int M_0_1_2_0__1_0_1_0__0_1 in {0,1}; +hole int M_1_1_2_0__1_0_1_0__0_1 in {0,1}; +hole int M_0_1_2_0__1_0_1_1__0_0 in {0,1}; +hole int M_1_1_2_0__1_0_1_1__0_0 in {0,1}; +hole int M_0_1_2_0__1_1_0_0__0_0 in {0,1}; +hole int M_1_1_2_0__1_1_0_0__0_0 in {0,1}; +hole int M_0_1_2_0__1_1_0_1__0_0 in {0,1}; +hole int M_1_1_2_0__1_1_0_1__0_0 in {0,1}; +hole int M_0_1_2_0__1_1_1_0__0_0 in {0,1}; +hole int M_1_1_2_0__1_1_1_0__0_0 in {0,1}; +hole int M_0_1_2_0__1_1_1_1__0_0 in {0,1}; +hole int M_1_1_2_0__1_1_1_1__0_0 in {0,1}; +hole int M_0_1_2_0__1_1_1_1__0_1 in {0,1}; +hole int M_1_1_2_0__1_1_1_1__0_1 in {0,1}; +hole int M_0_1_2_0__1_1_1_1__1_0 in {0,1}; +hole int M_1_1_2_0__1_1_1_1__1_0 in {0,1}; +hole int M_0_1_3_0__0_1_1_1__0_0 in {0,1}; +hole int M_1_1_3_0__0_1_1_1__0_0 in {0,1}; +hole int M_0_1_3_0__1_0_1_0__0_1 in {0,1}; +hole int M_1_1_3_0__1_0_1_0__0_1 in {0,1}; +hole int M_0_1_3_0__1_0_1_1__0_0 in {0,1}; +hole int M_1_1_3_0__1_0_1_1__0_0 in {0,1}; +hole int M_0_1_3_0__1_1_0_1__0_0 in {0,1}; +hole int M_1_1_3_0__1_1_0_1__0_0 in {0,1}; +hole int M_0_1_3_0__1_1_1_0__0_0 in {0,1}; +hole int M_1_1_3_0__1_1_1_0__0_0 in {0,1}; +hole int M_0_1_3_0__1_1_1_1__0_0 in {0,1}; +hole int M_1_1_3_0__1_1_1_1__0_0 in {0,1}; +hole int M_0_1_3_0__1_1_1_1__0_1 in {0,1}; +hole int M_1_1_3_0__1_1_1_1__0_1 in {0,1}; +hole int M_0_1_3_0__1_1_1_1__1_0 in {0,1}; +hole int M_1_1_3_0__1_1_1_1__1_0 in {0,1}; +hole int M_0_1_4_0__0_1_1_1__0_0 in {0,1}; +hole int M_1_1_4_0__0_1_1_1__0_0 in {0,1}; +hole int M_0_1_4_0__1_0_1_1__0_0 in {0,1}; +hole int M_1_1_4_0__1_0_1_1__0_0 in {0,1}; +hole int M_0_1_4_0__1_1_0_1__0_0 in {0,1}; +hole int M_1_1_4_0__1_1_0_1__0_0 in {0,1}; +hole int M_0_1_4_0__1_1_1_0__0_0 in {0,1}; +hole int M_1_1_4_0__1_1_1_0__0_0 in {0,1}; +hole int M_0_1_4_0__1_1_1_1__0_0 in {0,1}; +hole int M_1_1_4_0__1_1_1_1__0_0 in {0,1}; +hole int M_0_1_5_0__1_0_1_0__0_0 in {0,1}; +hole int M_1_1_5_0__1_0_1_0__0_0 in {0,1}; +hole int M_0_1_5_0__1_1_1_1__0_0 in {0,1}; +hole int M_1_1_5_0__1_1_1_1__0_0 in {0,1}; +hole int M_0_1_0_1__0_1_0_1__0_0 in {0}; +hole int M_0_1_1_1__0_1_0_1__0_0 in {0}; +hole int M_0_1_2_1__0_1_0_1__0_0 in {0}; +hole int M_0_1_3_1__0_1_0_1__0_0 in {0}; + + +hole int P_0_0_5_0__1_0_1_0__0_0 in {7}; +hole int P_1_0_5_0__1_0_1_0__0_0 in {7}; +hole int P_0_1_0_0__0_0_1_1__0_0 in {6}; +hole int P_1_1_0_0__0_0_1_1__0_0 in {6}; +hole int P_0_1_0_0__0_1_1_1__0_0 in {6}; +hole int P_1_1_0_0__0_1_1_1__0_0 in {6}; +hole int P_0_1_0_0__1_0_1_0__0_1 in {5}; +hole int P_1_1_0_0__1_0_1_0__0_1 in {5}; +hole int P_0_1_0_0__1_0_1_1__0_0 in {6}; +hole int P_1_1_0_0__1_0_1_1__0_0 in {6}; +hole int P_0_1_0_0__1_1_0_0__0_0 in {6}; +hole int P_1_1_0_0__1_1_0_0__0_0 in {6}; +hole int P_0_1_0_0__1_1_0_1__0_0 in {6}; +hole int P_1_1_0_0__1_1_0_1__0_0 in {6}; +hole int P_0_1_0_0__1_1_1_0__0_0 in {6}; +hole int P_1_1_0_0__1_1_1_0__0_0 in {6}; +hole int P_0_1_0_0__1_1_1_1__0_0 in {6}; +hole int P_1_1_0_0__1_1_1_1__0_0 in {6}; +hole int P_0_1_0_0__1_1_1_1__0_1 in {5}; +hole int P_1_1_0_0__1_1_1_1__0_1 in {5}; +hole int P_0_1_0_0__1_1_1_1__1_0 in {6}; +hole int P_1_1_0_0__1_1_1_1__1_0 in {6}; +hole int P_0_1_1_0__0_0_1_1__0_0 in {2,3,4}; +hole int P_1_1_1_0__0_0_1_1__0_0 in {2,3,4}; +hole int P_0_1_1_0__0_1_1_1__0_0 in {2,3,4}; +hole int P_1_1_1_0__0_1_1_1__0_0 in {2,3,4}; +hole int P_0_1_1_0__1_0_1_0__0_1 in {5}; +hole int P_1_1_1_0__1_0_1_0__0_1 in {5}; +hole int P_0_1_1_0__1_0_1_1__0_0 in {2,3,4}; +hole int P_1_1_1_0__1_0_1_1__0_0 in {2,3,4}; +hole int P_0_1_1_0__1_1_0_0__0_0 in {2}; +hole int P_1_1_1_0__1_1_0_0__0_0 in {2}; +hole int P_0_1_1_0__1_1_0_1__0_0 in {2}; +hole int P_1_1_1_0__1_1_0_1__0_0 in {2}; +hole int P_0_1_1_0__1_1_1_0__0_0 in {2,3,4}; +hole int P_1_1_1_0__1_1_1_0__0_0 in {2,3,4}; +hole int P_0_1_1_0__1_1_1_1__0_0 in {2,3,4}; +hole int P_1_1_1_0__1_1_1_1__0_0 in {2,3,4}; +hole int P_0_1_1_0__1_1_1_1__0_1 in {5}; +hole int P_1_1_1_0__1_1_1_1__0_1 in {5}; +hole int P_0_1_1_0__1_1_1_1__1_0 in {0}; +hole int P_1_1_1_0__1_1_1_1__1_0 in {0}; +hole int P_0_1_2_0__0_0_1_1__0_0 in {2,3,4}; +hole int P_1_1_2_0__0_0_1_1__0_0 in {2,3,4}; +hole int P_0_1_2_0__0_1_1_1__0_0 in {2,3,4}; +hole int P_1_1_2_0__0_1_1_1__0_0 in {2,3,4}; +hole int P_0_1_2_0__1_0_1_0__0_1 in {5}; +hole int P_1_1_2_0__1_0_1_0__0_1 in {5}; +hole int P_0_1_2_0__1_0_1_1__0_0 in {2}; +hole int P_1_1_2_0__1_0_1_1__0_0 in {2}; +hole int P_0_1_2_0__1_1_0_0__0_0 in {2,3,4}; +hole int P_1_1_2_0__1_1_0_0__0_0 in {2,3,4}; +hole int P_0_1_2_0__1_1_0_1__0_0 in {2,3,4}; +hole int P_1_1_2_0__1_1_0_1__0_0 in {2,3,4}; +hole int P_0_1_2_0__1_1_1_0__0_0 in {2}; +hole int P_1_1_2_0__1_1_1_0__0_0 in {3}; +hole int P_0_1_2_0__1_1_1_1__0_0 in {2}; +hole int P_1_1_2_0__1_1_1_1__0_0 in {1}; +hole int P_0_1_2_0__1_1_1_1__0_1 in {5}; +hole int P_1_1_2_0__1_1_1_1__0_1 in {5}; +hole int P_0_1_2_0__1_1_1_1__1_0 in {0}; +hole int P_1_1_2_0__1_1_1_1__1_0 in {0}; +hole int P_0_1_3_0__0_1_1_1__0_0 in {4}; +hole int P_1_1_3_0__0_1_1_1__0_0 in {4}; +hole int P_0_1_3_0__1_0_1_0__0_1 in {5}; +hole int P_1_1_3_0__1_0_1_0__0_1 in {5}; +hole int P_0_1_3_0__1_0_1_1__0_0 in {2,3,4}; +hole int P_1_1_3_0__1_0_1_1__0_0 in {2,3,4}; +hole int P_0_1_3_0__1_1_0_1__0_0 in {2,3,4}; +hole int P_1_1_3_0__1_1_0_1__0_0 in {2,3,4}; +hole int P_0_1_3_0__1_1_1_0__0_0 in {2}; +hole int P_1_1_3_0__1_1_1_0__0_0 in {2}; +hole int P_0_1_3_0__1_1_1_1__0_0 in {4}; +hole int P_1_1_3_0__1_1_1_1__0_0 in {1}; +hole int P_0_1_3_0__1_1_1_1__0_1 in {5}; +hole int P_1_1_3_0__1_1_1_1__0_1 in {5}; +hole int P_0_1_3_0__1_1_1_1__1_0 in {0}; +hole int P_1_1_3_0__1_1_1_1__1_0 in {0}; +hole int P_0_1_4_0__0_1_1_1__0_0 in {4}; +hole int P_1_1_4_0__0_1_1_1__0_0 in {4}; +hole int P_0_1_4_0__1_0_1_1__0_0 in {2,3,4}; +hole int P_1_1_4_0__1_0_1_1__0_0 in {2,3,4}; +hole int P_0_1_4_0__1_1_0_1__0_0 in {2,3,4}; +hole int P_1_1_4_0__1_1_0_1__0_0 in {2,3,4}; +hole int P_0_1_4_0__1_1_1_0__0_0 in {2}; +hole int P_1_1_4_0__1_1_1_0__0_0 in {2}; +hole int P_0_1_4_0__1_1_1_1__0_0 in {1}; +hole int P_1_1_4_0__1_1_1_1__0_0 in {4}; +hole int P_0_1_5_0__1_0_1_0__0_0 in {2}; +hole int P_1_1_5_0__1_0_1_0__0_0 in {2}; +hole int P_0_1_5_0__1_1_1_1__0_0 in {2,3,4}; +hole int P_1_1_5_0__1_1_1_1__0_0 in {2,3,4}; +hole int P_0_1_0_1__0_1_0_1__0_0 in {0}; +hole int P_0_1_1_1__0_1_0_1__0_0 in {0}; +hole int P_0_1_2_1__0_1_0_1__0_0 in {0}; +hole int P_0_1_3_1__0_1_0_1__0_0 in {0}; + + +// !start & fuel=5 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false + +// start & fuel=0 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=0 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true +// start & fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false + +// start & fuel=1 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true +// start & fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false + +// start & fuel=2 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true +// start & fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false + +// start & fuel=3 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=3 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true +// start & fuel=3 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true +// start & fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false + +// start & fuel=4 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=4 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false + +// start & fuel=5 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false +// start & fuel=5 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false + +// start & fuel=0 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=1 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=2 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false +// start & fuel=3 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false + + +// 0 - choosing +// 1 - north +// 2 - south +// 3 - west +// 4 - east +// 5 - refuel +// 6 - empty +// 7 - placement +module strategy + pick : [0..4] init 0; + mem : [0..1] init 0; + + [p] pick=0 & mem=0 & o_start=false & o_fuel=5 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_0_5_0__1_0_1_0__0_0) & (pick'=P_0_0_5_0__1_0_1_0__0_0); + [p] pick=0 & mem=1 & o_start=false & o_fuel=5 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_0_5_0__1_0_1_0__0_0) & (pick'=P_1_0_5_0__1_0_1_0__0_0); + + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_0__0_0_1_1__0_0) & (pick'=P_0_1_0_0__0_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_0_0__0_0_1_1__0_0) & (pick'=P_1_1_0_0__0_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_0__0_1_1_1__0_0) & (pick'=P_0_1_0_0__0_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_0_0__0_1_1_1__0_0) & (pick'=P_1_1_0_0__0_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_0_0__1_0_1_0__0_1) & (pick'=P_0_1_0_0__1_0_1_0__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_0_0__1_0_1_0__0_1) & (pick'=P_1_1_0_0__1_0_1_0__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_0__1_0_1_1__0_0) & (pick'=P_0_1_0_0__1_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_0_0__1_0_1_1__0_0) & (pick'=P_1_1_0_0__1_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_0__1_1_0_0__0_0) & (pick'=P_0_1_0_0__1_1_0_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_0_0__1_1_0_0__0_0) & (pick'=P_1_1_0_0__1_1_0_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_0__1_1_0_1__0_0) & (pick'=P_0_1_0_0__1_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_0_0__1_1_0_1__0_0) & (pick'=P_1_1_0_0__1_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_0__1_1_1_0__0_0) & (pick'=P_0_1_0_0__1_1_1_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_0_0__1_1_1_0__0_0) & (pick'=P_1_1_0_0__1_1_1_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_0__1_1_1_1__0_0) & (pick'=P_0_1_0_0__1_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_0_0__1_1_1_1__0_0) & (pick'=P_1_1_0_0__1_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_0_0__1_1_1_1__0_1) & (pick'=P_0_1_0_0__1_1_1_1__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_0_0__1_1_1_1__0_1) & (pick'=P_1_1_0_0__1_1_1_1__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_0_1_0_0__1_1_1_1__1_0) & (pick'=P_0_1_0_0__1_1_1_1__1_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_1_1_0_0__1_1_1_1__1_0) & (pick'=P_1_1_0_0__1_1_1_1__1_0); + + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_0__0_0_1_1__0_0) & (pick'=P_0_1_1_0__0_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_1_0__0_0_1_1__0_0) & (pick'=P_1_1_1_0__0_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_0__0_1_1_1__0_0) & (pick'=P_0_1_1_0__0_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_1_0__0_1_1_1__0_0) & (pick'=P_1_1_1_0__0_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_1_0__1_0_1_0__0_1) & (pick'=P_0_1_1_0__1_0_1_0__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_1_0__1_0_1_0__0_1) & (pick'=P_1_1_1_0__1_0_1_0__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_0__1_0_1_1__0_0) & (pick'=P_0_1_1_0__1_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_1_0__1_0_1_1__0_0) & (pick'=P_1_1_1_0__1_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_0__1_1_0_0__0_0) & (pick'=P_0_1_1_0__1_1_0_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_1_0__1_1_0_0__0_0) & (pick'=P_1_1_1_0__1_1_0_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_0__1_1_0_1__0_0) & (pick'=P_0_1_1_0__1_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_1_0__1_1_0_1__0_0) & (pick'=P_1_1_1_0__1_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_0__1_1_1_0__0_0) & (pick'=P_0_1_1_0__1_1_1_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_1_0__1_1_1_0__0_0) & (pick'=P_1_1_1_0__1_1_1_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_0__1_1_1_1__0_0) & (pick'=P_0_1_1_0__1_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_1_0__1_1_1_1__0_0) & (pick'=P_1_1_1_0__1_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_1_0__1_1_1_1__0_1) & (pick'=P_0_1_1_0__1_1_1_1__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_1_0__1_1_1_1__0_1) & (pick'=P_1_1_1_0__1_1_1_1__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_0_1_1_0__1_1_1_1__1_0) & (pick'=P_0_1_1_0__1_1_1_1__1_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_1_1_1_0__1_1_1_1__1_0) & (pick'=P_1_1_1_0__1_1_1_1__1_0); + + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_0__0_0_1_1__0_0) & (pick'=P_0_1_2_0__0_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=false & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_2_0__0_0_1_1__0_0) & (pick'=P_1_1_2_0__0_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_0__0_1_1_1__0_0) & (pick'=P_0_1_2_0__0_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_2_0__0_1_1_1__0_0) & (pick'=P_1_1_2_0__0_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_2_0__1_0_1_0__0_1) & (pick'=P_0_1_2_0__1_0_1_0__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_2_0__1_0_1_0__0_1) & (pick'=P_1_1_2_0__1_0_1_0__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_0__1_0_1_1__0_0) & (pick'=P_0_1_2_0__1_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_2_0__1_0_1_1__0_0) & (pick'=P_1_1_2_0__1_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_0__1_1_0_0__0_0) & (pick'=P_0_1_2_0__1_1_0_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_2_0__1_1_0_0__0_0) & (pick'=P_1_1_2_0__1_1_0_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_0__1_1_0_1__0_0) & (pick'=P_0_1_2_0__1_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_2_0__1_1_0_1__0_0) & (pick'=P_1_1_2_0__1_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_0__1_1_1_0__0_0) & (pick'=P_0_1_2_0__1_1_1_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_2_0__1_1_1_0__0_0) & (pick'=P_1_1_2_0__1_1_1_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_0__1_1_1_1__0_0) & (pick'=P_0_1_2_0__1_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_2_0__1_1_1_1__0_0) & (pick'=P_1_1_2_0__1_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_2_0__1_1_1_1__0_1) & (pick'=P_0_1_2_0__1_1_1_1__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_2_0__1_1_1_1__0_1) & (pick'=P_1_1_2_0__1_1_1_1__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_0_1_2_0__1_1_1_1__1_0) & (pick'=P_0_1_2_0__1_1_1_1__1_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_1_1_2_0__1_1_1_1__1_0) & (pick'=P_1_1_2_0__1_1_1_1__1_0); + + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_3_0__0_1_1_1__0_0) & (pick'=P_0_1_3_0__0_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_3_0__0_1_1_1__0_0) & (pick'=P_1_1_3_0__0_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_3_0__1_0_1_0__0_1) & (pick'=P_0_1_3_0__1_0_1_0__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_3_0__1_0_1_0__0_1) & (pick'=P_1_1_3_0__1_0_1_0__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_3_0__1_0_1_1__0_0) & (pick'=P_0_1_3_0__1_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_3_0__1_0_1_1__0_0) & (pick'=P_1_1_3_0__1_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_3_0__1_1_0_1__0_0) & (pick'=P_0_1_3_0__1_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_3_0__1_1_0_1__0_0) & (pick'=P_1_1_3_0__1_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_3_0__1_1_1_0__0_0) & (pick'=P_0_1_3_0__1_1_1_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_3_0__1_1_1_0__0_0) & (pick'=P_1_1_3_0__1_1_1_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_3_0__1_1_1_1__0_0) & (pick'=P_0_1_3_0__1_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_3_0__1_1_1_1__0_0) & (pick'=P_1_1_3_0__1_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_0_1_3_0__1_1_1_1__0_1) & (pick'=P_0_1_3_0__1_1_1_1__0_1); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=true -> (mem'=M_1_1_3_0__1_1_1_1__0_1) & (pick'=P_1_1_3_0__1_1_1_1__0_1); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_0_1_3_0__1_1_1_1__1_0) & (pick'=P_0_1_3_0__1_1_1_1__1_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=true & refuelAllowed=false -> (mem'=M_1_1_3_0__1_1_1_1__1_0) & (pick'=P_1_1_3_0__1_1_1_1__1_0); + + + [p] pick=0 & mem=0 & o_start=true & o_fuel=4 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_4_0__0_1_1_1__0_0) & (pick'=P_0_1_4_0__0_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=4 & amdone=false & cangoeast=false & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_4_0__0_1_1_1__0_0) & (pick'=P_1_1_4_0__0_1_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_4_0__1_0_1_1__0_0) & (pick'=P_0_1_4_0__1_0_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_4_0__1_0_1_1__0_0) & (pick'=P_1_1_4_0__1_0_1_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_4_0__1_1_0_1__0_0) & (pick'=P_0_1_4_0__1_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_4_0__1_1_0_1__0_0) & (pick'=P_1_1_4_0__1_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_4_0__1_1_1_0__0_0) & (pick'=P_0_1_4_0__1_1_1_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_4_0__1_1_1_0__0_0) & (pick'=P_1_1_4_0__1_1_1_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_4_0__1_1_1_1__0_0) & (pick'=P_0_1_4_0__1_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=4 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_4_0__1_1_1_1__0_0) & (pick'=P_1_1_4_0__1_1_1_1__0_0); + + + [p] pick=0 & mem=0 & o_start=true & o_fuel=5 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_5_0__1_0_1_0__0_0) & (pick'=P_0_1_5_0__1_0_1_0__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=5 & amdone=false & cangoeast=true & cangonorth=false & cangosouth=true & cangowest=false & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_5_0__1_0_1_0__0_0) & (pick'=P_1_1_5_0__1_0_1_0__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=5 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_5_0__1_1_1_1__0_0) & (pick'=P_0_1_5_0__1_1_1_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=5 & amdone=false & cangoeast=true & cangonorth=true & cangosouth=true & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_1_1_5_0__1_1_1_1__0_0) & (pick'=P_1_1_5_0__1_1_1_1__0_0); + + + [p] pick=0 & mem=0 & o_start=true & o_fuel=0 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_1__0_1_0_1__0_0) & (pick'=P_0_1_0_1__0_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=0 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_0_1__0_1_0_1__0_0) & (pick'=P_0_1_0_1__0_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=1 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_1__0_1_0_1__0_0) & (pick'=P_0_1_1_1__0_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=1 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_1_1__0_1_0_1__0_0) & (pick'=P_0_1_1_1__0_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=2 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_1__0_1_0_1__0_0) & (pick'=P_0_1_2_1__0_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=2 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_2_1__0_1_0_1__0_0) & (pick'=P_0_1_2_1__0_1_0_1__0_0); + + [p] pick=0 & mem=0 & o_start=true & o_fuel=3 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_3_1__0_1_0_1__0_0) & (pick'=P_0_1_3_1__0_1_0_1__0_0); + [p] pick=0 & mem=1 & o_start=true & o_fuel=3 & amdone=true & cangoeast=false & cangonorth=true & cangosouth=false & cangowest=true & hascrash=false & refuelAllowed=false -> (mem'=M_0_1_3_1__0_1_0_1__0_0) & (pick'=P_0_1_3_1__0_1_0_1__0_0); + + + [north] pick=1 -> (pick'=0); + [south] pick=2 -> (pick'=0); + [west] pick=3 -> (pick'=0); + [east] pick=4 -> (pick'=0); + [refuel] pick=5 -> (pick'=0); + [empty] pick=6 -> (pick'=0); + [placement] pick=7 -> (pick'=0); + +endmodule + + + + + +module master + start : bool init false; + + [placement] !start -> (start'=true); + [north] start & !done -> true; + [south] start & !done -> true; + [east] start & !done-> true; + [west] start & !done -> true; + + +endmodule + + +module tank + fuel : [0..fuelCAP] init fuelCAP; + + [refuel] canRefuel -> 1:(fuel'=fuelCAP); + [north] fuel > 0 & !canRefuel -> 1:(fuel'=fuel-1); + [south] fuel > 0 & !canRefuel -> 1:(fuel'=fuel-1); + [east] fuel > 0 & !canRefuel -> 1:(fuel'=fuel-1); + [west] fuel > 0 & !canRefuel -> 1:(fuel'=fuel-1); + [empty] fuel = 0 & !canRefuel -> 1:(fuel'=0); +endmodule + +module alice + ax : [axMIN..axMAX] init 0; + ay : [ayMIN..ayMAX] init 0; + + [placement] true -> 1: (ax'=0) & (ay'=0); //+ 1/4: (ax'=1) & (ay'=1) + 1/4: (ax'=2) & (ay'=1) + 1/4: (ax'=1) & (ay'=3); + + [west] northenabled -> (1-slippery): (ax'=max(ax-1,axMIN)) + slippery: (ax'=max(ax-2,axMIN)); + [east] southenabled -> (1-slippery): (ax'=min(ax+1,axMAX)) + slippery: (ax'=min(ax+2,axMAX)); + [south] eastenabled -> (1-slippery): (ay'=min(ay+1,ayMAX)) + slippery: (ay'=min(ay+2,ayMAX)); + [north] westenabled -> (1-slippery): (ay'=max(ay-1,ayMIN)) + slippery: (ay'=max(ay-2,ayMIN)); +endmodule + +rewards "steps" + [north] true : 1; + [south] true : 1; + [west] true : 1; + [east] true : 1; +endrewards + +rewards "refuels" + [refuel] true : 1; +endrewards + +rewards "costs" + [north] true : 1; + [south] true : 1; + [west] true : 1; + [east] true : 1; + [refuel] true : 3; +endrewards + + +label "goal" = done; +label "traps" = crash; +label "stationvisit" = atStation; +label "notbad" = !crash & (fuel > 0 | canRefuel);