Skip to main content Accessibility help
×
Home
Hostname: page-component-559fc8cf4f-28jzs Total loading time: 1.449 Render date: 2021-02-26T07:40:17.183Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false, "newCitedByModal": true }

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)
Corresponding

Abstract

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 

Access options

Get access to the full version of this content by using one of the access options below.

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.Google 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.Google 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.CrossRefGoogle 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.

Full text views

Full text views reflects PDF downloads, PDFs sent to Google Drive, Dropbox and Kindle and HTML full text views.

Total number of HTML views: 0
Total number of PDF views: 49 *
View data table for this chart

* Views captured on Cambridge Core between September 2016 - 26th February 2021. This data will be updated every 24 hours.

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Counting and generating terms in the binary lambda calculus*
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Counting and generating terms in the binary lambda calculus*
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Counting and generating terms in the binary lambda calculus*
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *