Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / test / src / kind_fmcad08 / memory1 / DRAGON_10.lus @ 22fe1c93

History | View | Annotate | Download (5.87 KB)

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