Abstract

In this paper we present an average-case analysis of closed lambda terms with restricted values of De Bruijn indices in the model where each occurrence of a variable contributes one to the size. Given a fixed integer k, a lambda term in which all De Bruijn indices are bounded by k has the following shape: It starts with k De Bruijn levels, forming the so-called hat of the term, to which some number of k-colored Motzkin trees are attached. By means of analytic combinatorics, we show that the size of this hat is constant on average and that the average number of De Bruijn levels of k-colored Motzkin trees of size n is asymptotically Θ(√ n). Combining these two facts, we conclude that the maximal non-empty De Bruijn level in a lambda term with restrictions on De Bruijn indices and of size n is, on average, also of order √ n. On this basis, we provide the average unary profile of such lambda terms.

Highlights

  • The last decade has seen an abundance of studies on a quantitative analysis of objects originating from logic and computability theory. These objects provide intriguing asymptotic and stochastic problems related to counting them and an average-case analysis of their parameters. One of these are lambda terms, central objects of lambda calculus, which are investigated in this paper

  • Our results concerning average sizes of these substructures are presented in the two following sections: First, in Section 4, we show that the size of the hat is constant on average and in Sec√tion 5, we prove that the average number of De Bruijn levels in terms of size n is asymptotically of order n

  • We will be interested only in closed terms. This means that every lambda term we investigate is represented by some Motzkin tree enriched with pointers from unary nodes to leaves in such a way that every leaf receives precisely one pointer

Read more

Summary

Introduction

The last decade has seen an abundance of studies on a quantitative analysis of objects originating from logic and computability theory. These objects provide intriguing asymptotic and stochastic problems related to counting them and an average-case analysis of their parameters One of these are lambda terms, central objects of lambda calculus, which are investigated in this paper. In this paper we adapt the definition that is probably the most intuitive for combinatorialists, namely every constructor in a term (i.e., each variable, abstraction, and application) contributes one to the term size This size model gives rise to a challenging and still open problem on the asymptotics of the sequence of the number of closed terms of a given size (for a thorough discussion see Bodini et al (2013)). In a similar vein to the work by Gittenberger and Larcher (2018), we perform an averagecase analysis of lambda terms with bounded De Bruijn indices This class has a significantly weaker restriction compared to restricting the number of De Bruijn levels. In the last section, we recall the results by Gittenberger and Larcher (2018) about the distribution of the total number of leaves in k-indexed terms and provide a short conclusion and outlook

Preliminaries
Structure of lambda terms with bounded De Bruijn indices
Average size of a hat
Average number of De Bruijn levels
Unary profile
Final remarks
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call