Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2103656.2103718acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

A mechanized semantics for C++ object construction and destruction, with applications to resource management

Published: 25 January 2012 Publication History

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.

Supplementary Material

JPG File (popl_8a_2.jpg)
MP4 File (popl_8a_2.mp4)

References

[1]
The Coq proof assistant, 1999--2012. URL http://coq.inria.fr.
[2]
M. A. Ellis and B. Stroustrup. The Annotated C++ Reference Manual. Addison-Wesley, 1990.
[3]
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.
[4]
J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification. Addison Wesley, 3rd edition edition, 2005.
[5]
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.
[6]
International Standard ISO/IEC 14882:2003. Programming Languages -- C++. International Organization for Standards, 2003.
[7]
International Standard ISO/IEC 14882:2011. Programming Languages -- C++. International Organization for Standards, 2011.
[8]
X. Leroy. A formally verified compiler back-end. Journal of Automated Reasoning, 43 (4): 363--446, 2009.
[9]
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.
[10]
M. Norrish. A formal semantics for C+. Technical report, NICTA, 2008.
[11]
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.
[12]
T. Ramananandro. phMechanized Formal Semantics and Verified Compilation for C+ Objects. PhD thesis, Université Paris Diderot, Jan. 2012.
[13]
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.
[14]
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.
[15]
B. Stroustrup. Classes: An abstract data type facility for the C language. SIGPLAN Not., 17: 42--51, January 1982.
[16]
B. Stroustrup. phThe design and evolution of C+. ACM Press/Addison-Wesley Publishing Co., New York, NY, USA, 1994.
[17]
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.
[18]
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.

Cited By

View all
  • (2023)Feature-Sensitive Coverage for Conformance Testing of Programming Language ImplementationsProceedings of the ACM on Programming Languages10.1145/35912407:PLDI(493-515)Online publication date: 6-Jun-2023
  • (2023)Verification of the ROS NavFn planner using executable specification languagesJournal of Logical and Algebraic Methods in Programming10.1016/j.jlamp.2023.100860132(100860)Online publication date: Apr-2023
  • (2021)Memory-Safety Challenge Considered Solved? An In-Depth Study with All Rust CVEsACM Transactions on Software Engineering and Methodology10.1145/346664231:1(1-25)Online publication date: 28-Sep-2021
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '12: Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2012
602 pages
ISBN:9781450310833
DOI:10.1145/2103656
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 47, Issue 1
    POPL '12
    January 2012
    569 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2103621
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 January 2012

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. C++
  2. Coq
  3. classes
  4. constructors
  5. destructors
  6. mechanized semantics
  7. objects

Qualifiers

  • Research-article

Conference

POPL '12
Sponsor:

Acceptance Rates

Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)0
Reflects downloads up to 26 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Feature-Sensitive Coverage for Conformance Testing of Programming Language ImplementationsProceedings of the ACM on Programming Languages10.1145/35912407:PLDI(493-515)Online publication date: 6-Jun-2023
  • (2023)Verification of the ROS NavFn planner using executable specification languagesJournal of Logical and Algebraic Methods in Programming10.1016/j.jlamp.2023.100860132(100860)Online publication date: Apr-2023
  • (2021)Memory-Safety Challenge Considered Solved? An In-Depth Study with All Rust CVEsACM Transactions on Software Engineering and Methodology10.1145/346664231:1(1-25)Online publication date: 28-Sep-2021
  • (2020)Thriving in a crowded and changing world: C++ 2006–2020Proceedings of the ACM on Programming Languages10.1145/33863204:HOPL(1-168)Online publication date: 12-Jun-2020
  • (2016)Combining Mechanized Proofs and Model-Based Testing in the Formal Analysis of a HypervisorFM 2016: Formal Methods10.1007/978-3-319-48989-6_5(69-84)Online publication date: 8-Nov-2016
  • (2014)ARC++: effective typestate and lifetime dependency analysisProceedings of the 2014 International Symposium on Software Testing and Analysis10.1145/2610384.2610395(116-126)Online publication date: 21-Jul-2014
  • (2012)Foundations of c++Proceedings of the 21st European conference on Programming Languages and Systems10.1007/978-3-642-28869-2_1(1-25)Online publication date: 24-Mar-2012
  • (2024)rCanary: Detecting Memory Leaks Across Semi-Automated Memory Management Boundary in RustIEEE Transactions on Software Engineering10.1109/TSE.2024.344362450:9(2472-2484)Online publication date: 13-Aug-2024
  • (2023)SafeDrop: Detecting Memory Deallocation Bugs of Rust Programs via Static Data-flow AnalysisACM Transactions on Software Engineering and Methodology10.1145/354294832:4(1-21)Online publication date: 26-May-2023
  • (2012)An efficient method for detecting concurrency errors in object-oriented programsScience China Information Sciences10.1007/s11432-012-4751-z55:12(2774-2784)Online publication date: 29-Dec-2012

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media