Hostname: page-component-77c89778f8-m42fx Total loading time: 0 Render date: 2024-07-21T07:39:15.829Z Has data issue: false hasContentIssue false

The full-reducing Krivine abstract machine KN simulates pure normal-order reduction in lockstep: A proof via corresponding calculus

Published online by Cambridge University Press:  29 April 2019

ÁLVARO GARCÍA-PÉREZ
Affiliation:
IMDEA Software Institute, Campus de Montegancedo s/n, 28223 Pozuelo de Alarcon, Madrid, Spain (e-mail: alvaro.garcia.perez@imdea.org)
PABLO NOGUEIRA*
Affiliation:
ESNE, University School of Design, Innovation and Technology, Av. de Alfonso XIII, 97, 28016, Madrid, Spain (e-mail: pablo.nogueira@esne.es)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

We exploit the idea of proving properties of an abstract machine by using a corresponding semantic artefact better suited to their proof. The abstract machine is an improved version of Pierre Crégut’s full-reducing Krivine machine KN. The original version works with closed terms of the pure lambda calculus with de Bruijn indices. The improved version reduces in similar fashion but works on closures where terms may be open. The corresponding semantic artefact is a structural operational semantics of a calculus of closures whose reduction relation is purposely a reduction strategy. As shown in previous work, improved KN and the structural operational semantics ‘correspond’, i.e. both artefacts realise the same reduction strategy. In this paper, we prove in the calculus of closures that the reduction strategy simulates in lockstep (at every reduction step) the complete and standard normal-order strategy (i.e. leftmost reduction to normal form) of the pure lambda calculus. The simulation is witnessed by a substitution function from closures of the closure calculus to pure terms of the pure lambda calculus. Thus, KN also simulates normal-order in lockstep by the correspondence. This result is stronger than the known proof that KN is complete, for in the pure lambda calculus there are complete but non-standard strategies. The lockstep simulation proof consists of straightforward structural inductions, thanks to three properties of the closure calculus we call ‘index alignment’, ‘parameters-as-levels’ and ‘balanced derivations’. The first two come from KN. Thanks to these properties, a proof in a calculus of closures involving de Bruijn indices and de Bruijn levels is unproblematic. There is no lexical adjustment at binding lookup, on-the-fly alpha-conversion or recursive traversals of the term to deal with bound and free variables as in other calculi. This paper contributes to the framework for environment machines of Biernacka and Danvy a full-reducing open-terms closure calculus, its corresponding abstract machine, and a lockstep simulation proof via a substitution function.

Type
Regular Paper
Copyright
© Cambridge University Press 2019 

References

