Hostname: page-component-6766d58669-mzsfj Total loading time: 0 Render date: 2026-05-21T04:51:12.937Z Has data issue: false hasContentIssue false

The verified CakeML compiler backend

Published online by Cambridge University Press:  04 February 2019

YONG KIAM TAN*
Affiliation:
Computer Science Department, Carnegie Mellon University, Pittsburgh, PA 15213, USA (e-mail: yongkiat@cs.cmu.edu)
MAGNUS O. MYREEN
Affiliation:
CSE, Chalmers University of Technology, Gothenburg 412 96, Sweden (e-mail: myreen@chalmers.se)
RAMANA KUMAR
Affiliation:
Data61, CSIRO / CSE, University of New South Wales, Kensington, NSW 2033, Australia (e-mail: ramana.kumar@gmail.com)
ANTHONY FOX
Affiliation:
Department of Computer Science and Technology, University of Cambridge, Cambridge CB3 0FD, UK (e-mail: Anthony.Fox@arm.com)
SCOTT OWENS
Affiliation:
School of Computing, University of Kent, Canterbury CT2 7NF, UK (e-mail: S.A.Owens@kent.ac.uk)
MICHAEL NORRISH
Affiliation:
Data61, CSIRO / Research School of Computer Science, Australian National University, Canberra, ACT 2600, Australia (e-mail: Michael.Norrish@data61.csiro.au)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

The CakeML compiler is, to the best of our knowledge, the most realistic verified compiler for a functional programming language to date. The architecture of the compiler, a sequence of intermediate languages through which high-level features are compiled away incrementally, enables verification of each compilation pass at an appropriate level of semantic detail. Parts of the compiler’s implementation resemble mainstream (unverified) compilers for strict functional languages, and it supports several important features and optimisations. These include efficient curried multi-argument functions, configurable data representations, efficient exceptions, register allocation, and more. The compiler produces machine code for five architectures: x86-64, ARMv6, ARMv8, MIPS-64, and RISC-V. The generated machine code contains the verified runtime system which includes a verified generational copying garbage collector and a verified arbitrary precision arithmetic (bignum) library. In this paper, we present the overall design of the compiler backend, including its 12 intermediate languages. We explain how the semantics and proofs fit together and provide detail on how the compiler has been bootstrapped inside the logic of a theorem prover. The entire development has been carried out within the HOL4 theorem prover.

Information

Type
Regular Paper
Copyright
© Cambridge University Press 2019 
Submit a response

Discussions

No Discussions have been published for this article.