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.

Source : oai:HAL:hal-02313735v3

Volume: vol. 22 no. 3, Computational Logic and Applications (CLA'19)

Section: Special issues

Published on: February 12, 2021

Submitted on: October 14, 2019

Keywords: lambda terms with restrictions,singularity analysis,profile of lambda terms,[MATH]Mathematics [math],[MATH.MATH-CO]Mathematics [math]/Combinatorics [math.CO]

This page has been seen 22 times.

This article's PDF has been downloaded 56 times.