Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / optim / clocks7 / clocks7.lus @ 6a93d814

History | View | Annotate | Download (382 Bytes)

1

    
2
type choice1 = enum { On, Off };
3
type choice2 = enum { Up, Down };
4

    
5
node toto (x:int) returns (y:int)
6
var c:choice1 clock; d:choice2 clock; b1,b2,b3,z:int;
7
let
8
  c = if 0=x when Up(d) then Off else On;
9
  d = if x>0 then Up else Down;
10
  b1 = 1 when On(c);
11
  b2 = 2 when Off(c);
12
  b3 = 3 when Down(d);
13
  y = merge d (Up -> z) (Down -> b3);
14
  z = merge c (On -> b1) (Off -> b2);
15
tel
16