heptagon/test/good/t2.ept

77 lines
1.3 KiB
Text
Raw Normal View History

2010-06-21 12:11:06 +02:00
(* pour debugger
directory parsing global analysis dataflow sequential sigali simulation translation main
set arguments -I ../test/good -v ../test/good/t2.ept *)
2011-11-27 12:59:11 +01:00
node h(x: int) returns ()
2010-06-21 12:11:06 +02:00
var y, z: int;
let
y = pre z + 1;
z = 0 -> y;
tel
node jj() returns ()
var last k: int;
let
automaton
state S1
do k = 1
until k = 0 then S2
state S2
do k = last k + 1 until k = 1 then S2
end
tel
2011-11-27 12:59:11 +01:00
2010-06-21 12:11:06 +02:00
node g(x: bool) returns (o: bool)
let
o = T1.f(x)
tel
node hhh() returns ()
var last o2 : int = 0;
2010-06-21 12:11:06 +02:00
let
automaton
state S1
var r: int;
do o2 = 1; r = 2
unless last o2 = 0 then S1
2010-06-21 12:11:06 +02:00
end
tel
node hh(x,z,m:int) returns (o:int)
var last k:int = 1;
last w: int = 0;
let
automaton
state S1
var r:int;
2011-05-23 14:04:11 +02:00
do
2010-06-21 12:11:06 +02:00
k = m + 2;
r = k + 3;
w = 1 + 2;
until (1 = 0) then S2
| (1 = 2) then S1
unless (2 = last k) then S1
state S2
do
k = 2;
2011-05-23 14:04:11 +02:00
until (1 = 0) then S2
2012-07-18 16:54:44 +02:00
end;
2010-06-21 12:11:06 +02:00
present
2012-07-18 16:54:44 +02:00
| (x = 0) do o = k -> pre o + 2
| (x = 2) do o = z
default do o = 2
end
2010-06-21 12:11:06 +02:00
tel
2012-07-18 16:54:44 +02:00
node main() returns (o1,o2:int)
let
() = h(0);
() = jj();
o1 = if (g(false fby true)) then 1 else 2;
() = hhh();
o2 = hh(0 fby 1 fby 2, 3, o1-2);
tel