CakeML: A verified implementation of ML

Ramana Kumar, Magnus O. Myreen, Michael Norrish, Scott Owens

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

226 Citations (Scopus)

Abstract

We have developed and mechanically verified an ML system called CakeML, which supports a substantial subset of Standard ML. CakeML is implemented as an interactive read-eval-print loop (REPL) in x86-64 machine code. Our correctness theorem ensures that this REPL implementation prints only those results permitted by the semantics of CakeML. Our verification effort touches on a breadth of topics including lexing, parsing, type checking, incremental and dynamic compilation, garbage collection, arbitrary-precision arithmetic, and compiler bootstrapping. Our contributions are twofold. The first is simply in building a system that is end-to-end verified, demonstrating that each piece of such a verification effort can in practice be composed with the others, and ensuring that none of the pieces rely on any over-simplifying assumptions. The second is developing novel approaches to some of the more challenging aspects of the verification. In particular, our formally verified compiler can bootstrap itself: we apply the verified compiler to itself to produce a verified machine-code implementation of the compiler. Additionally, our compiler proof handles diverging input programs with a lightweight approach based on logical timeout exceptions. The entire development was carried out in the HOL4 theorem prover.

Original languageEnglish
Title of host publicationPOPL 2014 - Proceedings of the 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
Pages179-191
Number of pages13
DOIs
Publication statusPublished - 2014
Externally publishedYes
Event41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2014 - San Diego, CA, United States
Duration: 22 Jan 201424 Jan 2014

Publication series

NameConference Record of the Annual ACM Symposium on Principles of Programming Languages
ISSN (Print)0730-8566

Conference

Conference41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2014
Country/TerritoryUnited States
CitySan Diego, CA
Period22/01/1424/01/14

Fingerprint

Dive into the research topics of 'CakeML: A verified implementation of ML'. Together they form a unique fingerprint.

Cite this