Skip to main content

Proof-producing synthesis of CakeML with I/O and local state from monadic HOL functions


Son Ho, Oskar Abrahamsson, Ramana Kumar, Magnus Myreen, Yong Kiam Tan and Michael Norrish

Carnegie Mellon University


MINES ParisTech


Chalmers University of Technology

Australian National University


We introduce an automatic method for producing stateful ML programs together with proofs of correctness from monadic functions in HOL. Our mechanism supports references, exceptions, and I/O operations, and can generate functions manipulating local state, which can then be encapsulated for use in a pure context. We apply this approach to several non-trivial examples, including the type inferencer and register allocator of the otherwise pure CakeML compiler, which now benefits from better runtime performance. This development has been carried out in the HOL4 theorem prover.

BibTeX Entry

    publisher        = {Springer},
    doi              = {\_42},
    month            = jul,
    booktitle        = {International Joint Conference on Automated Reasoning},
    paperurl         = {},
    year             = {2018},
    editor           = {{Didier Galmiche and Stephan Schulz and Roberto Sebastiani}},
    title            = {Proof-Producing Synthesis of {CakeML} with {I}/{O} and Local State from Monadic {HOL} Functions},
    author           = {Ho, Son and Abrahamsson, Oskar and Kumar, Ramana and Myreen, Magnus and Tan, Yong Kiam and Norrish,
    address          = {Oxford},
    date             = {2018-7-14},
    pages            = {646-662}