csg
player p1
mac1
endplayer
player p2
mac2
endplayer
const int smax;
const int emax;
const double q1;
const double q2;
module channel
c : bool;
[t1,w2] true -> q1 : (c'=false) + (1-q1) : (c'=true);
[w1,t2] true -> q1 : (c'=false) + (1-q1) : (c'=true);
[t1,t2] true -> q2 : (c'=false) + (1-q2) : (c'=true);
endmodule
module mac1
s1 : [0..1];
e1 : [0..emax] init emax;
sent1 : [0..smax+1];
[w1] true -> (s1'=0);
[t1] e1>0 -> (s1'=c'?0:1) & (e1'=e1-1) & (sent1'=c'?sent1:(min(sent1+1,smax+1)));
endmodule
module mac2 = mac1 [ s1=s2, e1=e2, sent1=sent2, w1=w2, t1=t2 ] endmodule