skip to main content
10.1145/2628136.2628154acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Distilling abstract machines

Published: 19 August 2014 Publication History

Abstract

It is well-known that many environment-based abstract machines can be seen as strategies in lambda calculi with explicit substitutions (ES). Recently, graphical syntaxes and linear logic led to the linear substitution calculus (LSC), a new approach to ES that is halfway between small-step calculi and traditional calculi with ES. This paper studies the relationship between the LSC and environment-based abstract machines. While traditional calculi with ES simulate abstract machines, the LSC rather distills them: some transitions are simulated while others vanish, as they map to a notion of structural congruence. The distillation process unveils that abstract machines in fact implement weak linear head reduction, a notion of evaluation having a central role in the theory of linear logic. We show that such a pattern applies uniformly in call-by-name, call-by-value, and call-by-need, catching many machines in the literature. We start by distilling the KAM, the CEK, and a sketch of the ZINC, and then provide simplified versions of the SECD, the lazy KAM, and Sestoft's machine. Along the way we also introduce some new machines with global environments. Moreover, we show that distillation preserves the time complexity of the executions, i.e. the LSC is a complexity-preserving abstraction of abstract machines.

References

[1]
B. Accattoli. An abstract factorization theorem for explicit substitutions. In RTA, pages 6--21, 2012.
[2]
B. Accattoli. Linear logic and strong normalization. In RTA, pages 39--54, 2013.
[3]
B. Accattoli. Evaluating functions as processes. In TERMGRAPH, pages 41--55, 2013.
[4]
B. Accattoli and U. Dal Lago. On the invariance of the unitary cost model for head reduction. In RTA, pages 22--37, 2012.
[5]
B. Accattoli and U. Dal Lago. Beta Reduction is Invariant, Indeed. Accepted to LICS/CSL 2014, 2014.
[6]
B. Accattoli and D. Kesner. The structural λ-calculus. In CSL, pages 381--395, 2010.
[7]
B. Accattoli and L. Paolini. Call-by-value solvability, revisited. In FLOPS, pages 4--16, 2012.
[8]
B. Accattoli and C. Sacerdoti Coen. On the Value of Variables. Accepted to WOLLIC 2014, 2014.
[9]
B. Accattoli, P. Barenbaum, and D. Mazza. Distilling Abstract Machines (Long Version). Available at http://arxiv.org/abs/1406.2370, 2014.
[10]
B. Accattoli, E. Bonelli, D. Kesner, and C. Lombardi. A nonstandard standardization theorem. In POPL, pages 659--670, 2014.
[11]
M. S. Ager, D. Biernacki, O. Danvy, and J. Midtgaard. A functional correspondence between evaluators and abstract machines. In PPDP, pages 8--19, 2003.
[12]
M. S. Ager, O. Danvy, and J. Midtgaard. A functional correspondence between call-by-need evaluators and lazy abstract machines. Inf. Process. Lett., 90(5):223--232, 2004.
[13]
Z. M. Ariola and M. Felleisen. The call-by-need lambda calculus. J. Funct. Program., 7(3):265--301, 1997.
[14]
Z. M. Ariola, A. Bohannon, and A. Sabry. Sequent calculi and abstract machines. ACM Trans. Program. Lang. Syst., 31(4), 2009.
[15]
M. Biernacka and O. Danvy. A syntactic correspondence between context-sensitive calculi and abstract machines. Theor. Comput. Sci., 375(1-3):76--108, 2007.
[16]
M. Biernacka and O. Danvy. A concrete framework for environment machines. ACM Trans. Comput. Log., 9(1), 2007.
[17]
S. Chang and M. Felleisen. The call-by-need lambda calculus, revisited. In ESOP, pages 128--147, 2012.
[18]
P. Clairambault. Estimation of the length of interactions in arena game semantics. In FOSSACS, pages 335--349, 2011.
[19]
P. Crégut. Strongly reducing variants of the Krivine abstract machine. Higher-Order and Symbolic Computation, 20(3):209--230, 2007.
[20]
V. Danos and L. Regnier. Head linear reduction. Technical report, 2004.
[21]
V. Danos, H. Herbelin, and L. Regnier. Game semantics & abstract machines. In LICS, pages 394--405, 1996.
[22]
O. Danvy. A rational deconstruction of landin's secd machine. In IFL, pages 52--71, 2004.
[23]
O. Danvy and L. R. Nielsen. Refocusing in reduction semantics. Technical Report RS-04-26, BRICS, 2004.
[24]
O. Danvy and I. Zerny. A synthetic operational account of call-by-need evaluation. In PPDP, pages 97--108, 2013.
[25]
N. G. de Bruijn. Generalizing Automath by Means of a Lambda-Typed Lambda Calculus. In Mathematical Logic and Theoretical Computer Science, number 106 in Lecture Notes in Pure and Applied Mathematics, pages 71--92. Marcel Dekker, 1987.
[26]
R. Di Cosmo, D. Kesner, and E. Polonovski. Proof nets and explicit substitutions. Math. Str. in Comput. Sci., 13(3):409--450, 2003.
[27]
T. Ehrhard and L. Regnier. Böhm trees, Krivine's machine and the Taylor expansion of lambda-terms. In CiE, pages 186--197, 2006.
[28]
M. Felleisen and D. P. Friedman. Control operators, the SECDmachine, and the lambda-calculus. In 3rd Working Conference on the Formal Description of Programming Concepts, Aug. 1986.
[29]
R. Garcia, A. Lumsdaine, and A. Sabry. Lazy evaluation and delimited control. In POPL, pages 153--164, 2009.
[30]
T. Hardin and L. Maranget. Functional runtime systems within the lambda-sigma calculus. J. Funct. Program., 8(2):131--176, 1998.
[31]
D. Kesner. A theory of explicit substitutions with safe and full composition. Logical Methods in Computer Science, 5(3), 2009.
[32]
D. Kesner and S. Lengrand. Resource operators for lambda-calculus. Inf. Comput., 205(4):419--473, 2007.
[33]
D. Kesner and F. Renaud. The prismoid of resources. In MFCS, pages 464--476, 2009.
[34]
J.-L. Krivine. A call-by-name lambda-calculus machine. Higher-Order and Symbolic Computation, 20(3):199--207, 2007.
[35]
P. J. Landin. The Mechanical Evaluation of Expressions. The Computer Journal, 6(4):308--320, Jan. 1964. URL http://dx.doi.org/10.1093/comjnl/6.4.308.
[36]
F. Lang. Explaining the lazy Krivine machine using explicit substitution and addresses. Higher-Order and Symbolic Computation, 20(3):257--270, 2007.
[37]
X. Leroy. The ZINC experiment: an economical implementation of the ML language. Technical report 117, INRIA, 1990. URL http://gallium.inria.fr/xleroy/publi/ZINC.pdf.
[38]
J. Maraist, M. Odersky, and P. Wadler. The call-by-need lambda calculus. J. Funct. Program., 8(3):275--317, 1998.
[39]
J. Maraist, M. Odersky, D. N. Turner, and P. Wadler. Call-by-name, call-by-value, call-by-need and the linear lambda calculus. Theor. Comput. Sci., 228(1-2):175--210, 1999.
[40]
G. Mascari and M. Pedicini. Head linear reduction and pure proof net extraction. Theor. Comput. Sci., 135(1):111--137, 1994.
[41]
R. Milner. Local bigraphs and confluence: Two conjectures. Electr. Notes Theor. Comput. Sci., 175(3):65--73, 2007.
[42]
R. P. Nederpelt. The fine-structure of lambda calculus. Technical Report CSN 92/07, Eindhoven Univ. of Technology, 1992.
[43]
G. D. Plotkin. Call-by-name, call-by-value and the lambda-calculus. Theor. Comput. Sci., 1(2):125--159, 1975.
[44]
P. Sestoft. Deriving a lazy abstract machine. J. Funct. Program, 7(3): 231--264, 1997.

