Maximal sharing in the lambda calculus with letrec
From MaRDI portal
Abstract: Increasing sharing in programs is desirable to compactify the code, and to avoid duplication of reduction work at run-time, thereby speeding up execution. We show how a maximal degree of sharing can be obtained for programs expressed as terms in the lambda calculus with letrec. We introduce a notion of `maximal compactness' for lambda-letrec-terms among all terms with the same infinite unfolding. Instead of defined purely syntactically, this notion is based on a graph semantics. lambda-letrec-terms are interpreted as first-order term graphs so that unfolding equivalence between terms is preserved and reflected through bisimilarity of the term graph interpretations. Compactness of the term graphs can then be compared via functional bisimulation. We describe practical and efficient methods for the following two problems: transforming a lambda-letrec-term into a maximally compact form; and deciding whether two lambda-letrec-terms are unfolding-equivalent. The transformation of a lambda-letrec-term into maximally compact form proceeds in three steps: (i) translate L into its term graph ; (ii) compute the maximally shared form of as its bisimulation collapse ; (iii) read back a lambda-letrec-term from the term graph with the property . This guarantees that and have the same unfolding, and that exhibits maximal sharing. The procedure for deciding whether two given lambda-letrec-terms and are unfolding-equivalent computes their term graph interpretations and , and checks whether these term graphs are bisimilar. For illustration, we also provide a readily usable implementation.
Recommendations
Cited in
(8)- Expressibility in the lambda calculus with
- Term graph representations for cyclic \(\lambda\)-terms
- Repetitive reduction patterns in lambda calculus with \texttt{letrec} (work in progress)
- Nested term graphs (work in progress)
- Modeling terms by graphs with structure constraints (two illustrations)
- scientific article; zbMATH DE number 7456061 (Why is no real title available?)
- Properties of a first-order functional language with sharing
- From compactifying lambda-letrec terms to recognizing regular-expression processes (extended abstract and literature)
This page was built for publication: Maximal sharing in the lambda calculus with letrec
Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q2819667)