A Framework for Modular, Extensible, Equivalence-Preserving Compilation

I present Pyrosome1 , a generic framework for the verification of extensible, compositional compilers in Coq. Current techniques for proving compiler correctness are generally tied to the specific structures of the languages and compilers that they support. This limits the extent to which these syst...

Full description

Bibliographic Details
Main Author: Jamner, Dustin
Other Authors: Chlipala, Adam
Format: Thesis
Published: Massachusetts Institute of Technology 2022
Online Access:https://hdl.handle.net/1721.1/144616
_version_ 1826196832390217728
author Jamner, Dustin
author2 Chlipala, Adam
author_facet Chlipala, Adam
Jamner, Dustin
author_sort Jamner, Dustin
collection MIT
description I present Pyrosome1 , a generic framework for the verification of extensible, compositional compilers in Coq. Current techniques for proving compiler correctness are generally tied to the specific structures of the languages and compilers that they support. This limits the extent to which these systems can be extended and composed. In Pyrosome, verified compilers are fully extensible, meaning that to add a new feature to a language simply requires defining and verifying the compilation of that single feature, reusing the old correctness theorem to cover all other cases. This is made possible by an inductive formulation of equivalence preservation that supports the addition of new rules to the source language, target language, and compiler. Pyrosome defines a formal, deeply embedded notion of programming languages with semantics given by sorted equational theories, so all compiler-correctness proofs boil down to type-checking and equational reasoning. My work supports vertical composition of any compilers expressed in Pyrosome in addition to feature extension. Since my design requires compilers to support open programs, my correctness guarantees support linking with any target code of the appropriate type. As a case study, I present a multipass compiler from STLC through CPS translation and closure conversion, and show that natural numbers, the unit type, recursive functions, and a global heap can be added to this compiler while reusing the original proofs.
first_indexed 2024-09-23T10:38:19Z
format Thesis
id mit-1721.1/144616
institution Massachusetts Institute of Technology
last_indexed 2024-09-23T10:38:19Z
publishDate 2022
publisher Massachusetts Institute of Technology
record_format dspace
spelling mit-1721.1/1446162022-08-30T03:47:48Z A Framework for Modular, Extensible, Equivalence-Preserving Compilation Jamner, Dustin Chlipala, Adam Massachusetts Institute of Technology. Department of Electrical Engineering and Computer Science I present Pyrosome1 , a generic framework for the verification of extensible, compositional compilers in Coq. Current techniques for proving compiler correctness are generally tied to the specific structures of the languages and compilers that they support. This limits the extent to which these systems can be extended and composed. In Pyrosome, verified compilers are fully extensible, meaning that to add a new feature to a language simply requires defining and verifying the compilation of that single feature, reusing the old correctness theorem to cover all other cases. This is made possible by an inductive formulation of equivalence preservation that supports the addition of new rules to the source language, target language, and compiler. Pyrosome defines a formal, deeply embedded notion of programming languages with semantics given by sorted equational theories, so all compiler-correctness proofs boil down to type-checking and equational reasoning. My work supports vertical composition of any compilers expressed in Pyrosome in addition to feature extension. Since my design requires compilers to support open programs, my correctness guarantees support linking with any target code of the appropriate type. As a case study, I present a multipass compiler from STLC through CPS translation and closure conversion, and show that natural numbers, the unit type, recursive functions, and a global heap can be added to this compiler while reusing the original proofs. S.M. 2022-08-29T15:59:49Z 2022-08-29T15:59:49Z 2022-05 2022-06-21T19:25:56.974Z Thesis https://hdl.handle.net/1721.1/144616 In Copyright - Educational Use Permitted Copyright MIT http://rightsstatements.org/page/InC-EDU/1.0/ application/pdf Massachusetts Institute of Technology
spellingShingle Jamner, Dustin
A Framework for Modular, Extensible, Equivalence-Preserving Compilation
title A Framework for Modular, Extensible, Equivalence-Preserving Compilation
title_full A Framework for Modular, Extensible, Equivalence-Preserving Compilation
title_fullStr A Framework for Modular, Extensible, Equivalence-Preserving Compilation
title_full_unstemmed A Framework for Modular, Extensible, Equivalence-Preserving Compilation
title_short A Framework for Modular, Extensible, Equivalence-Preserving Compilation
title_sort framework for modular extensible equivalence preserving compilation
url https://hdl.handle.net/1721.1/144616
work_keys_str_mv AT jamnerdustin aframeworkformodularextensibleequivalencepreservingcompilation
AT jamnerdustin frameworkformodularextensibleequivalencepreservingcompilation