smg
const double p=0.5;
const double accu_load1;
const double accu_load2;
const double fd;
const int COUNTER;
const double del;
global stop : bool init false;
global c:[0..3] init 0;
formula roz = (r=8) | (w=3&a=1) | (w=3&a=2) | (w=5&a=2);
global pl : [1..2] init 1;
player p1
UAV, [camera], [fly], [delegated], [uav_stop]
endplayer
player p2
operator, [image], [process], [wait], [delegate], [prescribe], [operator_stop]
endplayer
module operator
k:[0..100] init 0;
t:[0..2] init 0;
s:[0..2] init 0;
q:[0..2] init 2;
[image] !stop & t=0 & s=0 -> (1-p):(t'=1) & (s'=0) + p:(t'=2) & (s'=0);
[process] !stop & pl=2 & t=1 & s=0 & k<=COUNTER -> accu_load1:(s'=1)&(k'=k+1) + (1-accu_load1):(s'=2)&(k'=k+1);
[process] !stop & pl=2 & t=1 & s=0 & k>COUNTER -> accu_load1*fd:(s'=1) + (1-accu_load1*fd):(s'=2);
[process] !stop & pl=2 & t=2 & s=0 & k<=COUNTER -> accu_load2:(s'=1)&(k'=k+1) + (1-accu_load2):(s'=2)&(k'=k+1);
[process] !stop & pl=2 & t=2 & s=0 & k>COUNTER -> accu_load2*fd:(s'=1) + (1-accu_load2*fd):(s'=1);
[wait] !stop & pl=2 & s=2 -> (pl'=1) & (t'=0) & (s'=0);
[] !stop & pl=2 & s=1 & (w=2 | w=5 | w=6) & (q=2) -> del : (q'=0) + (1-del) : (q'=1);
[delegate] !stop & pl=2 & s=1 & (w=2 | w=5 | w=6) & (q=0) -> (pl'=1) & (t'=0) & (s'=0) & (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=2 & (q=1) -> (pl'=1) & (c'=3) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=2 & (q=1) -> (pl'=1) & (c'=2) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=2 & (q=1)-> (pl'=1) & (c'=1) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=2 & (q=1)-> (pl'=1) & (c'=0) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=5 & (q=1)-> (pl'=1) & (c'=2) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=5 & (q=1)-> (pl'=1) & (c'=1) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=5 & (q=1)-> (pl'=1) & (c'=0) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=6 & (q=1)-> (pl'=1) & (c'=2) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=6 & (q=1)-> (pl'=1) & (c'=1) & (t'=0) & (s'=0)& (q'=2);
[prescribe] !stop & pl=2 & s=1 & w=6 & (q=1)-> (pl'=1) & (c'=0) & (t'=0) & (s'=0)& (q'=2);
[delegate] !stop & pl=2 & s=1 & (w!=2 & w!=5 & w!=6) -> (pl'=1) & (t'=0) & (s'=0);
[operator_stop] stop & pl=2 -> true;
endmodule
module UAV
w:[0..6] init 1;
r:[0..9] init 0;
send: bool init true;
in: bool init true;
w1: bool init true;
w2: bool init false;
w3: bool init false;
w4: bool init false;
w5: bool init false;
w6: bool init false;
delegated: bool init false;
[image] pl=1 & w!=0 & a=0 & r=0 & send -> (pl'=2) & (send'=false);
[wait] !send -> (send'=true);
[camera] pl=1 & w=1 & a!=0 & r=0 & in & !delegated -> (send'=true) & (w1'=true);
[camera] pl=1 & w=2 & a!=0 & r=0 & in & !delegated -> (send'=true) & (w2'=true);
[camera] pl=1 & w=3 & a!=0 & r=0 & in & !delegated -> (send'=true) & (w3'=true);
[camera] pl=1 & w=4 & a!=0 & r=0 & in & !delegated -> (send'=true) & (w4'=true);
[camera] pl=1 & w=5 & a!=0 & r=0 & in & !delegated -> (send'=true) & (w5'=true);
[camera] pl=1 & w=6 & a!=0 & r=0 & in & !delegated -> (send'=true) & (w6'=true);
[prescribe] w!=0 & a=0 & r=0 -> (in'=false);
[delegate] w!=0 & a=0 & r=0 & (w=2 | w=5 | w=6) -> (delegated'=true);
[delegate] w!=0 & a=0 & r=0 & !(w=2 | w=5 | w=6) -> (in'=false);
[delegated] pl=1 & w=2 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=0) & (delegated'=false);
[delegated] pl=1 & w=2 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=1) & (delegated'=false);
[delegated] pl=1 & w=2 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=2) & (delegated'=false);
[delegated] pl=1 & w=2 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=3) & (delegated'=false);
[fly] pl=1 & c=0 & w=2 & (a!=0) & r=0 & !in -> (r'=5);
[fly] pl=1 & c=1 & w=2 & (a!=0) & r=0 & !in -> (r'=6);
[fly] pl=1 & c=2 & w=2 & (a!=0) & r=0 & !in -> (r'=7);
[fly] pl=1 & c=3 & w=2 & (a!=0) & r=0 & !in -> (r'=9);
[delegated] pl=1 & w=5 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=0) & (delegated'=false);
[delegated] pl=1 & w=5 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=1) & (delegated'=false);
[delegated] pl=1 & w=5 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=2) & (delegated'=false);
[fly] pl=1 & c=0 & w=5 & (a!=0) & r=0 & !in -> (r'=3);
[fly] pl=1 & c=1 & w=5 & (a!=0) & r=0 & !in -> (r'=4);
[fly] pl=1 & c=2 & w=5 & (a!=0) & r=0 & !in -> (w'=4) & (r'=0) & (in'=true);
[delegated] pl=1 & w=6 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=0) & (delegated'=false);
[delegated] pl=1 & w=6 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=1) & (delegated'=false);
[delegated] pl=1 & w=6 & a!=0 & r=0 & delegated=true -> (in'=false) & (c'=2) & (delegated'=false);
[fly] pl=1 & c=0 & w=6 & (a!=0) & r=0 & !in -> (r'=2);
[fly] pl=1 & c=1 & w=6 & (a!=0) & r=0 & !in -> (r'=3);
[fly] pl=1 & c=2 & w=6 & (a!=0) & r=0 & !in -> (r'=8);
[fly] pl=1 & w=1 & (a!=0) & r=0 & !in -> (r'=1);
[fly] pl=1 & w=1 & (a!=0) & r=0 & !in -> (r'=9);
[fly] pl=1 & w=3 & (a!=0) & r=0 & !in -> (r'=6);
[fly] pl=1 & w=3 & (a!=0) & r=0 & !in -> (w'=4) & (r'=0) & (in'=true);
[fly] pl=1 & w=4 & (a!=0) & r=0 & !in -> (w'=3) & (r'=0) & (in'=true);
[fly] pl=1 & w=4 & (a!=0) & r=0 & !in -> (w'=5) & (r'=0) & (in'=true);
[fly] pl=1 & r=1 -> (r'=2);
[fly] pl=1 & r=1 -> (w'=1) & (r'=0) & (in'=true);
[fly] pl=1 & r=2 -> (r'=1);
[fly] pl=1 & r=2 -> (w'=6) & (r'=0) & (in'=true);
[fly] pl=1 & r=3 -> (w'=5) & (r'=0) & (in'=true);
[fly] pl=1 & r=3 -> (w'=6) & (r'=0) & (in'=true);
[fly] pl=1 & r=4 -> (r'=5);
[fly] pl=1 & r=4 -> (w'=5) & (r'=0) & (in'=true);
[fly] pl=1 & r=5 -> (r'=4);
[fly] pl=1 & r=5 -> (w'=2) & (r'=0) & (in'=true);
[fly] pl=1 & r=6 -> (w'=2) & (r'=0) & (in'=true);
[fly] pl=1 & r=6 -> (w'=3) & (r'=0) & (in'=true);
[fly] pl=1 & r=7 -> (w'=2) & (r'=0) & (in'=true);
[fly] pl=1 & r=7 -> (r'=8);
[fly] pl=1 & r=8 -> (w'=6) & (r'=0) & (in'=true);
[fly] pl=1 & r=8 -> (r'=7);
[fly] pl=1 & r=9 -> (w'=1) & (r'=0) & (in'=true);
[fly] pl=1 & r=9 -> (w'=2) & (r'=0) & (in'=true);
[uav_stop] stop & pl=1 -> true;
endmodule
module angle_choice
a:[0..8] init 0;
[prescribe] true -> (a'=1);
[prescribe] true -> (a'=2);
[prescribe] true -> (a'=3);
[prescribe] true -> (a'=4);
[prescribe] true -> (a'=5);
[prescribe] true -> (a'=6);
[prescribe] true -> (a'=7);
[prescribe] true -> (a'=8);
[delegate] true -> (a'=1);
[delegate] true -> (a'=2);
[delegate] true -> (a'=3);
[delegate] true -> (a'=4);
[delegate] true -> (a'=5);
[delegate] true -> (a'=6);
[delegate] true -> (a'=7);
[delegate] true -> (a'=8);
[camera] true -> (a'=0);
endmodule
module waypoint_check
[fly] w1 & w2 & w6 -> (stop'=true);
[camera] w1 & w2 & w6 -> (stop'=true);
[camera] !(w1 & w2 & w6) -> true;
[fly] !(w1 & w2 & w6) -> true;
endmodule
rewards "time"
[wait] true: 10;
[fly] true: 60;
endrewards
rewards "ROZ"
[fly] roz : 1;
endrewards