On the syntactic and functional correspondence between hybrid (or layered) normalisers and abstract machines

We show how to connect the syntactic and the functional correspondence for normalisers and abstract machines implementing hybrid (or layered) reduction strategies, that is, strategies that depend on subsidiary sub-strategies. Many fundamental strategies in the literature are hybrid, in particular, many full-reducing strategies, and many full-reducing and complete strategies that deliver a fully reduced result when it exists. If we follow the standard program-transformation steps the abstract machines obtained for hybrids after the syntactic correspondence cannot be refunctionalised, and the junction with the functional correspondence is severed. However, a solution is possible based on establishing the shape invariant of well-formed continuation stacks. We illustrate the problem and the solution with the derivation of substitution-based normalisers for normal order, a hybrid, full-reducing, and complete strategy of the pure lambda calculus. The machine we obtain is a substitution-based, eval/apply, open-terms version of Pierre Cregut's full-reducing Krivine machine KN.

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

[2]  Olivier Danvy,et al.  On the equivalence between small-step and big-step abstract machines: a simple application of lightweight fusion , 2007, Inf. Process. Lett..

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

[4]  Olivier Danvy,et al.  A walk in the semantic park , 2011, PEPM '11.

[5]  Gilles Kahn,et al.  Natural Semantics , 1987, STACS.

[6]  Olivier Danvy,et al.  From Reduction-based to Reduction-free Normalization , 2004, WRS.

[7]  Mitchell Wand,et al.  Trampolined style , 1999, ICFP '99.

[8]  Pablo Nogueira,et al.  A syntactic and functional correspondence between reduction semantics and reduction-free full normalisers , 2013, PEPM '13.

[9]  Pierre-Louis Curien Categorical Combinators, Sequential Algorithms, and Functional Programming , 1993, Progress in Theoretical Computer Science.

[10]  KLAUS AEHLIG,et al.  Operational aspects of untyped Normalisation by Evaluation , 2004, Math. Struct. Comput. Sci..

[11]  Gordon D. Plotkin,et al.  A structural approach to operational semantics , 2004, J. Log. Algebraic Methods Program..

[12]  Johan Munk,et al.  A Study of Syntactic and Semantic Artifacts and its Application to Lambda Definability, Strong Normalization, and Weak Normalization in the Presence of... , 2008 .

[13]  Deepak Kapur,et al.  On Proving Uniform Termination and Restricted Termination of Rewriting Systems , 1983, SIAM J. Comput..

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

[15]  Olivier Danvy,et al.  From Interpreter to Compiler and Virtual Machine: A Functional Derivation , 2003 .

[16]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[17]  Juan José Moreno-Navarro,et al.  Deriving the full-reducing Krivine machine from the small-step operational semantics of normal order , 2013, PPDP.

[18]  Nachum Dershowitz Termination of Linear Rewriting Systems (Preliminary Version) , 1981, ICALP.

[19]  Olivier Danvy,et al.  A Functional Correspondence between Evaluators and Abstract Machines , 2003 .

[20]  Olivier Danvy,et al.  A functional correspondence between monadic evaluators and abstract machines for languages with computational effects , 2003, Theor. Comput. Sci..

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

[22]  Sam Tobin-Hochstadt,et al.  Run your research: on the effectiveness of lightweight mechanization , 2012, POPL '12.

[23]  Matthias Felleisen,et al.  The calculi of lambda-nu-cs conversion: a syntactic theory of control and state in imperative higher-order programming languages , 1987 .

[24]  Lawrence C. Paulson,et al.  ML for the working programmer (2. ed.) , 1996 .

[25]  Hendrik Pieter Barendregt,et al.  Needed Reduction and Spine Strategies for the Lambda Calculus , 1987, Inf. Comput..

[26]  Pierre Crégut,et al.  An abstract machine for Lambda-terms normalization , 1990, LISP and Functional Programming.

[27]  Simona Ronchi Della Rocca,et al.  The Parametric Lambda Calculus , 2004, Texts in Theoretical Computer Science.

[28]  Olivier Danvy,et al.  An Operational Foundation for Delimited Continuations in the CPS Hierarchy , 2005, Log. Methods Comput. Sci..

[29]  Olivier Danvy,et al.  From Outermost Reduction Semantics to Abstract Machine , 2015, LOPSTR.

[30]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[31]  Lawrence Charles Paulson,et al.  ML for the working programmer , 1991 .

[32]  Peter Sestoft,et al.  Demonstrating Lambda Calculus Reduction , 2001, MFPS.

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

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

[35]  Benjamin Grégoire,et al.  A compiled implementation of strong reduction , 2002, ICFP '02.

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