Mechanized Formal Semantics and Verified Compilation for C++ Objects

C++ is one of the most widely used programming languages in practice, including for embedded critical software. Thus, it becomes interesting to apply formal methods to programs written in C++. To this end, it is necessary to rely on a formal semantics of C++. Moreover, such a formal semantics can be validated as a basis to the specification and proof of a verified realistic compiler for C++ to gain confidence in the implementation techniques of mainstream C++ compilers. In this thesis, we focus on the C++ object model. We formally specify C++ multiple inheritance with C-style embedded structures, leading us to study the concrete representation of objects with empty base optimizations. We propose a set of sufficient layout conditions, and we show that they are sound with respect to field accesses and polymorphic operations. We then specify a realistic layout algorithm based on the Common Vendor ABI for Itanium, and an extension performing empty member optimizations, and we prove that they satisfy our conditions. We obtain a verified realistic compiler from a subset of C++ to a 3-address language with low-level memory accesses. Extending our semantics with object construction and destruction, we study their intrications with multiple inheritance. This leads us to formalize resource management, namely resource acquisition is initialization through the subobject construction and destruction order. We also study the impact on polymorphic operations such as virtual function dispatch during construction and destruction, by generalizing the notion of dynamic type. We obtain a verified compiler for our extended semantics, in particular by verifying the implementation of dynamic type changes. All our specifications and proofs are carried out with Coq.

Data and Resources

Additional Info

Field Value
Source https://theses.hal.science/tel-00769044
Author Ramananandro, Tahina
Maintainer CCSD
Last Updated May 29, 2026, 07:10 (UTC)
Created May 29, 2026, 07:10 (UTC)
Identifier NNT: 2012PA077001
Language en
Rights https://about.hal.science/hal-authorisation-v1/
contributor Programming languages, types, compilation and proofs (GALLIUM) ; Inria Paris-Rocquencourt ; Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)
creator Ramananandro, Tahina
date 2012-01-10T00:00:00
harvest_object_id 199487f2-8271-4832-98df-28af618c4e0a
harvest_source_id 3374d638-d20b-4672-ba96-a23232d55657
harvest_source_title test moissonnage SELUNE
metadata_modified 2026-04-28T00:00:00
set_spec type:THESE