Abstract
We present a formal operational semantics and its Coq mechanization for the C++ object model, featuring object construction and destruction, shared and repeated multiple inheritance, and virtual function call dispatch. These are key C++ language features for high-level system programming, in particular for predictable and reliable resource management. This paper is the first to present a formal mechanized account of the metatheory of construction and destruction in C++, and applications to popular programming techniques such as "resource acquisition is initialization". We also report on irregularities and apparent contradictions in the ISO C++03 and C++11 standards.
Supplemental Material
- The Coq proof assistant, 1999--2012. URL http://coq.inria.fr.Google Scholar
- M. A. Ellis and B. Stroustrup. The Annotated C++ Reference Manual. Addison-Wesley, 1990. Google Scholar
Digital Library
- M. Fahndrich and S. Xia. Establishing object invariants with delayed types. In 22nd conf. on Object-Oriented Programming Systems and Applications (OOPSLA'07), pages 337--350. ACM, 2007. Google Scholar
Digital Library
- J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification. Addison Wesley, 3rd edition edition, 2005. Google Scholar
Digital Library
- L. Hubert, T. Jensen, V. Monfort, and D. Pichardie. Enforcing secure object initialization in Java. In Computer Security -- ESORICS 2010, volume 6345 of Lecture Notes in Computer Science, pages 101--115. Springer, 2010. Google Scholar
Digital Library
- International Standard ISO/IEC 14882:2003. Programming Languages -- C++. International Organization for Standards, 2003.Google Scholar
- International Standard ISO/IEC 14882:2011. Programming Languages -- C++. International Organization for Standards, 2011.Google Scholar
- X. Leroy. A formally verified compiler back-end. Journal of Automated Reasoning, 43 (4): 363--446, 2009. Google Scholar
Digital Library
- Lockheed Martin. Joint Strike Fighter Air Vehicle C+ Coding Standards for the System Development and Demonstration Program, 2005. URL http://www.research.att.com/ bs/JSF-AV-rules.pdf.Google Scholar
- M. Norrish. A formal semantics for C+. Technical report, NICTA, 2008.Google Scholar
- X. Qi and A. C. Myers. Masked types for sound object initialization. In 36th symp. Principles of Programming Languages (POPL'09), pages 53--65. ACM, 2009. Google Scholar
Digital Library
- T. Ramananandro. phMechanized Formal Semantics and Verified Compilation for C+ Objects. PhD thesis, Université Paris Diderot, Jan. 2012.Google Scholar
- T. Ramananandro, G. Dos Reis, and X. Leroy. Formal verification of object layout for C+ multiple inheritance. In 38th symp. Principles of Programming Languages (POPL'11), pages 67--80. ACM, 2011. Google Scholar
Digital Library
- J. G. Rossie and D. P. Friedman. An algebraic semantics of subobjects. In 10th conf. on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'95), pages 187--199. ACM, 1995. Google Scholar
Digital Library
- B. Stroustrup. Classes: An abstract data type facility for the C language. SIGPLAN Not., 17: 42--51, January 1982. Google Scholar
Digital Library
- B. Stroustrup. phThe design and evolution of C+. ACM Press/Addison-Wesley Publishing Co., New York, NY, USA, 1994. Google Scholar
Digital Library
- D. Wasserrab. phFrom Formal Semantics to Verified Slicing -- A Modular Framework with Applications in Language Based Security. PhD thesis, Karlsruher Institut für Technologie, Fakultat für Informatik, Oct. 2010.Google Scholar
- D. Wasserrab, T. Nipkow, G. Snelting, and F. Tip. An operational semantics and type safety proof for multiple inheritance in C+. In ph21st conf. on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'06), pages 345--362. ACM, 2006. Google Scholar
Digital Library
Index Terms
A mechanized semantics for C++ object construction and destruction, with applications to resource management
Recommendations
A mechanized semantics for C++ object construction and destruction, with applications to resource management
POPL '12: Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesWe present a formal operational semantics and its Coq mechanization for the C++ object model, featuring object construction and destruction, shared and repeated multiple inheritance, and virtual function call dispatch. These are key C++ language ...
What Is Object-Oriented Programming?
The meaning of the term 'object oriented' is examined in the context of the general-purpose programming language C++. This choice is made partly to introduce C++ and partly because C++ is one of the few languages that supports data abstraction, object-...
A pragmatic approach to C++, Eiffel and Ada 9X programming
Conceptualizing the world as a set of interacting objects, has ever been the main mechanism of perception associated with humankind. Therefore, the formulation of languages and modeling and design methods based on object orientation (OO) was just a ...







Comments