Abadi, M., Cardelli, L., Curien, P.-L. & Lévy, J.-J. (1991) Explicit substitutions. J. Funct. Program. 1(4), 375416.CrossRefGoogle Scholar
Accattoli, B. (2016) The useful MAM, a reasonable implementation of the strong lambda-calculus. In Proceedings of the 23rd Workshop on Logic, Language, Information and Computation. LNCS, vol. 9803. Springer, pp. 121.CrossRefGoogle Scholar
Accattoli, B. & Kesner, D. (2012) Preservation of strong normalisation modulo permutations for the structural lambda-calculus. Log. Methods Comput. Sci. 8(1), 144.CrossRefGoogle Scholar
Accattoli, B., Barenbaum, P. & Mazza, D. (2015) A strong distillery. In Proceedings of the 13th Asian Symposium on Programming and Systems. LNCS, vol. 9458. Springer, pp. 231250.CrossRefGoogle Scholar
Ariola, Z. M., Bohannon, A. & Sabry, A. (2009) Sequent calculi and abstract machines. ACM Trans. Program. Lang. Syst. 31(4), 13:113:48.CrossRefGoogle Scholar
Aydemir, B., Charguéraud, A., Pierce, B. C., Pollack, R. & Weirich, S. (2008) Engineering formal metatheory. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, pp. 315.CrossRefGoogle Scholar
Aydemir, B. E., Bohannon, A., Fairbairn, M., Foster, J. N., Pierce, B. C., Sewell, P., Vytiniotis, D., Washburn, G., Weirich, S. & Zdancewic, S. (2005) Mechanized metatheory for the masses: The POPLmark challenge. In Proceedings of the 18th International Conference on Theorem Proving in Higher Order Logics. LNCS, vol. 3603. Springer, pp. 5065.CrossRefGoogle Scholar
Barendregt, H. P. (1984) The Lambda Calculus, Its Syntax and Semantics. North Holland.Google Scholar
Barendregt, H. P. (1990) Functional programming and lambda calculus. In Chapter 7: Handbook of Theoretical Computer Science, vol. B. Elsevier / MIT Press, pp. 321364.Google Scholar
Barendregt, H. P., Kennaway, J. R., Klop, J. W. & Sleep, M. R. (1987) Needed reduction and spine strategies for the lambda calculus. Inf. Comput. 75, 191231.CrossRefGoogle Scholar
Biernacka, M. & Danvy, O. (2007) A concrete framework for environment machines. ACM Trans. Comput. Log. 9(1), 6:16:30.CrossRefGoogle Scholar
Charguéraud, A. (2012) The locally nameless representation. J. Autom. Reas. 49(3), 363408.CrossRefGoogle Scholar
Crégut, P. (2007) Strongly reducing variants of the Krivine abstract machine. Higher-Order Symb. Comput. 20(3), 209230.CrossRefGoogle Scholar
Curien, P.-L. (1986) Categorical Combinators, Sequential Algorithms and Functional Programming. John Wiley & Sons.Google Scholar
Curien, P.-L. (1991) An abstract framework for environment machines. Theor. Comput. Sci. 82(2), 389402.CrossRefGoogle Scholar
Curien, P.-L. & Herbelin, H. (2000) The duality of computation. In Proceedings of the 5th International Conference on Functional Programming. SIGPLAN Notices, vol. 35, issue no. 9. ACM Press, pp. 233243.CrossRefGoogle Scholar
Curien, P.-L., Hardin, T. & Lévy, J.-J. (1996) Confluence properties of weak and strong calculi of explicit substitutions. J. ACM 43(2), 362397.CrossRefGoogle Scholar
Curry, H. B. & Feys, R. (1958) Combinatory Logic, vol. 1. North-Holland.Google Scholar
Danvy, O. (2009) From reduction-based to reduction-free normalization. In 6th International School on Advanced Functional Programming, Revised Lectures. LNCS. Springer, pp. 66164.CrossRefGoogle Scholar
Danvy, O., Johannsen, J. & Zerny, I. (2011) A walk in the semantic park. In Proceedings of the 20th ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation. ACM Press, pp. 112.CrossRefGoogle Scholar
Danvy, O., Milikin, K. & Munk, J. (2013) A correspondence between full normalization by reduction and full normalization by evaluation. Talk presented at A scientific meeting in honor of Pierre-Louis Curien, Venice, 911 September.Google Scholar
de Bruijn, N. G. (1972) Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Math. 34(5), 381392.CrossRefGoogle Scholar
Diehl, S., Hartel, P. & Sestoft, P. (2000) Abstract machines for programming language implementation. Future Gener. Comput. Syst. 16(7), 739751.CrossRefGoogle Scholar
Felleisen, M. (1987) The Calculi of Lambda-v-cs Conversion: A Syntactic Theory of Control and State in Imperative Higher-Order Programming Languages. Ph.D. thesis, Department of Computer Science, Indiana University.Google Scholar
García-Pérez, Á. (2014) Operational Aspects of Full Reduction in Lambda Calculi. Ph.D. thesis, ETSI Informáticos, Universidad Politécnica de Madrid.Google Scholar
García-Pérez, Á. & Nogueira, P. (2014) On the syntactic and functional correspondence between hybrid (or layered) normalisers and abstract machines. Sci. Comput. Program. 95(Part 2), 176199.CrossRefGoogle Scholar
García-Pérez, Á.,Nogueira, P. & Moreno-Navarro, J. J. (2013) Deriving the full-reducing Krivine machine from the small-step operational semantics of normal order. In Proceedings of the 15th International Symposium on Principles and Practice of Declarative Programming. ACM Press, pp. 8596.CrossRefGoogle Scholar
Grégoire, B. & Leroy, X. (2002) A compiled implementation of strong reduction. In Proceedings of the 7th International Conference on Functional Programming, vol. 37, issue no. (9), pp. 235246.Google Scholar
Kahn, G. (1987) Natural semantics. In Proceedings of Symposium on Theoretical Aspects of Computer Science. LNCS, vol. 247. Springer, pp. 2239.CrossRefGoogle Scholar
Keller, R. M. (1976) Formal verification of parallel programs. Commun. ACM 19(7), 371384.CrossRefGoogle Scholar
Kesner, D. (2007) The theory of calculi with explicit substitutions revisited. In Proceedings of the 21st International Workshop on Computer Science Logic. LNCS, vol. 4646. Springer, pp. 238252.CrossRefGoogle Scholar
Kesner, D. (2009) A theory of explicit substitutions with safe and full composition. Log. Methods Comput. Sci. 5(3), 129.CrossRefGoogle Scholar
Kiselyov, O. (2018) λ to SKI, semantically - declarative pearl. In Proceedings of the 14th International Symposium on Functional and Logic Programming. LNCS. Springer, pp. 3350.CrossRefGoogle Scholar
Krivine, J.-L. (2007) A call-by-name lambda-calculus machine. Higher-Order Symb. Comput. 20(3), 199207.CrossRefGoogle Scholar
Lescanne, P. & Rouyer-Degli, J. (1995) Explicit substitutions with de Bruijn’s levels. In Proceedings of the 6th International Conference on Rewriting Techniques and Applications. LNCS, vol. 914. Springer, pp. 294308.CrossRefGoogle Scholar
Melliès, P.-A. (1995) Typed lambda-calculi with explicit substitutions may not terminate. In Proceedings of the 2nd International Conference on Typed Lambda Calculi and Applications. LNCS, vol. 902. Springer, pp. 328334.CrossRefGoogle Scholar
Munk, J. (2008) A Study of Syntactic and Semantic Artifacts and its Application to Lambda Definability, Strong Normalization, and Weak Normalization in the Presence of State. M. Phil. thesis, BRICS, Aarhus University.CrossRefGoogle Scholar
Paulson, L.C. (1996) ML For the Working Programmer. 2nd ed. New York, NY: Cambridge University Press.CrossRefGoogle Scholar
Peyton-Jones, S. (1987) The Implementation of Functional Programming Languages. Prentice-Hall.Google Scholar
Pierce, B. (2002) Types and Programming Languages. The MIT Press.Google Scholar
Plotkin, G. (1975) Call-by-name, call-by-value and the lambda calculus. Theor. Comput. Sci. 1(2), 125159.Google Scholar
Plotkin, G. (1981) A structural approach to operational semantics. Technical Report DAIMI FN-19. Department of Computer Science, Aarhus University, Denmark.Google Scholar
Pollack, R. (1994) Closure under alpha-conversion. In Proceedings of the 1993 International Workshop on Types for Proofs and Programs. LNCS, vol. 806. Springer, pp. 313332.CrossRefGoogle Scholar
Ronchi Della Rocca, S. & Paolini, L. (2004) The Parametric Lambda Calculus. Springer.CrossRefGoogle Scholar
Scherer, G. & Rémy, D. (2015) Full reduction in the face of absurdity. Proceedings of Programming Languages and Systems - 24th European Symposium on Programming. LNCS, vol. 9032. Springer, pp. 685709.CrossRefGoogle Scholar
Sestoft, P. (2002) Demonstrating lambda calculus reduction. In The Essence of Computation, Complexity, Analysis, Transformation. Essays Dedicated to Neil D. Jones. LNCS, vol. 2566. Springer, pp. 420435.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.