English

The sufficiently smart compiler is a theorem prover

Programming Languages 2018-05-22 v1

Abstract

That the Haskell Compiler GHC is capable of proving non-trivial equalities between Haskell code, by virtue of its aggressive optimizer, in particular the term rewriting engine in the simplifier. We demonstrate this with a surprising little code in a GHC plugin, explains the knobs we had to turn, discuss the limits of the approach and related applications of the same idea, namely testing that promises from Haskell libraries with domain-specific optimizations hold.

Keywords

Cite

@article{arxiv.1805.08106,
  title  = {The sufficiently smart compiler is a theorem prover},
  author = {Joachim Breitner},
  journal= {arXiv preprint arXiv:1805.08106},
  year   = {2018}
}

Comments

Published in the IFL 2017 pre-proceedings

R2 v1 2026-06-23T02:02:49.194Z