An operational semantics and type safety proof for multiple inheritance in C++

Daniel Wasserrab, Tobias Nipkow, Gregor Snelting, Frank Tip

Research output: Contribution to journalArticlepeer-review

8 Scopus citations

Abstract

We present an operational semantics and type safety proof for multiple inheritance in C++. The semantics models the behaviour of method calls, field accesses, and two forms of casts in C++ class hierarchies exactly, and the type safety proof was formalized and machine-checked in Isabelle/HOL. Our semantics enables one, for the first time, to understand the behaviour of operations on C++ class hierarchies without referring to implementation-level artifacts such as virtual function tables. Moreover, it can - as the semantics is executable - act as a reference for compilers, and it can form the basis for more advanced correctness proofs of, e.g., automated program transformations. The paper presents the semantics and type safety proof, and a discussion of the many subtleties that we encountered in modeling the intricate multiple inheritance model of C++.

Original languageEnglish
Pages (from-to)345-362
Number of pages18
JournalACM SIGPLAN Notices
Volume41
Issue number10
DOIs
StatePublished - Oct 2006

Keywords

  • C++
  • Multiple inheritance
  • Semantics
  • Type safety

Fingerprint

Dive into the research topics of 'An operational semantics and type safety proof for multiple inheritance in C++'. Together they form a unique fingerprint.

Cite this