Skip to content


Subversion checkout URL

You can clone with
Download ZIP
CakeML: A Verified Implementation of ML
Standard ML Haskell OCaml Shell PHP Assembly
Failed to load latest commit information.
candle rename hol-light directory to candle
compiler progress on Call case for bvp-to-word compiler
developers allow comments and blank lines in build sequence, and reorganise
documentation More manual writing
explorer examples/parsing has moved
lem_lib_stub tweaks to make lem files build with latest lem
semantics make dependency of semantics/proof on context-free more explicit
translator remove parsing from translator's Holmakefile
unverified remove more directories that seem not relevant (or not ready)
.gitignore gitignore the generated code, executable, and zip
.travis.yml add sudo: false to travis, to take advantage of docker
COPYING update copyright years
Holmakefile Merge branch 'master' into new_compiler
README start updating the top-level README
compute_basicLib.sml Fix semantics compute and add more missing computes
lib.lem The semantics of a very simple IO subsystem.
libScript.sml Merge branch 'master' into new_compiler
miscScript.sml start cleaning up some of the lemmas in word_to_stackProofTheory
mlstringLib.sig conversion for translating literal mlstring case splits to if-then-else
mlstringLib.sml make mlstring_case_conv slightly more robust/lenient
mlstringScript.sml define mlstring_cmp from mlstring_lt
mlstringSyntax.sig add strlit syntax fns to mlstringSyntax
mlstringSyntax.sml HolKernel.syntax_fns has changed type.
preamble.sml Merge branch 'new_compiler' into semantic_refactoring


The CakeML project (

A verified implementation of a significant subset of Standard ML in the HOL4
theorem prover (

We build CakeML using the latest development version of HOL4.
We build HOL on PolyML 5.5.2 (

This branch (master) contains the latest development version of CakeML.
See the version1 branch for the previous version.

Directory structure:

- semantics
    The definition of CakeML, including
    - its concrete syntax
    - its abstract syntax
    - small step semantics
    - big step semantics (both functional and relational)
    - semantics of FFI calls
    - a type system
    The definition is (mostly) expressed in
    Lem (,
    but the generated HOL is also included.

- semantics/proofs
    Metatheory of CakeML and other proofs about the semantics
    - a verified, clocked interpreter
    - determinism
    - type soundness
    - equivalence of the big and small step semantics
    - equivalence of functional and relational semantics

- compiler
    A verified compiler for CakeML, including:
    - parsing: lexer and PEG parser
    - inference: type inferencer
    - backend: compilation to ASM assembly language
    - targets: code generation to x86, ARM, and more

- translator
    A proof-producing translator from HOL functions to CakeML.

- unverified/interp
    Unverified implementation, in Haskell, of the CakeML frontend augmented
    with informative error messages.
- unverified/bytecode
    An unverified implementation of CakeML bytecode, written in C

- candle
    Verification of a HOL theorem prover, based on HOL Light
    (, implemented in CakeML.

- explorer
    Tools for stepping through execution of the compiler from one intermediate
    language to the next, and pretty-printing the intermediate results. An
    instance is available on the CakeML website.

- mlstringScript.sml, mlstringLib.sml, mlstringSyntax.sml
    Small theory of wrapped strings, so the translator can distinguish them
    from char lists and target CakeML strings.

- compute_basicLib.sml
    Build compsets for evaluation in the logic.

- miscLib.sml, miscScript.sml, preamble.sml
    Theorems and proof tools (e.g. tactics) used throughout the development.

- lem_lib_stub
    empty versions of the Lem libraries (which we don't use, but building with
    Lem requires)

- developers
    scripts for running regression tests and other miscellany

    Copyright notice, license, and disclaimer.
Something went wrong with that request. Please try again.