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 条
  • [21] Verified Compilation of Synchronous Dataflow with State Machines
    Bourke, Timothy
    Pesin, Basile
    Pouzet, Marc
    [J]. ACM TRANSACTIONS ON EMBEDDED COMPUTING SYSTEMS, 2023, 22 (05)
  • [22] Verified Compilation of Floating-Point Computations
    Boldo, Sylvie
    Jourdan, Jacques-Henri
    Leroy, Xavier
    Melquiond, Guillaume
    [J]. JOURNAL OF AUTOMATED REASONING, 2015, 54 (02) : 135 - 163
  • [23] A sound abstract memory model for static analysis of C programs
    Dong, Yukun
    [J]. INTERNATIONAL JOURNAL OF COMPUTATIONAL SCIENCE AND ENGINEERING, 2018, 16 (03) : 255 - 264
  • [24] An Abstract Memory Functor for Verified C Static Analyzers
    Blazy, Sandrine
    Laporte, Vincent
    Pichardie, David
    [J]. ACM SIGPLAN NOTICES, 2016, 51 (09) : 325 - 337
  • [25] An abstract memory functor for verified C static analyzers
    Blazy S.
    Laporte V.
    Pichardie D.
    [J]. 1600, Association for Computing Machinery, 2 Penn Plaza, Suite 701, New York, NY 10121-0701, United States (51): : 325 - 337
  • [26] Compilation and communication strategies for out-of-core programs on distributed memory machines
    Bordawekar, R
    Choudhary, A
    Ramanujam, J
    [J]. JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING, 1996, 38 (02) : 277 - 288
  • [27] Verified Compilation of Space-Efficient Reversible Circuits
    Amy, Matthew
    Roetteler, Martin
    Svore, Krysta M.
    [J]. COMPUTER AIDED VERIFICATION (CAV 2017), PT II, 2017, 10427 : 3 - 21
  • [28] Verified bytecode verification and type-certifying compilation
    Klein, G
    Strecker, M
    [J]. JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2004, 58 (1-2): : 27 - 60
  • [29] Verified Compilation and the B Method: A Proposal and a First Appraisal
    Dantas, Bartira
    Deharbe, David
    Galvao, Stephenson
    Moreira, Anamaria Martins
    Medeiros Junior, Valerio
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2009, 240 (0C) : 79 - 96
  • [30] Verifiably Lazy Verified Compilation of Call-by-Need
    Stelle, George
    Stefanovic, Darko
    [J]. PROCEEDINGS OF THE 30TH SYMPOSIUM ON IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES (IFL 2018), 2018, : 49 - 58