Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / test / src / clocks / clocks2.lus @ 2fa10a44

History | View | Annotate | Download (414 Bytes)

1

    
2
type choice = enum { one, two };
3
type entier = int;
4

    
5
const PI = 3;
6

    
7
const choix = one;
8

    
9
node toto (x:int) returns (a:int;y:int)
10
var c : choice;b1, b2:entier;
11
let
12
  a = PI fby (a+1);
13
  c = if a=x then one else two ;
14
  b1 = 1 when one(c);
15
  b2 = 2 when two(c);
16
  y = merge c (one -> b1) (two -> b2);
17
tel
18

    
19
node test (x:bool) returns (y:int)
20
var a:int; b:int;
21
let
22
   (a,b) = toto(if x then 0 else 1);
23
   y = a ;
24
tel
25