We study the sequences of numbers corresponding to lambda terms of given sizes, where the size is this of lambda terms with de Bruijn indices in a very natural model where all the operators have size 1. For plain lambda terms, the sequence corresponds to two families of binary trees for which we exhibit bijections. We study also the distribution of normal forms, head normal forms and strongly normalizing terms. In particular we show that strongly normalizing terms are of density 0 among plain terms.
We consider combinatorial aspects of λ-terms in the model based on de Bruijn indices where each building constructor is of size one. Surprisingly, the counting sequence for λ-terms corresponds also to two families of binary trees, namely black-white trees and zigzag-free ones. We provide a constructive proof of this fact by exhibiting appropriate bijections. Moreover, we identify the sequence of Motzkin numbers with the counting sequence for neutral λ-terms, giving a bijection which, in consequence, results in an exact-size sampler for the latter based on the exact-size sampler for Motzkin trees of Bodini et alli. Using the powerful theory of analytic combinatorics, we state several results concerning the asymptotic growth rate of λ-terms in neutral, normal, and head normal forms. Finally, we investigate the asymptotic density of λ-terms containing arbitrary fixed subterms showing that, inter alia, strongly normalising or typeable terms are asymptotically negligible in the set of all λ-terms.
Boltzmann samplers and the recursive method are prominent algorithmic frameworks for the approximate-size and exact-size random generation of large combinatorial structures, such as maps, tilings, RNA sequences or various treelike structures. In their multiparametric variants, these samplers allow to control the profile of expected values corresponding to multiple combinatorial parameters. One can control, for instance, the number of leaves, profile of node degrees in trees or the number of certain subpatterns in strings. However, such a flexible control requires an additional nontrivial tuning procedure. In this paper, we propose an efficient polynomial-time, with respect to the number of tuned parameters, tuning algorithm based on convex optimisation techniques. Finally, we illustrate the efficiency of our approach using several applications of rational, algebraic and Pólya structures including polyomino tilings with prescribed tile frequencies, planar trees with a given specific node degree distribution, and weighted partitions.
We present an algorithm which, for given n, generates an unambiguous regular tree grammar defining the set of combinatory logic terms, over the set {S, K} of primitive combinators, requiring exactly n normal-order reduction steps to normalize. As a consequence of Curry and Feys's standardization theorem, our reduction grammars form a complete syntactic characterization of normalizing combinatory logic terms. Using them, we provide a recursive method of constructing ordinary generating functions counting the number of SK-combinators reducing in n normal-order reduction steps. Finally, we investigate the size of generated grammars, giving a primitive recursive upper bound.In this paper we give a complete combinatorial characterization of normalizing combinatory logic terms over the set {S, K} of primitive combinators. We construct a recursive family {R n } n∈N of regular tree grammars defining combinators reducing in exactly n normal-order reductions. By Curry and Feys's standardization theorem [9], normal-order evaluation of normalizing combinators leads to their normal forms, hence our normal-order reduction grammars form a complete partition of normalizing combinators. Our approach is algorithmic in nature and provides fully automated methods for constructing {R n } n∈N as well as their corresponding ordinary generating functions.The paper is organized as follows. In Sections 1.1, and 1.2 we give preliminary definitions and notational conventions. In Section 1.3 we explain our pseudo-code notation and related implementation. In Section 2 we present a high-level overview on the algorithm. In Section 3 we analyse the algorithm giving proofs of soundness 3.2, completeness 3.3 and unambiguity 3.4. In Section 3.5 we give a recursive construction of ordinary generating functions corresponding to {R n } n∈N . In Section 3.6 we discuss some consequences and applications of normal-order reduction grammars. Finally, in Section 3.7 we investigate the size of the generated grammars.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.