De la sémantique opérationnelle à la spécification formelle de compilateurs : l'exemple des boucles en Esterel

Esterel is a synchronous imperative design language for the specification of control-oriented reactive systems. In order to formally derive the specification of an Esterel compiler from the operational semantics of the language, we first describe a new semantics for Esterel that discards non-deterministic executions. Then, we show how to understand and solve the problems in compilers raised by the “loop” construct of Esterel. All primitive instructions except for “pause” execute in zero time. Thus, because of loops, a given piece of code may be executed several times in a single instant, potentially leading to complex (finite loop) or incorrect (infinite loop) behaviors. Using a new non-instantaneous jump instruction called “gotopause”, and combining program rewriting with static analysis techniques, we build a safe code generation scheme for loop structures that rejects incorrect loops and compiles correct loops very efficiently. We formalize and prove the correctness of this scheme.