mdp
const int N=20;
const int K;
const double old = 1/4;
const double new = (1-old);
const int CONSEC = 2;
const int TRANSTIME = 1;
const int LONGWAIT = 60;
const int TIME_MAX_X = 60;
const int TIME_MAX_Z = 1;
const int MAXCOLL = 10;
formula ip_mess = ip;
module host0
x : [0..TIME_MAX_X];
coll : [0..MAXCOLL];
probes : [0..K];
mess : [0..1];
ip : [1..2];
l : [0..4] init 1;
[reset] l=0 -> (l'=1);
[rec0] (l=1) -> true;
[rec1] (l=1) -> true;
[host] l=1 -> 1/3*old : (l'=2) & (ip'=1) & (x'=0)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=1)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=2)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=0)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=1)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=2);
[time] l=1 & coll=MAXCOLL & x<LONGWAIT -> (x'=min(x+1,TIME_MAX_X));
[host] l=1 & coll=MAXCOLL & x=LONGWAIT -> 1/3*old : (l'=2) & (ip'=1) & (x'=0)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=1)
+ 1/3*old : (l'=2) & (ip'=1) & (x'=2)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=0)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=1)
+ 1/3*new : (l'=2) & (ip'=2) & (x'=2);
[time] l=2 & x<2 -> (x'=min(x+1,2));
[send1] l=2 & ip=1 & x=2 & probes<K -> (x'=0) & (probes'=probes+1);
[send2] l=2 & ip=2 & x=2 & probes<K -> (x'=0) & (probes'=probes+1);
[host] l=2 & x=2 & probes=K -> (l'=3) & (probes'=0) & (coll'=0) & (x'=0);
[rec0] l=2 & ip!=0 -> (l'=l);
[rec1] l=2 & ip!=1 -> (l'=l);
[rec1] l=2 & ip=1 -> (l'=0) & (coll'=min(coll+1,MAXCOLL)) & (x'=0) & (probes'=0);
[time] l=3 & mess=0 & x<CONSEC -> (x'=min(x+1,TIME_MAX_X));
[rec1] l=3 & mess=0 & ip=1 -> (l'=0) & (probes'=0) & (x'=0);
[rec0] l=3 & mess=0 & ip!=0 -> (l'=l);
[rec1] l=3 & mess=0 & ip!=1 -> (l'=l);
[send1] l=3 & ip=1 & mess=1 -> (mess'=0);
[send2] l=3 & ip=2 & mess=1 -> (mess'=0);
[send1] l=3 & ip=1 & mess=0 & x=CONSEC & probes<1 -> (x'=0) & (probes'=probes+1);
[send2] l=3 & ip=2 & mess=0 & x=CONSEC & probes<1 -> (x'=0) & (probes'=probes+1);
[send1] l=3 & ip=1 & mess=0 & x=CONSEC & probes=1 -> (l'=4) & (x'=0) & (probes'=0);
[send2] l=3 & ip=2 & mess=0 & x=CONSEC & probes=1 -> (l'=4) & (x'=0) & (probes'=0);
[host] l=4 -> true;
endmodule
module host_error1
c : [0..2];
s : [0..1];
error1 : [0..1];
[send1] error1=0 & s=0 -> (s'=1) & (c'=0);
[send2] error1=0 & s=0 -> (s'=1) & (c'=0);
[rec0] error1=0 -> (s'=0) & (c'=0);
[rec1] error1=0 -> (s'=0) & (c'=0);
[send1] error1=0 & s=1 -> (error1'=1) & (c'=0);
[send2] error1=0 & s=1 -> (error1'=1) & (c'=0);
[time] s=0 -> true;
[time] error1=0 & s=1 & c<1 -> (c'=c+1);
[time] error1=0 & s=1 & c=1 -> (s'=0) & (c'=0);
[rec1] error1=1 -> true;
[rec1] error1=1 -> true;
[time] error1=1 -> true;
[send1] error1=1 -> true;
[send2] error1=1 -> true;
endmodule
module host_error2
s2 : [0..1];
error2 : [0..1];
[time] error2=0 -> (s2'=0);
[rec1] error2=0 -> (s2'=1);
[reset] error2=0 & s2=0 -> (error2'=1) & (s2'=0);
[reset] error2=0 & s2=1 -> true;
[rec1] error2=1 -> true;
[reset] error2=1 -> true;
[time] error2=1 -> true;
endmodule
module timer
t : [0..1];
[send1] t=0 -> (t'=1);
[send2] t=0 -> (t'=1);
[] t>0 -> (t'=0);
[time] t=0 -> true;
[reset] t=0 -> true;
[rec0] t=0 -> true;
[rec1] t=0 -> true;
[host] t=0 -> true;
endmodule