Mechanized Semantics for the Clight Subset of the C Language

This article presents the formal semantics of a large subset of the C language called Clight. Clight includes pointer arithmetic, struct and union types, C loops and structured switch statements. Clight is the source language of the CompCert verified compiler. The formal semantics of Clight is a big-step operational semantics that observes both terminating and diverging executions and produces traces of input/output events. The formal semantics of Clight is mechanized using the Coq proof assistant. In addition to the semantics of Clight, this article describes its integration in the CompCert verified compiler and several ways by which the semantics was validated.

[1]  Xavier Leroy,et al.  Formal Verification of a C-like Memory Model and Its Uses for Verifying Program Transformations , 2008, Journal of Automated Reasoning.

[2]  Koushik Sen,et al.  CUTE: a concolic unit testing engine for C , 2005, ESEC/FSE-13.

[3]  David Delahaye,et al.  Extracting Purely Functional Contents from Logical Inductive Types , 2007, TPHOLs.

[4]  Les Hatton,et al.  Safer language subsets: an overview and a case history, MISRA C , 2004, Inf. Softw. Technol..

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

[6]  Norbert Schirmer,et al.  A Verification Environment for Sequential Imperative Programs in Isabelle/HOL , 2005, LPAR.

[7]  Tobias Nipkow,et al.  A machine-checked model for a Java-like language, virtual machine, and compiler , 2006, TOPL.

[8]  Scott Owens,et al.  A Sound Semantics for OCamllight , 2008, ESOP.

[9]  Richard Ballard,et al.  The Ant and the Grasshopper: Rationalising Exclusion and Inequality in the Post-apartheid City , 2004 .

[10]  Igor S. Anureev,et al.  Towards Verification of C Programs: Axiomatic Semantics of the C-kernel Language , 2003, Programming and Computer Software.

[11]  Hendrik Tews,et al.  Nova Micro--Hypervisor Verification , 2008 .

[12]  Charles Hymans,et al.  Newspeak, Doubleplussimple Minilang for Goodthinkful Static Analysis of C EADS IW/SE Technical Note 2008-IW-SE-00010-1 , 2008 .

[13]  Michael Norrish C formalised in HOL , 1998 .

[14]  Norbert Schirmer,et al.  Verification of sequential imperative programs in Isabelle-HOL , 2006 .

[15]  Wolfgang J. Paul,et al.  Towards the Formal Verification of a C0 Compiler: Code Generation and Implementation Correctnes , 2005, SEFM.

[16]  Michael Norrish,et al.  Engineering with logic: HOL specification and symbolic-evaluation testing for TCP implementations , 2006, POPL '06.

[17]  Jim Alves-Foss,et al.  Higher Order Logic Theorem Proving and its Applications 8th International Workshop, Aspen Grove, Ut, Usa, September 11-14, 1995 : Proceedings , 1995 .

[18]  Yuri Gurevich,et al.  The Semantics of the C Programming Language , 1992, CSL.

[19]  Karl Crary,et al.  Towards a mechanized metatheory of standard ML , 2007, POPL '07.

[20]  George C. Necula,et al.  CCured in the real world , 2003, PLDI '03.

[21]  Elsa L. Gunter,et al.  Hol-ml , 1993, HUG.

[22]  Nikolaos Papaspyrou,et al.  A Formal Semantics for the C Programming Language , 2000 .

[23]  Claude Marché,et al.  Multi-prover Verification of C Programs , 2004, ICFEM.

[24]  Bart Jacobs,et al.  Java Program Verification via a Hoare Logic with Abrupt Termination , 2000, FASE.

[25]  Xavier Leroy,et al.  A Formally Verified Compiler Back-end , 2009, Journal of Automated Reasoning.

[26]  Xavier Leroy,et al.  Formal Verification of a C Compiler Front-End , 2006, FM.

[27]  Pieter H. Hartel,et al.  Formalizing the safety of Java, the Java virtual machine, and Java card , 2001, CSUR.

[28]  Tom Ridge,et al.  Ott: effective tool support for the working semanticist , 2007, ICFP '07.

[29]  Peter W. O'Hearn,et al.  Separation Logic Semantics for Communicating Processes , 2008, FICS.

[30]  Yves Bertot,et al.  Interactive Theorem Proving and Program Development: Coq'Art The Calculus of Inductive Constructions , 2010 .

[31]  Andrew W. Appel,et al.  A List-machine Benchmark for Mechanized Metatheory ( Extended Abstract ) , 2006 .

[32]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[33]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[34]  Xavier Leroy,et al.  Coinductive big-step operational semantics , 2006, Inf. Comput..

[35]  Michael Norrish,et al.  Deterministic Expressions in C , 1999, ESOP.

[36]  Benjamin Grégoire,et al.  A compiled implementation of strong reduction , 2002, ICFP '02.

[37]  T. Paine Common Sense , 1995 .

[38]  Lawrence Charles Paulson,et al.  Isabelle/HOL: A Proof Assistant for Higher-Order Logic , 2002 .

[39]  Hendrik Tews,et al.  A Formal Model of Memory Peculiarities for the Verification of Low-Level Operating-System Code , 2008, SSV.

[40]  George C. Necula,et al.  CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs , 2002, CC.

[41]  Ben Hardekopf,et al.  The ant and the grasshopper: fast and accurate pointer analysis for millions of lines of code , 2007, PLDI '07.

[42]  Egon Börger,et al.  A high-level modular definition of the semantics of C# , 2005, Theor. Comput. Sci..

[43]  Isil Dillig,et al.  An overview of the saturn project , 2007, PASTE '07.