Modular Certification of Low-Level Intermediate Representation Programs

Modular certification of low-level intermediate representation (IR) programs is one of the key steps of proof-transforming compilation. The major challenges are the complexity of abstract control stacks and the lack of control flow information due to their flat nature.To tackle these challenges, we present in this paper a novel Hoare-style logic framework for modular certification of p-machine style bytecode as IR programs. This logic can fully support abstract control stacks and unstructured control flows for modular certification of IR programs involving while loops, procedure call/return, recursive procedures, and even nested procedures. It applies Foundational Proof-Carrying Code (FPCC) concepts to IR level. This system is expressive and fully mechanized. We prove its soundness and demonstrate its power by certifying the implementation of some IR programs in the Coq proof assistant. This work not only provides a solid theoretical foundation for reasoning about IR programs, but also makes an important advance toward building proof-transforming compilation environment in which certified IR code with proofs can be compiled to machine checkable proof-carrying low-level assembly code.

[1]  Andrew W. Appel,et al.  A Compositional Logic for Control Flow , 2006, VMCAI.

[2]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[3]  Christine Paulin-Mohring,et al.  The coq proof assistant reference manual , 2000 .

[4]  Gilles Barthe,et al.  Certificate Translation in Abstract Interpretation , 2008, ESOP.

[5]  Long Li,et al.  A general framework for certifying garbage collectors and their mutators , 2007, PLDI '07.

[6]  Martin Hofmann,et al.  A Program Logic for Resource Verification , 2004, TPHOLs.

[7]  Lilian Burdy,et al.  Java bytecode specification and verification , 2006, SAC.

[8]  Nick Benton A Typed, Compositional Logic for a Stack-Based Abstract Machine , 2005, APLAS.

[9]  Tarmo Uustalu,et al.  A compositional natural semantics and Hoare logic for low-level languages , 2007, Theor. Comput. Sci..

[10]  Niklaus Wirth,et al.  Algorithms + Data Structures = Programs , 1976 .

[11]  Xinyu Feng,et al.  Modular verification of assembly code with stack-based control abstractions , 2006, PLDI '06.

[12]  Hugo Herbelin,et al.  The Coq proof assistant : reference manual, version 6.1 , 1997 .

[13]  Claire Louise Quigley,et al.  A Programming Logic for Java Bytecode Programs , 2003, TPHOLs.

[14]  David von Oheimb Hoare logic for Java in Isabelle/HOL , 2001, Concurr. Comput. Pract. Exp..

[15]  George C. Necula,et al.  A certifying compiler for Java , 2000, PLDI '00.

[16]  Andrew W. Appel,et al.  Separation Logic for Small-Step cminor , 2007, TPHOLs.

[17]  Peter Müller,et al.  A Program Logic for Bytecode , 2005, Electron. Notes Theor. Comput. Sci..