On counting untyped lambda terms

Despite @l-calculus is now three quarters of a century old, no formula counting @l-terms has been proposed yet, and the combinatorics of @l-calculus is considered a hard problem. The difficulty lies in the fact that the recursive expression of the numbers of terms of size n with at most m free variables contains the number of terms of size n-1 with at most m+1 variables. This leads to complex recurrences that cannot be handled by classical analytic methods. Here based on de Bruijn indices (another presentation of @l-calculus) we propose several results on counting untyped lambda terms, i.e., on telling how many terms belong to such or such class, according to the size of the terms and/or to the number of free variables. We extend the results to normal forms.

[1]  Christophe Raffalli,et al.  Asymptotically almost all \lambda-terms are strongly normalizing , 2009 .

[2]  René David,et al.  Counting proofs in propositional logic , 2009, Arch. Math. Log..

[3]  Marek Zaionc,et al.  Probability distribution for simple tautologies , 2006, Theor. Comput. Sci..

[4]  de Ng Dick Bruijn Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[5]  Michèle Soria,et al.  Complexity Analysis of Term-Rewriting Systems , 1989, Theor. Comput. Sci..

[6]  Koen Claessen,et al.  Testing an optimising compiler by generating random lambda terms , 2011, AST '11.

[7]  Danièle Gardy,et al.  Tautologies over implication with negative literals , 2010, Math. Log. Q..

[8]  René David,et al.  Some properties of random lambda terms , 2009, Log. Methods Comput. Sci..

[9]  Donald E. Knuth,et al.  Selected papers on analysis of algorithms , 2000, CSLI lecture notes series.

[10]  Danièle Gardy,et al.  Classical and Intuitionistic Logic Are Asymptotically Identical , 2007, CSL.

[11]  H. Barendregt Lambda Calculus kHV its Hovels , 1984 .

[12]  Jue Wang Generating Random Lambda Calculus Terms , 2005 .

[13]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[14]  Wolfdieter Lang ON POLYNOMIALS RELATED TO DERIVATIVES OF THE GENERATING FUNCTION OF CATALAN NUMBERS , 2000 .

[15]  C. Pollard,et al.  Center for the Study of Language and Information , 2022 .

[16]  Philippe Flajolet,et al.  Analytic Combinatorics , 2009 .

[17]  RENÉ DAVID,et al.  ASYMPTOTICALLY ALMOST ALL λ-TERMS ARE STRONGLY NORMALIZING , 2013 .

[18]  Pierre Lescanne,et al.  Counting and generating lambda terms , 2012, Journal of Functional Programming.

[19]  Danièle Gardy,et al.  Lambda-terms of Bounded Unary Height , 2011, ANALCO.