Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / test / src / kind_fmcad08 / protocol / peterson_1_e7_4234.lus @ 22fe1c93

History | View | Annotate | Download (5.55 KB)

1

    
2
node Sofar( X : bool ) returns ( Sofar : bool );
3
let
4
    Sofar = X -> X or pre Sofar;
5
tel
6
node excludes12( X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 : bool ) returns ( excludes : bool );
7
let
8
    excludes = not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
9
                  X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
10
              not X1 and     X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
11
              not X1 and not X2 and     X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
12
              not X1 and not X2 and not X3 and     X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
13
              not X1 and not X2 and not X3 and not X4 and     X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
14
              not X1 and not X2 and not X3 and not X4 and not X5 and     X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
15
              not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and     X7 and not X8 and not X9 and not X10 and not X11 and not X12 or
16
              not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and     X8 and not X9 and not X10 and not X11 and not X12 or
17
              not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and     X9 and not X10 and not X11 and not X12 or
18
              not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and     X10 and not X11 and not X12 or
19
              not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and     X11 and not X12 or
20
              not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and     X12;
21
tel
22
node peterson(e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12 : bool) returns (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13 : int);
23
var
24
   g01, g02, g03, g04, g05, g06, g07, g08, g09, g10, g11, g12 : bool;
25
let
26
   g01 = pre x0>=1 and pre x4>=1;
27
   g02 = pre x1 >= 1 and pre x6 >= 1;
28
   g03 = pre x1>=1 and pre x7>=1;
29
   g04 = pre x2>=1 and pre x9>=1;
30
   g05 = pre x2>=1 and pre x6>=1;
31
   g06 = pre x3>=1 and pre x5>=1;
32
   g07 = pre x9>=1 and pre x10>=1;
33
   g08 = pre x7>=1 and pre x11>=1;
34
   g09 = pre x6>=1 and pre x11>=1;
35
   g10 = pre x4>=1 and pre x12>=1;
36
   g11 = pre x7>=1 and pre x12>=1;
37
   g12 = pre x8>=1 and pre x13>=1;
38
   x0 = 1 -> 
39
   if(e01) then if(g01) then pre x0-1 else pre x0 else 
40
   if(e06) then if(g06) then pre x0+1 else pre x0 else 
41
   pre x0;
42
   x1 = 0 -> 
43
   if(e01) then if(g01) then pre x1+1 else pre x1 else 
44
   if(e02) then if(g02) then pre x1-1 else pre x1 else 
45
   if(e03) then if(g03) then pre x1-1 else pre x1 else 
46
   pre x1;
47
   x2 = 0 -> 
48
   if(e02) then if(g02) then pre x2+1 else pre x2 else 
49
   if(e03) then if(g03) then pre x2+1 else pre x2 else 
50
   if(e04) then if(g04) then pre x2-1 else pre x2 else 
51
   if(e05) then if(g05) then pre x2-1 else pre x2 else 
52
   pre x2;
53
   x3 = 0 -> 
54
   if(e04) then if(g04) then pre x3+1 else pre x3 else 
55
   if(e05) then if(g05) then pre x3+1 else pre x3 else 
56
   if(e06) then if(g06) then pre x3-1 else pre x3 else 
57
   pre x3;
58
   x4 = 1 -> 
59
   if(e01) then if(g01) then pre x4-1 else pre x4 else 
60
   if(e06) then if(g06) then pre x4+1 else pre x4 else 
61
   pre x4;
62
   x5 = 0 -> 
63
   if(e01) then if(g01) then pre x5+1 else pre x5 else 
64
   if(e06) then if(g06) then pre x5-1 else pre x5 else 
65
   pre x5;
66
   x6 = 0 -> 
67
   if(e02) then if(g02) then pre x6-1 else pre x6 else 
68
   if(e08) then if(g08) then pre x6+1 else pre x6 else 
69
   pre x6;
70
   x7 = 1 -> 
71
   if(e02) then if(g02) then pre x7+1 else pre x7 else 
72
   if(e08) then if(g08) then pre x7-1 else pre x7 else 
73
   pre x7;
74
   x8 = 0 -> 
75
   if(e07) then if(g07) then pre x8+1 else pre x8 else 
76
   if(e12) then if(g12) then pre x8-1 else pre x8 else 
77
   pre x8;
78
   x9 = 1 -> 
79
   if(e07) then if(g07) then pre x9-1 else pre x9 else 
80
   if(e12) then if(g12) then pre x9+1 else pre x9 else 
81
   pre x9;
82
   x10 = 1 -> 
83
   if(e07) then if(g07) then pre x10-1 else pre x10 else 
84
   if(e12) then if(g12) then pre x10+1 else pre x10 else 
85
   pre x10;
86
   x11 = 0 -> 
87
   if(e07) then if(g07) then pre x11+1 else pre x11 else 
88
   if(e08) then if(g08) then pre x11-1 else pre x11 else 
89
   if(e09) then if(g09) then pre x11-1 else pre x11 else 
90
   pre x11;
91
   x12 = 0 -> 
92
   if(e08) then if(g08) then pre x12+1 else pre x12 else 
93
   if(e09) then if(g09) then pre x12+1 else pre x12 else 
94
   if(e10) then if(g10) then pre x12-1 else pre x12 else 
95
   if(e11) then if(g11) then pre x12-1 else pre x12 else 
96
   pre x12;
97
   x13 = 0 -> 
98
   if(e10) then if(g10) then pre x13+1 else pre x13 else 
99
   if(e11) then if(g11) then pre x13+1 else pre x13 else 
100
   if(e12) then if(g12) then pre x13-1 else pre x13 else 
101
   pre x13;
102
tel
103
node top(e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12 : bool)
104
returns ( OK : bool );
105
    var x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13 : int;
106
        env : bool;
107
let
108
   (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) = peterson(e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12);
109
    env = Sofar( excludes12( e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12 ) and x0 < 32767 );
110
    OK = env => x0 >= 0;
111
  --%MAIN;
112
  --%PROPERTY  OK=true;
113
tel