09:30 to 11:00
Lecture

Bisimulation, Part Two

Xavier Leroy
09:30 to 11:00
Mireille-Delmas-Marty Amphitheater, Marcelin-Berthelot Site
Open to all, subject to availability
-

Abstract

This course has developed the concepts of simulation and bisimulation introduced in the previous course in two directions: their extension to higher-order functional languages and their application to compiler verification.

In the first part, we studied applicative simulations: the relations between closed lambda-terms that are preserved by the application of two functions to the same arguments. Applicative bisimilarity, introduced by S. Abramsky in 1990 as the strongest form of applicative simulation, possesses excellent properties which imply that it coincides with Morris’s contextual equivalence described in the first course. One of these properties — congruence — is difficult to prove. We outlined D. Howe’s method for achieving this. Finally, we presented two extensions of applicative bisimulation by D. Sangiorgi, N. Kobayashi and E. Sumii: logical bisimulation and environmental bisimulation. The latter allows us to reason about higher-order languages with effects such as mutable state or name generation.

The second part of the course addressed the formal verification of compilers, viewed as the proof of an equivalence property or, at the very least, a refinement property between the compiled code and the source programme. We studied the use of simulations and bisimulations between labelled transition systems (LTSs) in this context. A very simple case study (compilation of arithmetic expressions and assignments) shows that it is easy to construct the ‘forward’ part of a bisimulation (each step in the source is simulated by steps in the compiled code) but not the ‘backward’ part (the inverse), unless one relies on the determinism of the target language.

We then applied these ideas at the level of the verified CompCert compiler for the C language, which has several features that are difficult to manage: input/output, partially specified evaluation order, and undefined behaviours that a compiler is free to optimise. In this context, only a refinement of the source code by the compiled code can be established, either directly using ‘backward’-indexed simulations, or indirectly using ‘forward’-indexed simulations and a general result for the inversion of simulations, under certain assumptions regarding the source and target languages (the properties of receptivity and determinism).