Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2535838.2535878acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

An operational and axiomatic semantics for non-determinism and sequence points in C

Published: 08 January 2014 Publication History

Abstract

The C11 standard of the C programming language does not specify the execution order of expressions. Besides, to make more effective optimizations possible (eg. delaying of side-effects and interleaving), it gives compilers in certain cases the freedom to use even more behaviors than just those of all execution orders.
Widely used C compilers actually exploit this freedom given by the C standard for optimizations, so it should be taken seriously in formal verification. This paper presents an operational and axiomatic semantics (based on separation logic) for non-determinism and sequence points in C. We prove soundness of our axiomatic semantics with respect to our operational semantics. This proof has been fully formalized using the Coq proof assistant.

Supplementary Material

MP4 File (d1_right_t5.mp4)

References

[1]
A. W. Appel. Tactics for Separation Logic, 2006. Available at http://www.cs.princeton.edu/~appel/papers/septacs.pdf.
[2]
A. W. Appel and S. Blazy. Separation Logic for Small-Step Cminor. In TPHOLs, volume 4732 of LNCS, pages 5--21, 2007.
[3]
J. Bengtson, J. B. Jensen, and L. Birkedal. Charge! -- A Framework for Higher-Order Separation Logic in Coq. In ITP, volume 7406 of LNCS, pages 315--331, 2012.
[4]
J. Berdine, C. Calcagno, and P.W. O'Hearn. Symbolic Execution with Separation Logic. In APLAS, volume 3780 of LNCS, pages 52--68, 2005.
[5]
P. E. Black and P. J. Windley. Inference Rules for Programming Languages with Side Effects in Expressions. In TPHOLs, volume 1125 of LNCS, pages 51--60, 1996.
[6]
R. Bornat, C. Calcagno, P. W. O'Hearn, and M. J. Parkinson. Permission Accounting in Separation Logic. In POPL, pages 259--270, 2005.
[7]
J. Boyland. Checking Interference with Fractional Permissions. In SAS, volume 2694 of LNCS, pages 55--72, 2003.
[8]
C. Calcagno, P. W. O'Hearn, and H. Yang. Local Action and Abstract Separation Logic. In LICS, pages 366--378, 2007.
[9]
B. Campbell. An Executable Semantics for CompCert C. In CPP, volume 7679 of LNCS, pages 60--75, 2012.
[10]
A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. In PLDI, pages 234--245. ACM, 2011.
[11]
R. Dockins, A. Hobor, and A. W. Appel. A Fresh Look at Separation Algebras and Share Accounting. In APLAS, volume 5904 of LNCS, pages 161--177, 2009.
[12]
C. Ellison and G. Rosu. An executable formal semantics of C with applications. In POPL, pages 533--544, 2012.
[13]
C. Ellison and G. Rosu. Slides of {12}, 2012. http://fsl.cs.uiuc.edu/pubs/ellison-rosu-2012-popl-slides.pdf.
[14]
M. Felleisen, D. P. Friedman, E. E. Kohlbecker, and B. F. Duba. A syntactic theory of sequential control. Theoretical Computer Science, 52:205--237, 1987.
[15]
P. Herms. Certification of a Tool Chain for Deductive Program Verification. PhD thesis, l'Université Paris-Sud, 2013.
[16]
International Organization for Standardization. ISO/IEC 9899-2011: Programming languages -- C. ISO Working Group 14, 2012.
[17]
B. W. Kernighan and D. M. Ritchie. The C Programming Language. Prentice Hall, 2nd edition, 1988.
[18]
R. Krebbers. Non-determinism and sequence points in C (blog post), 2013. Available at http://gallium.inria.fr/blog/ non-determinism-and-sequence-points-in-c/.
[19]
R. Krebbers. Aliasing restrictions of C11 formalized in Coq. In CPP, volume 8307 of LNCS, 2013.
[20]
R. Krebbers and F. Wiedijk. A Formalization of the C99 Standard in HOL, Isabelle and Coq. In CICM, volume 6824 of LNAI, pages 297--299, 2011.
[21]
R. Krebbers and F. Wiedijk. Separation Logic for Non-local Control Flow and Block Scope Variables. In FoSSaCS, volume 7794 of LNCS, pages 257--272, 2013.
[22]
X. Leroy. A formally verified compiler back-end. Journal of Automated Reasoning, 43(4):363--446, 2009.
[23]
X. Leroy. The CompCert verified compiler, software and commented proof. Available at http://compcert.inria.fr/, 2012.
[24]
X. Leroy, A. W. Appel, S. Blazy, and G. Stewart. The CompCert Memory Model, Version 2. Research report RR-7987, INRIA, 2012.
[25]
M. Norrish. C formalised in HOL. PhD thesis, University of Cambridge, 1998.
[26]
M. Norrish. Deterministic Expressions in C. In ESOP, volume 1576 of LNCS, pages 147--161, 1999.
[27]
P. W. O'Hearn. Resources, Concurrency and Local Reasoning. In CONCUR, volume 3170 of LNCS, pages 49--67, 2004.
[28]
P. W. O'Hearn, J. C. Reynolds, and H. Yang. Local Reasoning about Programs that Alter Data Structures. In CSL, volume 2142 of LNCS, pages 1--19, 2001.
[29]
D. v. Oheimb. Hoare logic for Java in Isabelle/HOL. Concurrency and Computation: Practice and Experience, 13(13):1173--1214, 2001.
[30]
N. Papaspyrou. A Formal Semantics for the C Programming Language. PhD thesis, National Technical University of Athens, 1998.
[31]
J. Regehr, Y. Chen, P. Cuoq, E. Eide, C. Ellison, and X. Yang. Testcase reduction for C compiler bugs. In PLDI, pages 335--346, 2012.
[32]
J. Sevcík, V. Vafeiadis, F. Z. Nardelli, S. Jagannathan, and P. Sewell. CompCertTSO: A Verified Compiler for Relaxed-Memory Concurrency. Journal of the ACM, 60(3):22, 2013.
[33]
B. Spitters and E. van der Weegen. Type classes for mathematics in type theory. Mathematical Structures in Computer Science, 21(4): 795--825, 2011.

