Abstract
We introduce a compressed de Bruijn representation of lambda terms and define its bijections to standard representations. Compact combinatorial generation algorithms are given for several families of lambda terms, including open, closed, simply typed and linear terms as well as type inference and normal order reduction algorithms. We specify our algorithms as a literate Prolog program. In the process, we rely in creative ways on unification of logic variables, cyclic terms, backtracking and definite clause grammars.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Barendregt, H.P.: The Lambda Calculus Its Syntax and Semantics, Revised edn., vol. 103. North Holland (1984)
Bruijn, N.G.D.: Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser Theorem. Indagationes Mathematicae 34, 381–392 (1972)
Stanley, R.P.: Enumerative Combinatorics. Wadsworth Publ. Co., Belmont (1986)
Barendregt, H.P.: Lambda calculi with types. In: Handbook of Logic in Computer Science, vol. 2. Oxford University Press (1991)
Sloane, N.J.A.: The On-Line Encyclopedia of Integer Sequences (2014). Published electronically at https://oeis.org/
Grygiel, K., Lescanne, P.: Counting and generating lambda terms. J. Funct. Program. 23(5), 594–628 (2013)
Grygiel, K., Idziak, P.M., Zaionc, M.: How big is BCI fragment of BCK logic. J. Log. Comput. 23(3), 673–691 (2013)
Bodini, O., Gardy, D., Gittenberger, B.: Lambda-terms of bounded unary height. In: ANALCO, pp. 23–32. SIAM (2011)
Wikipedia: Binary lambda calculus – wikipedia, the free encyclopedia (2015) [Online; accessed 20-February-2015]
Pfenning, F., Elliot, C.: Higher-order abstract syntax. In: Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation. PLDI 1988, New York, pp. 199–208. ACM (1988)
Sestoft, P.: Demonstrating lambda calculus reduction. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 420–435. Springer, Heidelberg (2002)
David, R., Grygiel, K., Kozik, J., Raffalli, C., Theyssier, G., Zaionc, M.: Asymptotically almost all \(\lambda \)-terms are strongly normalizing. Preprint: arXiv: math. LO/0903.5505 v3 (2010)
David, R., Raffalli, C., Theyssier, G., Grygiel, K., Kozik, J., Zaionc, M.: Some properties of random lambda terms. Logical Methods in Computer Science 9(1) (2009)
Kamareddine, F.: Reviewing the Classical and the de Bruijn Notation for calculus and Pure Type Systems. Journal of Logic and Computation 11(3), 363–394 (2001)
Miller, D.: Unification of simply typed lambda-terms as logic programming. In: Proc. Int. Conference on Logic Programming (Paris), pp. 255–269. MIT Press (1991)
Nadathur, G., Mitchell, D.J.: System description: teyjus - a compiler and abstract machine based implementation of \(\lambda \)prolog. In: Ganzinger, H. (ed.) CADE 1999. LNCS (LNAI), vol. 1632, pp. 287–291. Springer, Heidelberg (1999)
Miller, D., Nadathur, G.: Programming with Higher-Order Logic. Cambridge University Press, New York (2012)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Tarau, P. (2015). On Logic Programming Representations of Lambda Terms: de Bruijn Indices, Compression, Type Inference, Combinatorial Generation, Normalization. In: Pontelli, E., Son, T. (eds) Practical Aspects of Declarative Languages. PADL 2015. Lecture Notes in Computer Science(), vol 9131. Springer, Cham. https://doi.org/10.1007/978-3-319-19686-2_9
Download citation
DOI: https://doi.org/10.1007/978-3-319-19686-2_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-19685-5
Online ISBN: 978-3-319-19686-2
eBook Packages: Computer ScienceComputer Science (R0)