Lustre Programming Language- Readhub

Introduction To LUSTRE

LUSTRE, whose main application field is the programming of automatic control and signal processing systems. In this field, design istra- ditionally driven by means of two types of tools. First, specifications are often systems of equations (differential or finite difference equations, boolean equations, . . .). Second, implementations are often nets of operators connected with wires (switches, gates, analog diagrams). Such tools present several ad&tag- as a basis for a programming language.

Example: Stopwatch

Let us illustrate the use of LUSTRE language through the programming of a stopwatch.

{`

@ode TWO-STATES (init. set, reset: bool) 

returns (state : bool) ;

let state =  tel :  running =  init -> if set and not prefstate) then true else if reset and precstate) then false ale0 prefetate) ;   

TWO,STATES(falee. start-stop. atart,stop); 

The complete program of this first version of the stopwatch is as follows:  node SIMPLE-STOPWATCH (start-stop, reset. hs: boo11 returns (time: int):  var CK. running: bool: let time = current(COUNT((0. 1. reset) when CK)); 

CK = true -> (HS and running) or reset: running = TWO,STATESffalse,

start-atop, start-stop); 

tel; 

`}

LUSTRE Compiler

Download latest version of LUSTRE Compiler for linux and windows. download