dtmc
const int N=5;
const int L;
formula kB = ( (a0=L & a5=L)
| (a1=L & a6=L)
| (a2=L & a7=L)
| (a3=L & a8=L)
| (a4=L & a9=L));
formula kA = ( (b0=L & b5=L)
| (b1=L & b6=L)
| (b2=L & b7=L)
| (b3=L & b8=L)
| (b4=L & b9=L));
module protocol
b : [1..L];
n : [0..N-1];
phase : [1..4];
party : [1..2];
[receiveB] phase=1 & party=1 -> (party'=2);
[receiveA] phase=1 & party=2 & n<N-1 -> (party'=1) & (n'=n+1);
[receiveA] phase=1 & party=2 & n=N-1 -> (party'=1) & (phase'=2) & (n'=0);
[receiveB] (phase=2 | phase=3) & party=1 & n<N-1-> (n'=n+1);
[receiveB] (phase=2 | phase=3) & party=1 & n=N-1 -> (party'=2) & (n'=0);
[receiveA] (phase=2 | phase=3) & party=2 & n<N-1 -> (n'=n+1);
[receiveA] phase=2 & party=2 & n=N-1 -> (phase'=3) & (party'=1) & (n'=0);
[receiveA] phase=3 & party=2 & n=N-1 & b<L -> (phase'=2) & (party'=1) & (n'=0) & (b'=b+1);
[receiveA] phase=3 & party=2 & n=N-1 & b=L -> (phase'=4);
[] phase=4 -> (phase'=4);
endmodule
module partyA
b0 : [0..L]; b5 : [0..L];
b1 : [0..L]; b6 : [0..L];
b2 : [0..L]; b7 : [0..L];
b3 : [0..L]; b8 : [0..L];
b4 : [0..L]; b9 : [0..L];
[receiveA] phase=1 & n=0 -> 0.5 : (b0'=L) + 0.5 : (b5'=L);
[receiveA] phase=1 & n=1 -> 0.5 : (b1'=L) + 0.5 : (b6'=L);
[receiveA] phase=1 & n=2 -> 0.5 : (b2'=L) + 0.5 : (b7'=L);
[receiveA] phase=1 & n=3 -> 0.5 : (b3'=L) + 0.5 : (b8'=L);
[receiveA] phase=1 & n=4 -> 0.5 : (b4'=L) + 0.5 : (b9'=L);
[receiveA] phase=2 & n=0 -> (b0'=min(b0+1,L));
[receiveA] phase=2 & n=1 -> (b1'=min(b1+1,L));
[receiveA] phase=2 & n=2 -> (b2'=min(b2+1,L));
[receiveA] phase=2 & n=3 -> (b3'=min(b3+1,L));
[receiveA] phase=2 & n=4 -> (b4'=min(b4+1,L));
[receiveA] phase=3 & n=0 -> (b5'=min(b5+1,L));
[receiveA] phase=3 & n=1 -> (b6'=min(b6+1,L));
[receiveA] phase=3 & n=2 -> (b7'=min(b7+1,L));
[receiveA] phase=3 & n=3 -> (b8'=min(b8+1,L));
[receiveA] phase=3 & n=4 -> (b9'=min(b9+1,L));
endmodule
module partyB=partyA[b0=a0,b1=a1,
b2=a2,b3=a3,
b4=a4,b5=a5,
b6=a6,b7=a7,
b8=a8,b9=a9,
receiveA=receiveB]
endmodule