Profile

 1 ```node First( X : int ) returns ( First : int ); ``` ```let ``` ``` First = X -> pre First; ``` ```tel ``` ```node Sofar( X : bool ) returns ( Sofar : bool ); ``` ```let ``` ``` Sofar = X -> X and pre Sofar; ``` ```tel ``` ```node excludes12( X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12 : bool ) returns ( excludes : bool ); ``` ```let ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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 ``` ``` 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; ``` ```tel ``` ```node DRAGON(e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12 : bool; ``` ```init_invalid : int) ``` ```returns(exclusive, shared, shared_dirty, dirty, invalid : int; erreur : bool); ``` ```var ``` ``` g01, g02, g03, g04, g05, g06, g07, g08, g09, g10, g11, g12 : bool; ``` ``` mem_init : int; ``` ```let ``` ``` mem_init = init_invalid -> pre mem_init; ``` ``` erreur = if(exclusive >= 2) then true else false; ``` ``` g01 = pre invalid>=1 and pre dirty=0 and pre shared=0 and pre exclusive=0 and pre shared_dirty=0; ``` ``` g02 = pre invalid>=1 and pre dirty +1+ pre shared - pre exclusive + pre shared_dirty>=1; ``` ``` g03 = pre exclusive>=1; ``` ``` g04 = pre shared_dirty=1 and pre shared=0; ``` ``` g05 = pre shared_dirty=0 and pre shared=1; ``` ``` g06 = pre shared_dirty + pre shared>=2; ``` ``` g07 = pre invalid>=1 and pre dirty=0 and pre shared=0 and pre exclusive=0 and pre shared_dirty=0; ``` ``` g08 = pre invalid>=1 and pre dirty + pre shared + pre exclusive + pre shared_dirty>=1; ``` ``` g09 = pre dirty>=1; ``` ``` g10 = pre shared>=1; ``` ``` g11 = pre shared_dirty>=1; ``` ``` g12 = pre exclusive>=1; ``` ``` exclusive = 0 -> ``` ``` if(e01) then if(g01) then pre exclusive+1 else pre exclusive else ``` ``` if(e02) then if(g02) then 0 else pre exclusive else ``` ``` if(e03) then if(g03) then pre exclusive-1 else pre exclusive else ``` ``` if(e08) then if(g08) then 0 else pre exclusive else ``` ``` if(e12) then if(g12) then pre exclusive-1 else pre exclusive else ``` ``` pre exclusive; ``` ``` shared = 0 -> ``` ``` if(e02) then if(g02) then pre shared+pre exclusive+1 else pre shared else ``` ``` if(e05) then if(g05) then 0 else pre shared else ``` ``` if(e06) then if(g06) then pre shared+pre shared_dirty-1 else pre shared else ``` ``` if(e08) then if(g08) then pre shared+pre exclusive+pre shared_dirty+pre dirty else pre shared else ``` ``` if(e10) then if(g10) then pre shared-1 else pre shared else ``` ``` pre shared; ``` ``` shared_dirty = 0 -> ``` ``` if(e02) then if(g02) then pre shared_dirty+pre dirty else pre shared_dirty else ``` ``` if(e04) then if(g04) then 0 else pre shared_dirty else ``` ``` if(e06) then if(g06) then 1 else pre shared_dirty else ``` ``` if(e08) then if(g08) then 1 else pre shared_dirty else ``` ``` if(e11) then if(g11) then pre shared_dirty-1 else pre shared_dirty else ``` ``` pre shared_dirty; ``` ``` dirty = 0 -> ``` ``` if(e02) then if(g02) then 0 else pre dirty else ``` ``` if(e03) then if(g03) then pre dirty+1 else pre dirty else ``` ``` if(e04) then if(g04) then pre dirty+1 else pre dirty else ``` ``` if(e05) then if(g05) then pre dirty+1 else pre dirty else ``` ``` if(e07) then if(g07) then pre dirty+1 else pre dirty else ``` ``` if(e08) then if(g08) then 0 else pre dirty else ``` ``` if(e09) then if(g09) then pre dirty-1 else pre dirty else ``` ``` pre dirty; ``` ``` invalid = mem_init -> ``` ``` if(e01) then if(g01) then pre invalid-1 else pre invalid else ``` ``` if(e02) then if(g02) then pre invalid-1 else pre invalid else ``` ``` if(e07) then if(g07) then pre invalid-1 else pre invalid else ``` ``` if(e08) then if(g08) then pre invalid-1 else pre invalid else ``` ``` if(e09) then if(g09) then pre invalid+1 else pre invalid else ``` ``` if(e10) then if(g10) then pre invalid+1 else pre invalid else ``` ``` if(e11) then if(g11) then pre invalid+1 else pre invalid else ``` ``` if(e12) then if(g12) then pre invalid+1 else pre invalid else ``` ``` pre invalid; ``` ```tel ``` ```node top( e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12 : bool; ``` ``` init_invalid : int ) ``` ```returns ( OK : bool ); ``` ```--@ contract guarantees OK; ``` ``` var exclusive, shared, shared_dirty, dirty, invalid : int; ``` ``` erreur : bool; ``` ``` env : bool; ``` ```let ``` ``` ( exclusive, shared, shared_dirty, dirty, invalid, erreur ) = ``` ``` DRAGON( e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, e11, e12, ``` ``` init_invalid ); ``` ``` env = Sofar( excludes12( e01, e02, e03, e04, e05, e06, e07, e08, e09, e10, ``` ``` e11, e12 ) and ``` ``` init_invalid > 0 ); ``` ``` OK = env => ``` ``` not erreur and ``` ``` ((true -> (exclusive+shared+shared_dirty+dirty+invalid) = ``` ``` pre(exclusive+shared+shared_dirty+dirty+invalid))) and ``` ``` exclusive + shared + shared_dirty + dirty + invalid = ``` ``` First( init_invalid ) and ``` ``` exclusive >= 0; ``` ``` --%MAIN; ``` ``` --%PROPERTY OK=true; ``` ```tel ```