PureCake: A Verified Compiler for a Lazy Functional Language
Journal article, 2023

We present PureCake, a mechanically-verified compiler for PureLang, a lazy, purely functional programming language with monadic effects. PureLang syntax is Haskell-like and indentation-sensitive, and its constraint-based Hindley-Milner type system guarantees safe execution. We derive sound equational reasoning principles over its operational semantics, dramatically simplifying some proofs. We prove end-To-end correctness for the compilation of PureLang down to machine code-The first such result for any lazy language-by targeting CakeML and composing with its verified compiler. Multiple optimisation passes are necessary to handle realistic lazy idioms effectively. We develop PureCake entirely within the HOL4 interactive theorem prover.

HOL4

interactive theorem proving

compiler verification

Haskell

Author

Hrutvik Kanabar

University Of Kent

Samuel Vivien

ENS

Oskar Abrahamsson

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

Magnus Myreen

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

M. Norrish

Australian National University

Johannes Åman Pohjola

University of New South Wales (UNSW)

Riccardo Zanetti

Student at Chalmers

Proceedings of the ACM on Programming Languages

24751421 (eISSN)

Vol. 7 145

Subject Categories

Embedded Systems

Computer Science

DOI

10.1145/3591259

More information

Latest update

1/3/2024 9