Verified Compilation of C Programs with a Nominal Memory Model

被引:3
|
作者
Wang, Yuting [1 ]
Zhang, Ling [1 ]
Shao, Zhong [2 ]
Koenig, Jeremie [2 ]
机构
[1] Shanghai Jiao Tong Univ, John Hoperoft Ctr Comp Sci, Shanghai, Peoples R China
[2] Yale Univ, New Haven, CT USA
基金
中国国家自然科学基金; 美国国家科学基金会;
关键词
Memory Models; Nominal Techniques; Verified Compilation; GAME SEMANTICS; ABSTRACTION;
D O I
10.1145/3498686
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Memory models play an important role in verified compilation of imperative programming languages. A representative one is the block-based memory model of CompCertDthe 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.
引用
收藏
页数:31
相关论文
共 50 条
  • [1] Verified Compilation for Shared-Memory C
    Beringer, Lennart
    Stewart, Gordon
    Dockins, Robert
    Appel, Andrew W.
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, 2014, 8410 : 107 - 127
  • [2] CompCertELF: Verified Separate Compilation of C Programs into ELF Object Files
    Wang, Yuting
    Xu, Xiangzhe
    Wilke, Pierre
    Shao, Zhong
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4
  • [3] Relaxed-Memory Concurrency and Verified Compilation
    Sevcik, Jaroslav
    Vafeiadis, Viktor
    Nardelli, Francesco Zappa
    Jagannathan, Suresh
    Sewell, Peter
    [J]. POPL 11: PROCEEDINGS OF THE 38TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2011, : 43 - 54
  • [4] Relaxed-Memory Concurrency and Verified Compilation
    Sevcik, Jaroslav
    Vafeiadis, Viktor
    Nardelli, Francesco Zappa
    Jagannathan, Suresh
    Sewell, Peter
    [J]. ACM SIGPLAN NOTICES, 2011, 46 (01) : 43 - 54
  • [5] Verified secure compilation for mixed-sensitivity concurrent programs
    Sison, Robert
    Murray, Toby
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2021, 31
  • [6] Verified Compilation on a Verified Processor
    Loow, Andreas
    Kumar, Ramana
    Tan, Yong Kiam
    Myreen, Magnus O.
    Norrish, Michael
    Abrahamsson, Oskar
    Fox, Anthony
    [J]. PROCEEDINGS OF THE 40TH ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '19), 2019, : 1041 - 1053
  • [7] Generation of Verified Programs for In-Memory Computing
    Froehlich, Saman
    Drechsler, Rolf
    [J]. 2022 25TH EUROMICRO CONFERENCE ON DIGITAL SYSTEM DESIGN (DSD), 2022, : 815 - 820
  • [8] Verified Compilation of Quantum Oracles
    Li, Liyi
    Voichick, Finn
    Hietala, Kesha
    Peng, Yuxiang
    Wu, Xiaodi
    Hicks, Michael
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (OOPSLA): : 589 - 615
  • [9] Atomicity Refinement for Verified Compilation
    Jagannathan, Suresh
    Petri, Gustavo
    Vitek, Jan
    Pichardie, David
    Laporte, Vincent
    [J]. ACM SIGPLAN NOTICES, 2014, 49 (06) : 27 - 27
  • [10] Atomicity Refinement for Verified Compilation
    Jagannathan, Suresh
    Laporte, Vincent
    Petri, Gustavo
    Pichardie, David
    Vitek, Jan
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2014, 36 (02):