Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / automata / without_properties / heater3.lus @ 02d89bbb

History | View | Annotate | Download (663 Bytes)

1
const delay_on = 200;
2

    
3
const delay_off = 500;
4

    
5
node count(d : int; t : bool) returns (ok : bool)
6
var cpt:int;
7
let
8
  ok = (cpt = 0);
9
  cpt = 0 -> (if t then pre cpt + 1 else pre cpt) mod d;
10
tel
11

    
12
node heater3(millisecond : bool) returns (open_light, open_gas : bool)
13

    
14
let
15
  automaton command_control
16
    state Open :
17
          let
18
            open_light = true;
19
            open_gas = true;
20
          tel
21
          until count(delay_on, millisecond) restart Silent
22
    state Silent :
23
          let
24
            open_light = false;
25
            open_gas = false;
26
          tel
27
          until count(delay_off, millisecond) restart Open
28
tel