skip to main content
research-article

Distilling abstract machines

Authors Info & Claims
Published:19 August 2014Publication History
Skip Abstract Section

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.Google ScholarGoogle Scholar
  2. B. Accattoli. Linear logic and strong normalization. In RTA, pages 39--54, 2013.Google ScholarGoogle Scholar
  3. B. Accattoli. Evaluating functions as processes. In TERMGRAPH, pages 41--55, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  4. B. Accattoli and U. Dal Lago. On the invariance of the unitary cost model for head reduction. In RTA, pages 22--37, 2012.Google ScholarGoogle Scholar
  5. B. Accattoli and U. Dal Lago. Beta Reduction is Invariant, Indeed. Accepted to LICS/CSL 2014, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B. Accattoli and D. Kesner. The structural λ-calculus. In CSL, pages 381--395, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. Accattoli and L. Paolini. Call-by-value solvability, revisited. In FLOPS, pages 4--16, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Accattoli and C. Sacerdoti Coen. On the Value of Variables. Accepted to WOLLIC 2014, 2014.Google ScholarGoogle Scholar
  9. B. Accattoli, P. Barenbaum, and D. Mazza. Distilling Abstract Machines (Long Version). Available at http://arxiv.org/abs/1406.2370, 2014.Google ScholarGoogle Scholar
  10. B. Accattoli, E. Bonelli, D. Kesner, and C. Lombardi. A nonstandard standardization theorem. In POPL, pages 659--670, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Z. M. Ariola and M. Felleisen. The call-by-need lambda calculus. J. Funct. Program., 7(3):265--301, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Z. M. Ariola, A. Bohannon, and A. Sabry. Sequent calculi and abstract machines. ACM Trans. Program. Lang. Syst., 31(4), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Biernacka and O. Danvy. A concrete framework for environment machines. ACM Trans. Comput. Log., 9(1), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Chang and M. Felleisen. The call-by-need lambda calculus, revisited. In ESOP, pages 128--147, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Clairambault. Estimation of the length of interactions in arena game semantics. In FOSSACS, pages 335--349, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Crégut. Strongly reducing variants of the Krivine abstract machine. Higher-Order and Symbolic Computation, 20(3):209--230, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. V. Danos and L. Regnier. Head linear reduction. Technical report, 2004.Google ScholarGoogle Scholar
  21. V. Danos, H. Herbelin, and L. Regnier. Game semantics & abstract machines. In LICS, pages 394--405, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. O. Danvy. A rational deconstruction of landin's secd machine. In IFL, pages 52--71, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. O. Danvy and L. R. Nielsen. Refocusing in reduction semantics. Technical Report RS-04-26, BRICS, 2004.Google ScholarGoogle Scholar
  24. O. Danvy and I. Zerny. A synthetic operational account of call-by-need evaluation. In PPDP, pages 97--108, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  26. R. Di Cosmo, D. Kesner, and E. Polonovski. Proof nets and explicit substitutions. Math. Str. in Comput. Sci., 13(3):409--450, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  29. R. Garcia, A. Lumsdaine, and A. Sabry. Lazy evaluation and delimited control. In POPL, pages 153--164, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. T. Hardin and L. Maranget. Functional runtime systems within the lambda-sigma calculus. J. Funct. Program., 8(2):131--176, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. Kesner. A theory of explicit substitutions with safe and full composition. Logical Methods in Computer Science, 5(3), 2009.Google ScholarGoogle Scholar
  32. D. Kesner and S. Lengrand. Resource operators for lambda-calculus. Inf. Comput., 205(4):419--473, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. D. Kesner and F. Renaud. The prismoid of resources. In MFCS, pages 464--476, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J.-L. Krivine. A call-by-name lambda-calculus machine. Higher-Order and Symbolic Computation, 20(3):199--207, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  36. F. Lang. Explaining the lazy Krivine machine using explicit substitution and addresses. Higher-Order and Symbolic Computation, 20(3):257--270, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  38. J. Maraist, M. Odersky, and P. Wadler. The call-by-need lambda calculus. J. Funct. Program., 8(3):275--317, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. G. Mascari and M. Pedicini. Head linear reduction and pure proof net extraction. Theor. Comput. Sci., 135(1):111--137, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. R. Milner. Local bigraphs and confluence: Two conjectures. Electr. Notes Theor. Comput. Sci., 175(3):65--73, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. R. P. Nederpelt. The fine-structure of lambda calculus. Technical Report CSN 92/07, Eindhoven Univ. of Technology, 1992.Google ScholarGoogle Scholar
  43. G. D. Plotkin. Call-by-name, call-by-value and the lambda-calculus. Theor. Comput. Sci., 1(2):125--159, 1975.Google ScholarGoogle ScholarCross RefCross Ref
  44. P. Sestoft. Deriving a lazy abstract machine. J. Funct. Program, 7(3): 231--264, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Distilling abstract machines

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!