6 research outputs found
On the enumeration of closures and environments with an application to random generation
Environments and closures are two of the main ingredients of evaluation in
lambda-calculus. A closure is a pair consisting of a lambda-term and an
environment, whereas an environment is a list of lambda-terms assigned to free
variables. In this paper we investigate some dynamic aspects of evaluation in
lambda-calculus considering the quantitative, combinatorial properties of
environments and closures. Focusing on two classes of environments and
closures, namely the so-called plain and closed ones, we consider the problem
of their asymptotic counting and effective random generation. We provide an
asymptotic approximation of the number of both plain environments and closures
of size . Using the associated generating functions, we construct effective
samplers for both classes of combinatorial structures. Finally, we discuss the
related problem of asymptotic counting and random generation of closed
environemnts and closures
Combinatorics of explicit substitutions
is an extension of the -calculus which
internalises the calculus of substitutions. In the current paper, we
investigate the combinatorial properties of focusing on the
quantitative aspects of substitution resolution. We exhibit an unexpected
correspondence between the counting sequence for -terms and
famous Catalan numbers. As a by-product, we establish effective sampling
schemes for random -terms. We show that typical
-terms represent, in a strong sense, non-strict computations
in the classic -calculus. Moreover, typically almost all substitutions
are in fact suspended, i.e. unevaluated, under closures. Consequently, we argue
that is an intrinsically non-strict calculus of explicit
substitutions. Finally, we investigate the distribution of various redexes
governing the substitution resolution in and investigate the
quantitative contribution of various substitution primitives
Almost Every Simply Typed Lambda-Term Has a Long Beta-Reduction Sequence
It is well known that the length of a beta-reduction sequence of a simply
typed lambda-term of order k can be huge; it is as large as k-fold exponential
in the size of the lambda-term in the worst case. We consider the following
relevant question about quantitative properties, instead of the worst case: how
many simply typed lambda-terms have very long reduction sequences? We provide a
partial answer to this question, by showing that asymptotically almost every
simply typed lambda-term of order k has a reduction sequence as long as
(k-1)-fold exponential in the term size, under the assumption that the arity of
functions and the number of variables that may occur in every subterm are
bounded above by a constant. To prove it, we have extended the infinite monkey
theorem for strings to a parametrized one for regular tree languages, which may
be of independent interest. The work has been motivated by quantitative
analysis of the complexity of higher-order model checking