Cited By

View all
  • (2024)Preorder-Constrained Simulations for Program Refinement with EffectsCoalgebraic Methods in Computer Science10.1007/978-3-031-66438-0_3(44-64)Online publication date: 6-Apr-2024
  • (2023)Sharing a Perspective on the 𝜆-CalculusProceedings of the 2023 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3622758.3622884(179-190)Online publication date: 18-Oct-2023
  • (2023)A Diamond Machine for Strong EvaluationProgramming Languages and Systems10.1007/978-981-99-8311-7_4(69-90)Online publication date: 26-Nov-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '14: Proceedings of the 19th ACM SIGPLAN international conference on Functional programming
August 2014
390 pages
ISBN:9781450328739
DOI:10.1145/2628136
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 August 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. abstract machines
  2. call-by-need
  3. explicit substitutions
  4. lambda-calculus
  5. linear head reduction
  6. linear logic

Qualifiers

  • Research-article

Funding Sources

Conference

ICFP'14
Sponsor:

Acceptance Rates

ICFP '14 Paper Acceptance Rate 28 of 85 submissions, 33%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)25
  • Downloads (Last 6 weeks)2
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Preorder-Constrained Simulations for Program Refinement with EffectsCoalgebraic Methods in Computer Science10.1007/978-3-031-66438-0_3(44-64)Online publication date: 6-Apr-2024
  • (2023)Sharing a Perspective on the 𝜆-CalculusProceedings of the 2023 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3622758.3622884(179-190)Online publication date: 18-Oct-2023
  • (2023)A Diamond Machine for Strong EvaluationProgramming Languages and Systems10.1007/978-981-99-8311-7_4(69-90)Online publication date: 26-Nov-2023
  • (2022)Multi types and reasonable spaceProceedings of the ACM on Programming Languages10.1145/35476506:ICFP(799-825)Online publication date: 31-Aug-2022
  • (2022)Reasonable Space for the λ-Calculus, LogarithmicallyProceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3531130.3533362(1-13)Online publication date: 2-Aug-2022
  • (2022)Exponentials as Substitutions and the Cost of Cut Elimination in Linear LogicProceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/3531130.3532445(1-15)Online publication date: 2-Aug-2022
  • (2022)A fine-grained computational interpretation of Girard’s intuitionistic proof-netsProceedings of the ACM on Programming Languages10.1145/34986696:POPL(1-28)Online publication date: 12-Jan-2022
  • (2021)Corpse reviver: sound and efficient gradual typing via contract verificationProceedings of the ACM on Programming Languages10.1145/34343345:POPL(1-28)Online publication date: 4-Jan-2021
  • (2021)A pre-expectation calculus for probabilistic sensitivityProceedings of the ACM on Programming Languages10.1145/34343335:POPL(1-28)Online publication date: 4-Jan-2021
  • (2021)The (In)Efficiency of interactionProceedings of the ACM on Programming Languages10.1145/34343325:POPL(1-33)Online publication date: 4-Jan-2021
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media