Patrick Bahr IT University of Copenhagen

Beyond Trees: Calculating Graph-Based Compilers (Functional Pearl)

Patrick Bahr and Graham Hutton
Proc. ACM Program. Lang., 8(ICFP), 2024.

Abstract

Bahr and Hutton recently developed an approach to compiler calculation that allows a wide range of compilers to be derived from specifications of their correctness. However, a limitation of the approach is that it results in compilers that produce tree-structured code. By contrast, realistic compilers produce code that is essentially graph-structured, where the edges in the graph represent jumps that transfer the flow of control to other locations in the code. In this article, we show how their approach can naturally be adapted to calculate compilers that produce graph-structured code, without changing the underlying calculational methodology, by using a higher-order abstract syntax representation of graphs.

Categories: Compilers, Formal Verification

Tags: Graphs, Higher-order Abstract Syntax, Program Calculation