You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

114 lines
7.6 KiB

mdp
const int COL = 2;
const int ASLOTTIME = 1;
const int DIFS = 3;
const int VULN = 1;
const int TRANS_TIME_MAX = 4;
const int TRANS_TIME_MIN = 4;
const int ACK_TO = 6;
const int ACK = 4;
const int SIFS = 1;
const int TIME_MAX = ((max(6, 4)) + 1);
const int MAX_BACKOFF = 0;
formula busy = ((c1 > 0) | (c2 > 0));
formula free = ((c1 = 0) & (c2 = 0));
module medium
col: [0..2] init 0;
c1: [0..2] init 0;
c2: [0..2] init 0;
[send1] ((c1 = 0) & (c2 = 0)) -> 1 : (c1' = 1);
[send2] ((c2 = 0) & (c1 = 0)) -> 1 : (c2' = 1);
[send1] ((c1 = 0) & (c2 > 0)) -> 1 : (col' = (min((col + 1), 2))) & (c1' = 2) & (c2' = 2);
[send2] ((c2 = 0) & (c1 > 0)) -> 1 : (col' = (min((col + 1), 2))) & (c1' = 2) & (c2' = 2);
[finish1] (c1 > 0) -> 1 : (c1' = 0);
[finish2] (c2 > 0) -> 1 : (c2' = 0);
endmodule
module station1
x1: [0..((max(6, 4)) + 1)] init 0;
s1: [1..12] init 1;
slot1: [0..1] init 0;
backoff1: [0..15] init 0;
bc1: [0..1] init 0;
[time] (((s1 = 1) & (x1 < 3)) & ((c1 = 0) & (c2 = 0))) -> 1 : (x1' = (min((x1 + 1), 7)));
[] ((s1 = 1) & ((x1 = 3) | (x1 = 2))) -> 1 : (x1' = 0) & (s1' = 8);
[] ((s1 = 1) & ((c1 > 0) | (c2 > 0))) -> 1 : (x1' = 0) & (s1' = 2);
[time] ((s1 = 2) & ((c1 > 0) | (c2 > 0))) -> 1 : (s1' = 2);
[] ((s1 = 2) & ((c1 = 0) & (c2 = 0))) -> 1 : (s1' = 3);
[time] (((s1 = 3) & (x1 < 3)) & ((c1 = 0) & (c2 = 0))) -> 1 : (x1' = (min((x1 + 1), 7)));
[] ((s1 = 3) & ((c1 > 0) | (c2 > 0))) -> 1 : (x1' = 0) & (s1' = 2);
[] (((s1 = 3) & ((x1 = 3) | (x1 = 2))) & (bc1 = 0)) -> 1 : (x1' = 0) & (s1' = 4) & (slot1' = 0) & (bc1' = (min((bc1 + 1), 0)));
[] (s1 = 4) -> (1 / 16) : (s1' = 5) & (backoff1' = 0) + (1 / 16) : (s1' = 5) & (backoff1' = 1) + (1 / 16) : (s1' = 5) & (backoff1' = 2) + (1 / 16) : (s1' = 5) & (backoff1' = 3) + (1 / 16) : (s1' = 5) & (backoff1' = 4) + (1 / 16) : (s1' = 5) & (backoff1' = 5) + (1 / 16) : (s1' = 5) & (backoff1' = 6) + (1 / 16) : (s1' = 5) & (backoff1' = 7) + (1 / 16) : (s1' = 5) & (backoff1' = 8) + (1 / 16) : (s1' = 5) & (backoff1' = 9) + (1 / 16) : (s1' = 5) & (backoff1' = 10) + (1 / 16) : (s1' = 5) & (backoff1' = 11) + (1 / 16) : (s1' = 5) & (backoff1' = 12) + (1 / 16) : (s1' = 5) & (backoff1' = 13) + (1 / 16) : (s1' = 5) & (backoff1' = 14) + (1 / 16) : (s1' = 5) & (backoff1' = 15);
[time] (((s1 = 5) & (x1 < 1)) & ((c1 = 0) & (c2 = 0))) -> 1 : (x1' = (min((x1 + 1), 7)));
[] (((s1 = 5) & (x1 = 1)) & (backoff1 > 0)) -> 1 : (x1' = 0) & (s1' = 5) & (backoff1' = (backoff1 - 1));
[] ((((s1 = 5) & (x1 = 1)) & (backoff1 = 0)) & (slot1 > 0)) -> 1 : (x1' = 0) & (s1' = 5) & (slot1' = (slot1 - 1)) & (backoff1' = 15);
[] ((((s1 = 5) & (x1 = 1)) & (backoff1 = 0)) & (slot1 = 0)) -> 1 : (x1' = 0) & (s1' = 8);
[] ((s1 = 5) & ((c1 > 0) | (c2 > 0))) -> 1 : (x1' = 0) & (s1' = 6);
[time] ((s1 = 6) & ((c1 > 0) | (c2 > 0))) -> 1 : (s1' = 6);
[] ((s1 = 6) & ((c1 = 0) & (c2 = 0))) -> 1 : (s1' = 7);
[time] (((s1 = 7) & (x1 < 3)) & ((c1 = 0) & (c2 = 0))) -> 1 : (x1' = (min((x1 + 1), 7)));
[] ((s1 = 7) & ((x1 = 3) | (x1 = 2))) -> 1 : (x1' = 0) & (s1' = 5);
[] ((s1 = 7) & ((c1 > 0) | (c2 > 0))) -> 1 : (x1' = 0) & (s1' = 6);
[time] ((s1 = 8) & (x1 < 1)) -> 1 : (x1' = (min((x1 + 1), 7)));
[send1] ((s1 = 8) & ((x1 = 1) | (x1 = 0))) -> 1 : (x1' = 0) & (s1' = 9);
[time] ((s1 = 9) & (x1 < 4)) -> 1 : (x1' = (min((x1 + 1), 7)));
[finish1] (((s1 = 9) & (x1 >= 4)) & (c1 = 1)) -> 1 : (x1' = 0) & (s1' = 10);
[finish1] (((s1 = 9) & (x1 >= 4)) & (c1 = 2)) -> 1 : (x1' = 0) & (s1' = 11);
[] ((((s1 = 10) & (c1 = 0)) & (x1 = 0)) & ((c1 > 0) | (c2 > 0))) -> 1 : (s1' = 2);
[time] ((((s1 = 10) & (c1 = 0)) & (x1 = 0)) & ((c1 = 0) & (c2 = 0))) -> 1 : (x1' = (min((x1 + 1), 7)));
[send1] (((s1 = 10) & (c1 = 0)) & ((x1 = 1) | ((x1 = 0) & ((c1 = 0) & (c2 = 0))))) -> 1 : (x1' = 0) & (s1' = 10);
[time] (((s1 = 10) & (c1 = 1)) & (x1 < 4)) -> 1 : (x1' = (min((x1 + 1), 7)));
[finish1] (((s1 = 10) & (c1 = 1)) & ((x1 = 4) | (x1 = 3))) -> 1 : (x1' = 0) & (s1' = 12) & (bc1' = 0);
[] (((s1 = 11) & (x1 = 0)) & ((c1 > 0) | (c2 > 0))) -> 1 : (s1' = 2);
[time] (((s1 = 11) & (x1 = 0)) & ((c1 = 0) & (c2 = 0))) -> 1 : (x1' = (min((x1 + 1), 7)));
[time] (((s1 = 11) & (x1 > 0)) & (x1 < 6)) -> 1 : (x1' = (min((x1 + 1), 7)));
[] ((s1 = 11) & (x1 = 6)) -> 1 : (x1' = 0) & (s1' = 3);
[time] (s1 = 12) -> 1 : (s1' = 12);
endmodule
module station2
x2: [0..((max(6, 4)) + 1)] init 0;
s2: [1..12] init 1;
slot2: [0..1] init 0;
backoff2: [0..15] init 0;
bc2: [0..1] init 0;
[time] (((s2 = 1) & (x2 < 3)) & ((c2 = 0) & (c1 = 0))) -> 1 : (x2' = (min((x2 + 1), 7)));
[] ((s2 = 1) & ((x2 = 3) | (x2 = 2))) -> 1 : (x2' = 0) & (s2' = 8);
[] ((s2 = 1) & ((c2 > 0) | (c1 > 0))) -> 1 : (x2' = 0) & (s2' = 2);
[time] ((s2 = 2) & ((c2 > 0) | (c1 > 0))) -> 1 : (s2' = 2);
[] ((s2 = 2) & ((c2 = 0) & (c1 = 0))) -> 1 : (s2' = 3);
[time] (((s2 = 3) & (x2 < 3)) & ((c2 = 0) & (c1 = 0))) -> 1 : (x2' = (min((x2 + 1), 7)));
[] ((s2 = 3) & ((c2 > 0) | (c1 > 0))) -> 1 : (x2' = 0) & (s2' = 2);
[] (((s2 = 3) & ((x2 = 3) | (x2 = 2))) & (bc2 = 0)) -> 1 : (x2' = 0) & (s2' = 4) & (slot2' = 0) & (bc2' = (min((bc2 + 1), 0)));
[] (s2 = 4) -> (1 / 16) : (s2' = 5) & (backoff2' = 0) + (1 / 16) : (s2' = 5) & (backoff2' = 1) + (1 / 16) : (s2' = 5) & (backoff2' = 2) + (1 / 16) : (s2' = 5) & (backoff2' = 3) + (1 / 16) : (s2' = 5) & (backoff2' = 4) + (1 / 16) : (s2' = 5) & (backoff2' = 5) + (1 / 16) : (s2' = 5) & (backoff2' = 6) + (1 / 16) : (s2' = 5) & (backoff2' = 7) + (1 / 16) : (s2' = 5) & (backoff2' = 8) + (1 / 16) : (s2' = 5) & (backoff2' = 9) + (1 / 16) : (s2' = 5) & (backoff2' = 10) + (1 / 16) : (s2' = 5) & (backoff2' = 11) + (1 / 16) : (s2' = 5) & (backoff2' = 12) + (1 / 16) : (s2' = 5) & (backoff2' = 13) + (1 / 16) : (s2' = 5) & (backoff2' = 14) + (1 / 16) : (s2' = 5) & (backoff2' = 15);
[time] (((s2 = 5) & (x2 < 1)) & ((c2 = 0) & (c1 = 0))) -> 1 : (x2' = (min((x2 + 1), 7)));
[] (((s2 = 5) & (x2 = 1)) & (backoff2 > 0)) -> 1 : (x2' = 0) & (s2' = 5) & (backoff2' = (backoff2 - 1));
[] ((((s2 = 5) & (x2 = 1)) & (backoff2 = 0)) & (slot2 > 0)) -> 1 : (x2' = 0) & (s2' = 5) & (slot2' = (slot2 - 1)) & (backoff2' = 15);
[] ((((s2 = 5) & (x2 = 1)) & (backoff2 = 0)) & (slot2 = 0)) -> 1 : (x2' = 0) & (s2' = 8);
[] ((s2 = 5) & ((c2 > 0) | (c1 > 0))) -> 1 : (x2' = 0) & (s2' = 6);
[time] ((s2 = 6) & ((c2 > 0) | (c1 > 0))) -> 1 : (s2' = 6);
[] ((s2 = 6) & ((c2 = 0) & (c1 = 0))) -> 1 : (s2' = 7);
[time] (((s2 = 7) & (x2 < 3)) & ((c2 = 0) & (c1 = 0))) -> 1 : (x2' = (min((x2 + 1), 7)));
[] ((s2 = 7) & ((x2 = 3) | (x2 = 2))) -> 1 : (x2' = 0) & (s2' = 5);
[] ((s2 = 7) & ((c2 > 0) | (c1 > 0))) -> 1 : (x2' = 0) & (s2' = 6);
[time] ((s2 = 8) & (x2 < 1)) -> 1 : (x2' = (min((x2 + 1), 7)));
[send2] ((s2 = 8) & ((x2 = 1) | (x2 = 0))) -> 1 : (x2' = 0) & (s2' = 9);
[time] ((s2 = 9) & (x2 < 4)) -> 1 : (x2' = (min((x2 + 1), 7)));
[finish2] (((s2 = 9) & (x2 >= 4)) & (c2 = 1)) -> 1 : (x2' = 0) & (s2' = 10);
[finish2] (((s2 = 9) & (x2 >= 4)) & (c2 = 2)) -> 1 : (x2' = 0) & (s2' = 11);
[] ((((s2 = 10) & (c2 = 0)) & (x2 = 0)) & ((c2 > 0) | (c1 > 0))) -> 1 : (s2' = 2);
[time] ((((s2 = 10) & (c2 = 0)) & (x2 = 0)) & ((c2 = 0) & (c1 = 0))) -> 1 : (x2' = (min((x2 + 1), 7)));
[send2] (((s2 = 10) & (c2 = 0)) & ((x2 = 1) | ((x2 = 0) & ((c2 = 0) & (c1 = 0))))) -> 1 : (x2' = 0) & (s2' = 10);
[time] (((s2 = 10) & (c2 = 1)) & (x2 < 4)) -> 1 : (x2' = (min((x2 + 1), 7)));
[finish2] (((s2 = 10) & (c2 = 1)) & ((x2 = 4) | (x2 = 3))) -> 1 : (x2' = 0) & (s2' = 12) & (bc2' = 0);
[] (((s2 = 11) & (x2 = 0)) & ((c2 > 0) | (c1 > 0))) -> 1 : (s2' = 2);
[time] (((s2 = 11) & (x2 = 0)) & ((c2 = 0) & (c1 = 0))) -> 1 : (x2' = (min((x2 + 1), 7)));
[time] (((s2 = 11) & (x2 > 0)) & (x2 < 6)) -> 1 : (x2' = (min((x2 + 1), 7)));
[] ((s2 = 11) & (x2 = 6)) -> 1 : (x2' = 0) & (s2' = 3);
[time] (s2 = 12) -> 1 : (s2' = 12);
endmodule
label "twoCollisions" = (col = 2);