Cited By

View all
  • (2022)The Right Kind of Non-Determinism: Using Concurrency to Verify C Programs with Underspecified SemanticsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.365.1365(1-16)Online publication date: 9-Aug-2022
  • (2021)RefinedC: automating the foundational verification of C code with refined ownership typesProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454036(158-174)Online publication date: 19-Jun-2021
  • (2021)Automated model extraction: From non-deterministic C code to active objectsScience of Computer Programming10.1016/j.scico.2020.102597204(102597)Online publication date: Apr-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
January 2014
702 pages
ISBN:9781450325448
DOI:10.1145/2535838
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 the author(s) 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: 08 January 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. c verification
  2. coq
  3. interactive theorem proving
  4. operational semantics
  5. separation logic

Qualifiers

  • Research-article

Conference

POPL '14
Sponsor:

Acceptance Rates

POPL '14 Paper Acceptance Rate 51 of 220 submissions, 23%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '26

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2022)The Right Kind of Non-Determinism: Using Concurrency to Verify C Programs with Underspecified SemanticsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.365.1365(1-16)Online publication date: 9-Aug-2022
  • (2021)RefinedC: automating the foundational verification of C code with refined ownership typesProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454036(158-174)Online publication date: 19-Jun-2021
  • (2021)Automated model extraction: From non-deterministic C code to active objectsScience of Computer Programming10.1016/j.scico.2020.102597204(102597)Online publication date: Apr-2021
  • (2020)OOElala: order-of-evaluation based alias analysis for compiler optimizationProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385962(839-853)Online publication date: 11-Jun-2020
  • (2019)Exploring C semantics and pointer provenanceProceedings of the ACM on Programming Languages10.1145/32903803:POPL(1-32)Online publication date: 2-Jan-2019
  • (2019)CompCertSJournal of Automated Reasoning10.1007/s10817-018-9496-y63:2(369-392)Online publication date: 1-Aug-2019
  • (2019)A Verified CompCert Front-End for a Memory Model Supporting Pointer Arithmetic and Uninitialised DataJournal of Automated Reasoning10.1007/s10817-017-9439-z62:4(433-480)Online publication date: 1-Apr-2019
  • (2019)Semi-automated Reasoning About Non-determinism in C ExpressionsProgramming Languages and Systems10.1007/978-3-030-17184-1_3(60-87)Online publication date: 6-Apr-2019
  • (2019)Compiling Sandboxes: Formally Verified Software Fault IsolationProgramming Languages and Systems10.1007/978-3-030-17184-1_18(499-524)Online publication date: 6-Apr-2019
  • (2017)Lenient Execution of C on a Java Virtual MachineProceedings of the 14th International Conference on Managed Languages and Runtimes10.1145/3132190.3132204(35-47)Online publication date: 27-Sep-2017
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media