A Hiking Trip Through the Orders of Magnitude: Deriving Efficient Generators for Closed Simply-Typed Lambda Terms and Normal Forms
Paul Tarau

TL;DR
This paper develops efficient logic programming methods to generate and count closed simply-typed lambda terms and normal forms, significantly surpassing previous size limitations and enabling better combinatorial understanding.
Contribution
It introduces novel Horn Clause programs leveraging logic variables and unification to count and generate lambda terms up to size 14, overcoming prior computational barriers.
Findings
Counted closed simply-typed lambda terms up to size 14
Counted closed simply-typed normal forms up to size 14
Achieved four orders of magnitude increase in enumeration capacity
Abstract
Contrary to several other families of lambda terms, no closed formula or generating function is known and none of the sophisticated techniques devised in analytic combinatorics can currently help with counting or generating the set of {\em simply-typed closed lambda terms} of a given size. Moreover, their asymptotic scarcity among the set of closed lambda terms makes counting them via brute force generation and type inference quickly intractable, with previous published work showing counts for them only up to size 10. By taking advantage of the synergy between logic variables, unification with occurs check and efficient backtracking in today's Prolog systems, we climb 4 orders of magnitude above previously known counts by deriving progressively faster Horn Clause programs that generate and/or count the set of closed simply-typed lambda terms of sizes up to 14. A similar count for…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
