heptagon/test/sdc/modular.ept

39 lines
530 B
Text
Raw Permalink Normal View History

type t = Haut | Bas
node f(x:bool;r:t) = (y:bool)
contract
enforce (y)
with (c:bool)
let
automaton
state Haut
do
y = true;
unless (r=Bas) & c then Bas
state Bas
do
y = false
unless (r=Haut) or c then Haut
end;
2017-02-06 18:01:20 +01:00
tel
node g(u,v:bool;m :t) = (z:bool)
contract
enforce z
with (c,d:bool)
let
z = f(u & c, m)
tel
2017-03-05 23:55:07 +01:00
(* CHECK main *)
node main() = (ok:bool)
var u : bool;
m : t;
let
u = false fby true fby true fby u;
m = Haut fby Bas fby m;
ok = g(u,u,m);
tel