The Lustre Programming Language and Related Tools

Lustre is a programming language designed in the Synchrone team of Verimag. It is the core of the SCADE industrial tool to design critical real-time reactive systems.

In the recent years, we have been working on several other synchronous languages :
— Argos : a pure synchronous automaton-based language, inspired from the Statecharts constructs ;
— Mode-automata : a way of combining Argos automata with Lustre equations, in order to describe running-modes of embedded reactive systems ;
— Larissa : a extension of Argos with aspect-oriented features ;
— Lutin : a language for the description and execution of non-deterministic reactive systems.

 Lustre, the Core Language

Lustre is a synchronous declarative language for programming reactive systems. the declarative style of the language means the following : a Lustre program is an unordered set of equations linking the variables of the program ; these equations always hold during the execution of the program.

This approach was inspired from formalisms familiar to control engineers, like systems of differential equations or synchronous operator networks (block diagrams). A program variable in Lustre is considered to be a function of multi-form time : it has an associated clock which defines the sequence of instants when the variable takes its values. In that sense, Lustre belongs to the family of synchronous languages (like Esterel and Signal).

Lustre is the kernel language of the SCADE (formerly SAO+/SAGA) industrial environment developed by Esterel-Technologies.

A tutorial of Lustre is available here.

A small example of a Lustre program is the following :

node integr (a: int) returns (i: int) ;
let
    i = 0 -> pre(i) + a ;
tel.

One of its executions is described by the following timing-diagram :

To obtain the Lustre toolbox see here.

 Lustre Arrays

Arrays were introduced in the language for the description of hardware systems [1]. Lustre-V4 includes operators like slice extraction, concatenation and a static recursion mechanism, all well adapted to the description of hardware systems.

This set of operations is however not well-suited for the description of software systems : their compilation leads to imperative code with independent variables corresponding to array elements. In the V6 version of Lustre, we introduced array iterators, inspired from classical functional operators like map and fold, that can always be compiled into imperative code with arrays and loops [2].

 Lutin : a language for the simulation of non-deterministic reactive behaviors

The main challenge to automate a testing or a simulation process is to be able to automate the generation of realistic input sequences to feed the program. In other words, we need an executable model of the program environment in which inputs are the program outputs, and outputs are the program inputs.

In the first Lurette prototype [3] — an automated testing tool from reactive programs designed at Verimag —, the System Under Test (SUT) environment behavior was described by Lustre observers specifying what realistic SUT inputs should be. In other words, the environment was modeled by a set of (linear) constraints over Boolean and numeric variables. The work of Lurette was to solve those constraints, and to draw a value among the solutions to produce one SUT input vector. But, from the point of view of language expressivity, Lustre observers happen to be too restrictive, in particular to express sequences of d testing scenarios, or to have some control over the probabilistic distribution of the drawn solution. It was precisely to overcome those limitations that the new language Lutin, was designed.

To obtain the tools see here and here.

 Reglo : from regular expressions to Lustre observers

Reglo is a compiler which translates regular expressions into either a set of language equations, or into a Lustre program.

The complete definition can be found here.

To obtain the tool see here.

 Argos : a automaton-based synchronous language

Argos has been studied from 1987 to 1994. The complete definition can be found in this article. See also the PhD by Muriel Jourdan. Argos is a synchronous language inspired from the graphical notation of Statecharts. It has been extended by Charles André (Nice university) to give the language SyncCharts. The Safe State Machines (SSM) included in SCADE are very similar to Argos.

Here’s a typical Argos program :

This example describes a modulo-8 counter. The global input is the signal named a, the global output is named hi. The counter is made of three parallel processes (one process per bit) that communicate by internal signals. The main structure is an automaton that starts and stops the three-bit counter. This program may be compiled into a single "flat" automaton, having 8 states, which is exactly the one we would have written by hand (no more states, no more transitions). This demonstrates that the synchronous product of Mealy machines (the semantics of the Argos parallel composition) is a perfect support for a notion of design parallelism, i.e., a notion of parallelism that can be used with no constraints at the design level, while being compiled in a minimal flat automaton. Notice that no other description of such a counter (with a synchronous product of Moore machines, or with asynchronous products) has this interesting property.

Some external references to Argos :

Tools

Argos and its aspect-oriented extendion Larissa can be obtained from David Stauch former home page.

 Mode-Automata : a new construct for running modes in a dataflow language

Mode-Automata are a new programming construct that helps building systems that exhibit clear "running modes". Technically, they are defined as automata, whose states are labeled by Lustre-style dataflow equations, and which can be composed with Statecharts-like operators (parallel composition, hierarchic composition). The presentation Automata in the Family of Synchronous Languages explains how mode-automata follow from Argos, and Argos+Lustre. See also the Phd of Yann Rémond. (The MATOU logo is due to Yann Rémond).

The complete definition can be found in this article.

Some external references to mode-automata :

A typical mode-automaton and its timing diagram are given below :

 Larissa : Aspect-oriented Features for a Synchronous Language

Larissa is an extension of Argos with aspect-oriented features. Information can be found on the former page of David Stauch, but please note that the contact email is no longer valid. Use Karine.Altisen@imag.fr instead.

The complete definition of Larissa can be found in this article.

[1F. Rocheteau and N. Halbwachs. Pollux, a Lustre-based hardware design environment. Conference on Algorithms and Parallel VLSI Architectures II. June 1991

[2Lionel Morel. Efficient Compilation of Array Iterators for Lustre. First Workshop on Synchronous Languages, Applications, and Programming, SLAP02, Grenoble, April 2002

[3P. Raymond, D. Weber, X. Nicollin, and N. Halbwachs. Automatic Testing of Reactive Systems. 19th IEEE Real-Time Systems Symposium. Madrid, Spain, December 1998.


Contact | Plan du site | Site réalisé avec SPIP 4.2.8 + AHUNTSIC [CC License]

info visites 3900751