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

被引:10
|
作者
Wasserrab, Daniel [1 ]
Nipkow, Tobias [2 ]
Snelting, Gregor [1 ]
Tip, Frank [3 ]
机构
[1] Univ Passau, Passau, Germany
[2] Tech Univ Munich, D-8000 Munich, Germany
[3] IBM Corp, TJ Watson Res Ctr, St Louis, MO 63123 USA
关键词
languages; theory; multiple inheritance; C plus; semantics; type safety;
D O I
10.1145/1167515.1167503
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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++.
引用
收藏
页码:345 / 362
页数:18
相关论文
共 50 条