Hostname: page-component-8448b6f56d-gtxcr Total loading time: 0 Render date: 2024-04-24T21:55:48.399Z Has data issue: false hasContentIssue false

Counting and generating terms in the binary lambda calculus*

Published online by Cambridge University Press:  29 December 2015

KATARZYNA GRYGIEL
Affiliation:
Theoretical Computer Science Department, Faculty of Mathematics and Computer Science, Jagiellonian University, ul. Prof. Łojasiewicza 6, 30-348 Kraków, Poland (e-mail: grygiel@tcs.uj.edu.pl)
PIERRE LESCANNE
Affiliation:
École normale supérieure de Lyon, LIP (UMR 5668 CNRS ENS Lyon UCBL INRIA), University of Lyon, 46 allée d'Italie, 69364 Lyon, France (e-mail: pierre.lescanne@ens-lyon.fr)
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.

In a paper, entitled Binary lambda calculus and combinatory logic, John Tromp presents a simple way of encoding lambda calculus terms as binary sequences. In what follows, we study the numbers of binary strings of a given size that represent lambda terms and derive results from their generating functions, especially that the number of terms of size n grows roughly like 1.963447954. . .n. In a second part we use this approach to generate random lambda terms using Boltzmann samplers.

Type
Articles
Copyright
Copyright © Cambridge University Press 2015 

Footnotes

*

This work was partially supported by the grant 2013/11/B/ST6/00975 founded by the Polish National Science Center.

References

Bacher, A., Bodini, O. & Jacquot, A. (2014) Efficient random sampling of binary and unary-binary trees via holonomic equations. Corr, abs/1401.1140.Google Scholar
Bodini, O., Gardy, D. & Gittenberger, B. (2011) Lambda-terms of bounded unary height. In Proceedings of the 8th Workshop on Analytic Algorithmics and Combinatorics (ANALCO), (SIAM), Holiday Inn San Fransisco Golden Gateway, San Fransisco, California, USA, pp. 23–32.CrossRefGoogle Scholar
Bodini, O., Gardy, D. & Jacquot, A. (2013a) Asymptotics and random sampling for BCI and BCK lambda terms. Theor. Comput. Sci. 502, 227238.CrossRefGoogle Scholar
Bodini, O., Gardy, D., Gittenberger, B. & Jacquot, A. (2013b) Enumeration of generalized BCI lambda-terms. Electr. J. Comb. 20 (4), P30.CrossRefGoogle Scholar
Claessen, K. & Hughes, J. (2000) QuickCheck: A lightweight tool for random testing of Haskell programs. In ICFP, Odersky, M. & Wadler, P. (eds), ACM, pp. 268–279.CrossRefGoogle Scholar
David, R., Grygiel, K., Kozik, J., Raffalli, C., Theyssier, G. & Zaionc, M. (2013) Asymptotically almost all λ-terms are strongly normalizing. Log. Methods Comput. Sci. 9 (1:02), 130.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
Duchon, P., Flajolet, P., Louchard, G. & Schaeffer, G. (2004) Boltzmann samplers for the random generation of combinatorial structures. Comb. Probab. Comput. 13 (4–5), 577625.CrossRefGoogle Scholar
Flajolet, P., Fusy, É. & Pivoteau, C. (2007) Boltzmann sampling of unlabeled structures. In Proceedings of the Fourth Workshop on Analytic Algorithmics and Combinatorics, ANALCO, New Orleans, Louisiana, USA, January 06, 2007, pp. 201–211.CrossRefGoogle Scholar
Flajolet, P. & Sedgewick, R. (2008) Analytic Combinatorics. Cambridge University Press.Google Scholar
Grygiel, K. & Lescanne, P. (2013) Counting and generating lambda terms. J. Funct. Program. 23 (5), 594628.CrossRefGoogle Scholar
Grygiel, K. & Lescanne, P. (2014) Counting terms in the binary lambda calculus. Corr, abs/1401.0379. Published in the Proceedings of 25th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms, Available at: https://hal.inria.fr/hal-01077251.Google Scholar
Hindley, J. R. (1997) Basic Simple Type Theory. Cambridge Tracts in Theoretical Computer Science, no. 42, Cambridge University Press.CrossRefGoogle Scholar
Karttunen, A. (2015) Ranking and Unranking Functions. OEIS Wiki. Available at: http://oeis.org/wiki/Ranking_and_unranking_functions.Google Scholar
Knuth, D. E. (2006) The Art of Computer Programming, Volume 4, Fascicle 4: Generating All Trees, History of Combinatorial Generation (Art of Computer Programming). Addison-Wesley.Google Scholar
Lescanne, P. (1994) From λσ to λυ, a journey through calculi of explicit substitutions. In Boehm, H. (ed), Proceedings of the 21st Annual ACM Symposium on Principles of Programming Languages, Portland (Or., USA), ACM, pp. 60–69.Google Scholar
Lescanne, P. (2013) On counting untyped lambda terms. Theor.Comput. Sci., 474, 8097.CrossRefGoogle Scholar
Li, M. & Vitányi, P. (2008) An Introduction to Kolmogorov Complexity and its Applications, 3rd ed., New York, Inc: Springer-Verlag.CrossRefGoogle Scholar
Nijenhuis, A. & Wilf, H. S. (1978) Combinatorial Algorithms, 2nd ed., Computer Science and Applied Mathematics, New York: Academic Press.Google Scholar
Peyton Jones, S. (ed) (2003) Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press.Google Scholar
Rémy, J.-L. (1985) Un procédé itératif de dénombrement d'arbres binaires et son application à leur génération aléatoire. ITA 19 (2), 179195.Google Scholar
Tarau, P. (2015) On type-directed generation of lambda terms. In Proceedings of the 31st International Conference on Logic Programming (ICLP 2015), Available at: http://dblp.uni-trier.de/rec/bibtex/conf/iclp/Tarau15.Google Scholar
Tromp, J. (2006) Binary lambda calculus and combinatory logic. In Kolmogorov Complexity and Applications, Hutter, M., Merkle, W. & Vitányi, P. M. B. (eds), Dagstuhl Seminar Proceedings, vol. 06051, Internationales Begegnungs- und Forschungszentrum fuer Informatik (IBFI), Schloss Dagstuhl, Germany.Google Scholar
Wang, J. 2004 (May). The Efficient Generation of Random Programs and their Applications. Honors Thesis, Wellesley College, Wellesley, MA.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.