Modeling, Sharing, and Recursion for Weak Reduction Strategies using Explicit Substitution
DOI:
https://doi.org/10.7146/brics.v3i56.18681Resumé
We present the lambda sigma^a_w calculus, a formal synthesis of the concepts of
sharing and explicit substitution for weak reduction. We show how
lambda sigma^a_w can be used as a foundation of implementations of functional
programming languages by modelling the essential ingredients of such
implementations, namely weak reduction strategies, recursion, space
leaks, recursive data structures, and parallel evaluation, in a uniform way.
First, we give a precise account of the major reduction strategies
used in functional programming and the consequences of choosing
lambda-graph-reduction vs. environment-based evaluation. Second, we show
how to add constructors and explicit recursion to give a precise account
of recursive functions and data structures even with respect to
space complexity. Third, we formalize the notion of space leaks in lambda sigma^a_w
and use this to define a space leak free calculus; this suggests optimisations
for call-by-need reduction that prevent space leaking and enables
us to prove that the "trimming" performed by the STG machine does
not leak space.
In summary we give a formal account of several implementation
techniques used by state of the art implementations of functional programming
languages.
Keywords. Implementation of functional programming, lambda
calculus, weak reduction, explicit substitution, sharing, recursion, space
leaks.
Downloads
Publiceret
Citation/Eksport
Nummer
Sektion
Licens
Authors who publish with this journal agree to the following terms:- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).