Title :
A Certifying Compiler for Clike Subset of C Language
Author :
Li, Zhaopeng ; Zhuang, Zhong ; Chen, Yiyun ; Yang, Simin ; Zhang, Zhenting ; Fan, Dawei
Author_Institution :
Sch. of Comput. Sci. & Technol., Univ. of Sci. & Technol. of China, Hefei, China
Abstract :
Proof-carrying code (PCC) is a technique that allows code consumers to check whether the code is safe to execute or not through a formal safety proof provided by the code producer. And a certifying compiler makes PCC practical by compiling annotated source code into low-level code and proofs. In this paper we present a certifying compiler for a subset of the C programming language, named Clike, with built-in automated theorem provers. Clike programs can be compiled by ANSI C compiler without any modification. Our compiler is intended to deal with data structures such as singly-linked lists, doubly-linked lists and trees. At the source level, we have designed a program logic combining a constrained first-order logic and a fragment of separation logic. We use a verification-condition-based method, and the generated verification conditions are sent to the built-in automated theorem prover. Our prover will generate proof terms when the input formula is valid. The low-level verification framework follows Hoare-style verification methods. The assembly code, its specification and proofs are generated automatically based on a variant of Stack-based Certifying Assembly Programming (SCAP). We implement our certifying compiler prototype in SML/NJ and build our prover libraries using the meta logic provided by Coq. We have used our prototype to successfully certify a considerable number of programs manipulating linked-lists and binary trees.
Keywords :
C language; formal logic; formal verification; program compilers; theorem proving; trees (mathematics); ANSI C compiler; C programming language; Clike subset; Hoare-style verification methods; SCAP; binary trees; certifying compiler; first-order logic; proof-carrying code; separation logic; stack-based certifying assembly programming; Assembly; Computer languages; Program processors; Prototypes; Registers; Safety; Syntactics; Certifying Compiler; Program Verification; Proof-Carrying Code; Separation Logic; Theorem Prover;
Conference_Titel :
Theoretical Aspects of Software Engineering (TASE), 2010 4th IEEE International Symposium on
Conference_Location :
Taipei
Print_ISBN :
978-1-4244-7847-7
DOI :
10.1109/TASE.2010.8