Verified compilation of C programs with a nominal memory model
Yuting Wang, Ling Zhang, Zhong Shao, Jérémie Koenig
Abstract
Memory models play an important role in verified compilation of imperative programming languages. A representative one is the block-based memory model of CompCert---the state-of-the-art verified C compiler. Despite its success, the abstraction over memory space provided by CompCert's memory model is still primitive and inflexible. In essence, it uses a fixed representation for identifying memory blocks in a global memory space and uses a globally shared state for distinguishing between used and unused blocks. Therefore, any reasoning about memory must work uniformly for the global memory; it is impossible to individually reason about different sub-regions of memory (i.e., the stack and global definitions). This not only incurs unnecessary complexity in compiler verification, but also poses significant difficulty for supporting verified compilation of open or concurrent programs which need to work with contextual memory, as manifested in many previous extensions of CompCert. To remove the above limitations, we propose an enhancement to the block-based memory model based on nominal techniques; we call it the nominal memory model. By adopting the key concepts of nominal techniques such as atomic names and supports to model the memory space, we are able to 1) generalize the representation of memory blocks to any types satisfying the properties of atomic names and 2) remove the global constraints for managing memory blocks, enabling flexible memory structures for open and concurrent programs. To demonstrate the effectiveness of the nominal memory model, we develop a series of extensions of CompCert based on it. These extensions show that the nominal memory model 1) supports a general framework for verified compilation of C programs, 2) enables intuitive reasoning of compiler transformations on partial memory; and 3) enables modular reasoning about programs working with contextual memory. We also demonstrate that these extensions require limited changes to the original CompCert, making the verification techniques based on the nominal memory model easy to adopt.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 0b6f655b-e785-4969-89d6-cce8595f0b76Cited by top-tier papers3
- Fully Composable and Adequate Verified Compilation with Direct Refinements between Open ModulesLing Zhang, Yuting Wang, Jinhua Wu, Jérémie Koenig et al.POPL 2024 · 10 citations
- TensorRight: Automated Verification of Tensor Graph RewritesJai Arora, Sirui Lu, Devansh Jain, Tianfan Xu et al.POPL 2025 · 6 citations
- CompCertOC: Verified Compositional Compilation of Multi-threaded Programs with Shared StacksLing Zhang, Yuting Wang, Yalun Liang, Zhong ShaoPLDI 2025
Builds on3
- CompCertM: CompCert with C-assembly linking and lightweight modular verificationYoungju Song, Minki Cho, Dongjoo Kim, Yonghyun Kim et al.POPL 2020 · 49 citations
- CompCertELF: verified separate compilation of C programs into ELF object filesYuting Wang, Xiangzhe Xu, Pierre Wilke, Zhong ShaoOOPSLA 2020 · 26 citations
- CompCertO: compiling certified open C componentsJérémie Koenig, Zhong ShaoPLDI 2021 · 18 citations
Related papers
- An Iris Instance for Verifying CompCert C ProgramsWilliam Mansky, Ke DuPOPL 2024 · 14 citations
- Fully Verified Instruction SchedulingZiteng Yang, Jun Shirako, Vivek SarkarOOPSLA 2024 · 1 citation
- SECOMP: Formally Secure Compilation of Compartmentalized C ProgramsJérémy Thibault, Roberto Blanco, Dongjae Lee, Sven Argo et al.CCS 2024 · 1 citation
- Sequential reasoning for optimizing compilers under weak memory concurrencyMinki Cho, Sung-Hwan Lee, Dongjae Lee, Chung-Kil Hur et al.PLDI 2022 · 11 citations
- Formally Verifying Optimizations with Block SimulationsLéo Gourdin, Benjamin Bonneau, Sylvain Boulmé, David Monniaux et al.OOPSLA 2023 · 13 citations
