A Verified Compiler from Isabelle/HOL to CakeML

Many theorem provers can generate functional programs from definitions or proofs. However, this code generation needs to be trusted. Except for the HOL4 system, which has a proof producing code generator for a subset of ML. We go one step further and provide a verified compiler from Isabelle/HOL to CakeML. More precisely we combine a simple proof producing translation of recursion equations in Isabelle/HOL into a deeply embedded term language with a fully verified compilation chain to the target language CakeML.

[1]  Tom Ridge,et al.  Lem: reusable engineering of real-world semantics , 2014, ICFP.

[2]  Markus Wenzel,et al.  Type Classes and Overloading in Higher-Order Logic , 1997, TPHOLs.

[3]  D. A. Turner,et al.  Some History of Functional Programming Languages - (Invited Talk) , 2012, Trends in Functional Programming.

[4]  Matthew Z. Weaver,et al.  CertiCoq : A verified compiler for Coq , 2016 .

[5]  Stefan Berghofer,et al.  Turning Inductive into Equational Specifications , 2009, TPHOLs.

[6]  Benjamin Grégoire,et al.  Full Reduction at Full Throttle , 2011, CPP.

[7]  Pierre Letouzey,et al.  A New Extraction for Coq , 2002, TYPES.

[8]  Simon L. Peyton Jones,et al.  Type Classes in Haskell , 1994, ESOP.

[9]  Andrei Popescu,et al.  Truly Modular (Co)datatypes for Isabelle/HOL , 2014, ITP.

[10]  Natarajan Shankar,et al.  Static Analysis for Safe Destructive Updates in a Functional Language , 2001, LOPSTR.

[11]  Lars Hupel Dictionary Construction , 2017, Arch. Formal Proofs.

[12]  Tobias Nipkow,et al.  Code Generation via Higher-Order Rewrite Systems , 2010, FLOPS.

[13]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

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

[15]  Xavier Leroy,et al.  Formal verification of a realistic compiler , 2009, CACM.

[16]  Chung-Kil Hur,et al.  Biorthogonality, step-indexing and compiler correctness , 2009, ICFP.

[17]  Alexander Krauss,et al.  Partial and Nested Recursive Function Definitions in Higher-order Logic , 2010, Journal of Automated Reasoning.

[18]  Tobias Nipkow,et al.  Concrete Semantics , 2014, Springer International Publishing.

[19]  Arthur David Flatau,et al.  A verified implementation of an applicative language with dynamic storage allocation , 1992 .

[20]  Ramana Kumar,et al.  Functional Big-Step Semantics , 2016, ESOP.

[21]  Peter Beike,et al.  The Definition Of Standard Ml Revised , 2016 .

[22]  Christian Urban,et al.  Nominal Techniques in Isabelle/HOL , 2005, Journal of Automated Reasoning.

[23]  Chung-Kil Hur,et al.  Pilsner: a compositionally verified compiler for a higher-order imperative language , 2015, ICFP.

[24]  Chris Okasaki,et al.  Purely functional data structures , 1998 .

[25]  Claudio Hermida,et al.  Logical Relations and Parametricity - A Reynolds Programme for Category Theory and Programming Languages , 2014, WACT.

[26]  Robert S. Boyer,et al.  Single-Threaded Objects in ACL2 , 2002, PADL.

[27]  Y. Forster,et al.  Verified Extraction from Coq to a Lambda-Calculus , 2016 .

[28]  Ramana Kumar,et al.  CakeML: a verified implementation of ML , 2014, POPL.

[29]  Tobias Nipkow,et al.  Executing Higher Order Logic , 2000, TYPES.

[30]  Natarajan Shankar,et al.  Evaluating, Testing, and Animating PVS Specications , 2001 .

[31]  José-Luis Ruiz-Reina,et al.  Efficient execution in an automated reasoning environment , 2008, J. Funct. Program..

[32]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[33]  Alexander Krauss,et al.  A Mechanized Translation from Higher-Order Logic to Set Theory , 2010, ITP.

[34]  Simon Peyton Jones,et al.  The Implementation of Functional Programming Languages (Prentice-hall International Series in Computer Science) , 1987 .

[35]  Ramana Kumar,et al.  Proof-Producing Reflection for HOL - With an Application to Model Polymorphism , 2015, ITP.

[36]  Markus Wenzel,et al.  Constructive Type Classes in Isabelle , 2006, TYPES.

[37]  de Ng Dick Bruijn Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[38]  Magnus O. Myreen,et al.  Proof-producing translation of higher-order logic into pure and stateful ML , 2014, Journal of Functional Programming.

[39]  Konrad Slind Reasoning about terminating functional programs , 1999 .

[40]  Ramana Kumar,et al.  A new verified compiler backend for CakeML , 2016, ICFP.

[41]  Lennart Augustsson,et al.  Compiling Pattern Matching , 1985, FPCA.

[42]  Adam Chlipala,et al.  A verified compiler for an impure functional language , 2010, POPL '10.

[43]  René Thiemann,et al.  Haskell's Show-Class in Isabelle/HOL , 2014, Arch. Formal Proofs.