heptagon/test/sdc/modular.ept
Gwenaël Delaval b0d719dcf2 Added SDC tests
2017-03-05 23:55:07 +01:00

39 lines
530 B
Plaintext

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;
tel
node g(u,v:bool;m :t) = (z:bool)
contract
enforce z
with (c,d:bool)
let
z = f(u & c, m)
tel
(* 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