Abstract
We study the sequence of numbers corresponding to \(\lambda \)-terms of given size in the model based on de Bruijn indices. It turns out that the sequence enumerates also two families of binary trees, i.e. black-white and zigzag-free ones. We provide a constructive proof of this fact by exhibiting appropriate bijections. Moreover, we investigate the asymptotic density of \(\lambda \)-terms containing an arbitrary fixed subterm, showing that strongly normalizing terms are of density 0 among all \(\lambda \)-terms.
This work was partially supported by the grant 2013/11/B/ST6/00975 founded by the Polish National Science Center.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Bendkowski, M.: Natural counting of lambda terms - Haskell implementations (2015). https://github.com/maciej-bendkowski/natural-counting-of-lambda-terms
Online Encyclopedia of Integer Sequences. http://oeis.org/
Bacher, A., Bodini, O., Jacquot, A.: Exact-size sampling for Motzkin trees in linear time via Boltzmann samplers and Holonomic specification. In: Proceedings of the Meeting on Analytic Algorithmics and Combinatorics, pp. 52–61. SIAM (2013)
Bodini, O., Gardy, D., Gittenberger, B.: Lambda terms of bounded unary height. In: Proceedings of the Eighth Workshop on Analytic Algorithmics and Combinatorics, pp. 23–32 (2011). http://www.siam.org/proceedings/analco/2011/anl11_03_bodinio.pdf
Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming, ICFP 2000, pp. 268–279. ACM, New York (2000)
David, R., Grygiel, K., Kozik, J., Raffalli, Ch., Theyssier, G., Zaionc, M.: Asymptotically almost all \(\lambda \)-terms are strongly normalizing. Logical Methods Comput. Sci. 9, 1–30 (2013)
Flajolet, P., Sedgewick, R.: Analytic Combinatorics. Cambridge University Press, New York (2009). ISBN:0521898064, 9780521898065
Grygiel, K., Lescanne, P.: Counting and generating lambda terms. J. Funct. Program. 23(5), 594–628 (2013)
Grygiel, K., Lescanne, P.: Counting terms in the binary lambda calculus. In: Proceedings of the 25th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms (2014). https://hal.inria.fr/hal-01077251
Gu, N.S.S., Li, N.Y., Mansour, T.: 2-Binary trees: bijections and related issues. Discrete Math. 308(7), 1209–1221 (2008). http://dx.doi.org/10.1016/j.disc.2007.04.007
Salvy, B., Zimmermann, P.: Gfun: a Maple package for the manipulation of generating and holonomic functions in one variable. ACM Trans. Math. Softw. 2, 163–177 (1994). http://dx.doi.org/10.1145/178365.178368
Sapounakis, A., Tasoulas, I., Tsikouras, P.: Ordered trees and the inorder traversal. Discrete Math. 306(15), 1732–1741 (2006). http://dx.doi.org/10.1016/j.disc.2006.03.044
Tromp, J.: Binary lambda calculus and combinatory logic. In: Kolmogorov Complexity and Applications (2006)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bendkowski, M., Grygiel, K., Lescanne, P., Zaionc, M. (2016). A Natural Counting of Lambda Terms. In: Freivalds, R., Engels, G., Catania, B. (eds) SOFSEM 2016: Theory and Practice of Computer Science. SOFSEM 2016. Lecture Notes in Computer Science(), vol 9587. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-49192-8_15
Download citation
DOI: https://doi.org/10.1007/978-3-662-49192-8_15
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-49191-1
Online ISBN: 978-3-662-49192-8
eBook Packages: Computer ScienceComputer Science (R0)