You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
526 B
Plaintext

node nat() returns (o : int)
let
o = 0 fby (o + 1);
tel
node f<<n : int>>(i : bool^n) returns (o, b : bool; nat : int)
let
b = fold<<n>> (or) (i, false);
automaton
state Idle
do o = false; nat = 0;
unless b then Emit
state Emit
do o = true;
nat = nat();
until nat > 3 then Idle
unless b then Emit
end
tel
node main() returns (i1, i2, i3, o, b : bool; nat : int)
let
i1 = false;
i2 = false fby true fby false;
i3 = false;
(o, b, nat) = f<<3>>([i1, i2, i3]);
tel