2011-08-04 23:47:28 +02:00
|
|
|
node f(x:int) returns (y:int)
|
|
|
|
let
|
|
|
|
automaton
|
|
|
|
state A
|
|
|
|
do
|
2011-11-21 02:03:45 +01:00
|
|
|
y = 1;
|
2011-08-04 23:47:28 +02:00
|
|
|
until (x = 0) then B
|
|
|
|
state B
|
|
|
|
do
|
2011-11-21 02:03:45 +01:00
|
|
|
y = 2;
|
2011-08-04 23:47:28 +02:00
|
|
|
until (x = 1) then C
|
|
|
|
state C
|
|
|
|
do
|
2011-11-21 02:03:45 +01:00
|
|
|
automaton
|
|
|
|
state D
|
|
|
|
do
|
|
|
|
y = 3;
|
|
|
|
until (x = 2) then E
|
|
|
|
state E
|
|
|
|
do
|
|
|
|
y = 4;
|
|
|
|
until (x = 3) then F
|
|
|
|
state F
|
|
|
|
do
|
|
|
|
y = 5;
|
|
|
|
until (x = 4) then D
|
|
|
|
end
|
2011-08-04 23:47:28 +02:00
|
|
|
until (x = 5) then A
|
|
|
|
end
|
|
|
|
tel
|
2012-07-18 16:54:44 +02:00
|
|
|
|
|
|
|
node main() returns (y:int)
|
|
|
|
var x:int;
|
|
|
|
let
|
|
|
|
x = 0 fby if x = 7 then 0 else x + 1;
|
|
|
|
y = f(x);
|
|
|
|
tel
|