|
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++.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
 |
2
|
|
| |
3
|
|
 |
4
|
|
 |
5
|
|
| |
6
|
|
| |
7
|
Luca Cardelli. Type systems. In The Computer Science and Engineering Handbook. 2 edition, 2004.
|
| |
8
|
Sophia Drossopoulou and Susan Eisenbach. Java is type safe - probably. In Proc. of ECOOP'97, volume 1241 of Lect. Notes in Comp. Sci., pages 389--418, 1997.
|
| |
9
|
Michale Hohmuth and Hendrik Tews. The semantics of C++ data types: Towards verifying low-level system components. In D. Basin and B. Wolff, editors, Theorem Proving in Higher Order Logics, Emerging Trends Proc., pages 127--144. Universität Freiburg, 2003. Tech. Rep. 187.
|
| |
10
|
Paul Jolly, Sophia Drossopoulou, Christopher Anderson, and KlausOstermann. Simple dependent types: Concord. In Proc. of FTfJP'05, 2005.
|
 |
11
|
|
 |
12
|
|
 |
13
|
O. L. Madsen , B. Moller-Pedersen, Virtual classes: a powerful mechanism in object-oriented programming, Conference proceedings on Object-oriented programming systems, languages and applications, p.397-406, October 02-06, 1989, New Orleans, Louisiana, United States
|
| |
14
|
Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17(3):348--375, 1978.
|
| |
15
|
|
 |
16
|
Nathaniel Nystrom , Stephen Chong , Andrew C. Myers, Scalable extensibility via nested inheritance, Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 24-28, 2004, Vancouver, BC, Canada
|
| |
17
|
Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Sebastian Maneth, Stéphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. An overview of the Scala programming language. Technical Report IC/2004/64, école Polytechnique Fédérale de Lausanne, Lausanne, Switzerland, 2004. Available from scala.epfl.ch.
|
| |
18
|
Martin Odersky, Vincent Cremet, Christine Röckl, and Matthias Zenger. A nominal theory of objects with dependent types. In Proc. of ECOOP'03.
|
| |
19
|
|
 |
20
|
|
 |
21
|
Jonathan G. Rossie, Jr. , Daniel P. Friedman, An algebraic semantics of subobjects, Proceedings of the tenth annual conference on Object-oriented programming systems, languages, and applications, p.187-199, October 15-19, 1995, Austin, Texas, United States
|
| |
22
|
|
| |
23
|
Adam Seligman. FACTS: A formal analysis for C++. Williams College, 1995. Undergraduate thesis.
|
 |
24
|
|
| |
25
|
|
 |
26
|
Mirko Streckenbach , Gregor Snelting, Refactoring class hierarchies with KABA, Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 24-28, 2004, Vancouver, BC, Canada
|
| |
27
|
Bjarne Stroustrup. Multiple inheritance for C++. Computing Systems, 2(4), 1989.
|
| |
28
|
|
| |
29
|
Bjarne Stroustrup. The C++ Standard: Incorporating Technical Corrigendum No. 1. John Wiley, 2 edition, 2003.
|
| |
30
|
|
 |
31
|
Peter F. Sweeney , Joseph (Yossi) Gil, Space and time-efficient memory layout for multiple inheritance, Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, p.256-275, November 01-05, 1999, Denver, Colorado, United States
|
| |
32
|
|
| |
33
|
Krishnaprasad Thirunarayan, Günter Kniesel, and Haripriyan Hampapuram. Simulating multiple inheritance and generics in Java. Computer Languages, 25:189--210, 1999.
|
| |
34
|
|
| |
35
|
|
| |
36
|
|
| |
37
|
Daniel Wasserrab, Tobias Nipkow, Gregor Snelting, and Frank Tip. An Operational Semantics and Type Safety Proof for C++-like Multiple Inheritance. Technical Report RC23709, IBM, 2005.
|
| |
38
|
Markus Wenzel. Isabelle/Isar - A Versatile Environment for Human-Readable Formal Proof Documents. PhD thesis, Institut für Informatik, Technische Universität München, 2002. http://tumb1.biblio.tu-muenchen.de/publ/diss/in/2002/wenzel.html.
|
| |
39
|
|
| |
40
|
Yoav Zibin and Joseph Gil. Two-dimensional bi-directional object layout. In Proc. of ECOOP'03, volume 3013 of Lect. Notes in Comp. Sci., pages 329--350, 2003.
|
|