MATOU: An Implementation of Mode-Automata

Mode-Automata have been proposed in. They introduce, in the domain-specific data-flow language Lustre for reactive systems, a new construct devoted to the expression of running modes. The idea is to associate data-flow programs with the states of an automaton, representing modes. We define flat automata first, and then several composition operators, such as parallel composition and hierarchic composition, which give the language a state structure reminiscent from Statecharts. The semantics of this extension may be defined by describing the translation of Mode-automata into pure Lustre. However, the translation scheme is complex and it gives poor code; we study here the translation of mode-automata into the declarative format dc, used as an intermediate form in the compilers of several synchronous languages (Lustre, Esterel, ...). dc can be compiled into C, Java or Ada code. This allows to take advantage of the imperative mode-structure of a mode-automaton in order to improve the final sequential code.