Distilling abstract machines

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.

[1]  Jean-Louis Krivine,et al.  A call-by-name lambda-calculus machine , 2007, High. Order Symb. Comput..

[2]  Olivier Danvy,et al.  A functional correspondence between call-by-need evaluators and lazy abstract machines , 2003, Inf. Process. Lett..

[3]  Olivier Danvy,et al.  A syntactic correspondence between context-sensitive calculi and abstract machines , 2005, Theor. Comput. Sci..

[4]  Frédéric Lang,et al.  Explaining the lazy Krivine machine using explicit substitution and addresses , 2007, High. Order Symb. Comput..

[5]  Amr Sabry,et al.  Lazy evaluation and delimited control , 2009, POPL '09.

[6]  Delia Kesner,et al.  The Prismoid of Resources , 2009, MFCS.

[7]  Peter Sestoft,et al.  Deriving a lazy abstract machine , 1997, Journal of Functional Programming.

[8]  Beniamino Accattoli Evaluating functions as processes , 2013, TERMGRAPH.

[9]  Robin Milner,et al.  Local Bigraphs and Confluence: Two Conjectures: (Extended Abstract) , 2007, EXPRESS.

[10]  Vincent Danos,et al.  Head Linear Reduction , 2004 .

[11]  Ugo Dal Lago,et al.  On the Invariance of the Unitary Cost Model for Head Reduction (Long Version) , 2012, RTA.

[12]  Lasse R. Nielsen,et al.  Refocusing in Reduction Semantics , 2004 .

[13]  Amr Sabry,et al.  Sequent calculi and abstract machines , 2009, TOPL.

[14]  Roberto Di Cosmo,et al.  Proof nets and explicit substitutions , 2000, Mathematical Structures in Computer Science.

[15]  Rp Rob Nederpelt The fine-structure of lambda calculus , 1992 .

[16]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

[17]  Delia Kesner,et al.  A Theory of Explicit Substitutions with Safe and Full Composition , 2009, Log. Methods Comput. Sci..

[18]  Delia Kesner,et al.  The structural λ-calculus , 2010 .

[19]  C. Q. Lee,et al.  The Computer Journal , 1958, Nature.

[20]  Delia Kesner,et al.  A nonstandard standardization theorem , 2014, POPL.

[21]  Vincent Danos,et al.  Game Semantics & Abstract Machines. , 1996, LICS 1996.

[22]  Beniamino Accattoli,et al.  An Abstract Factorization Theorem for Explicit Substitutions , 2012, RTA.

[23]  Olivier Danvy A Rational Deconstruction of Landin's SECD Machine , 2004, IFL.

[24]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[25]  Claudio Sacerdoti Coen,et al.  On the Value of Variables , 2014, WoLLIC.

[26]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[27]  Thomas Ehrhard,et al.  Böhm Trees, Krivine's Machine and the Taylor Expansion of Lambda-Terms , 2006, CiE.

[28]  Luca Paolini,et al.  Call-by-Value Solvability, Revisited , 2012, FLOPS.

[29]  CrégutPierre Strongly reducing variants of the Krivine abstract machine , 2007 .

[30]  Olivier Danvy,et al.  A synthetic operational account of call-by-need evaluation , 2013, PPDP.

[31]  Ugo Dal Lago,et al.  (Leftmost-Outermost) Beta Reduction is Invariant, Indeed , 2016, Log. Methods Comput. Sci..

[32]  Matthias Felleisen,et al.  The call-by-need lambda calculus , 1997, Journal of Functional Programming.

[33]  Delia Kesner,et al.  Resource operators for lambda-calculus , 2007, Inf. Comput..

[34]  Martin Odersky,et al.  Call-by-name, Call-by-value, Call-by-need and the Linear lambda Calculus , 1999, Theor. Comput. Sci..

[35]  Olivier Danvy,et al.  A functional correspondence between evaluators and abstract machines , 2003, PPDP '03.

[36]  Olivier Danvy,et al.  A concrete framework for environment machines , 2005, TOCL.

[37]  Thérèse Hardin,et al.  Functional runtime systems within the lambda-sigma calculus , 1998, Journal of Functional Programming.

[38]  Simona Ronchi Della Rocca,et al.  Call-by-value Solvability , 1999, RAIRO Theor. Informatics Appl..

[39]  Xavier Leroy,et al.  The ZINC experiment : an economical implementation of the ML language , 1990 .

[40]  Damiano Mazza,et al.  Distilling Abstract Machines (Long Version) , 2014, ArXiv.

[41]  Pierre Clairambault Estimation of the length of interactions in arena game semantics , 2011, FoSSaCS.

[42]  de Ng Dick Bruijn Generalizing Automath by means of a lambda-typed lambda calculus , 1987 .

[43]  Matthias Felleisen,et al.  The Call-by-need Lambda Calculus, Revisited , 2012, ESOP.

[44]  Pierre Crégut,et al.  Strongly reducing variants of the Krivine abstract machine , 2007, High. Order Symb. Comput..

[45]  Vincent Danos,et al.  Game semantics and abstract machines , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[46]  Gianfranco Mascari,et al.  Head Linear Reduction and Pure Proof Net Extraction , 1992, Theor. Comput. Sci..

[47]  Beniamino Accattoli Linear Logic and Strong Normalization , 2013, RTA.