English

Towards the average-case analysis of substitution resolution in $\lambda$-calculus

Logic in Computer Science 2018-12-12 v1 Combinatorics

Abstract

Substitution resolution supports the computational character of β\beta-reduction, complementing its execution with a capture-avoiding exchange of terms for bound variables. Alas, the meta-level definition of substitution, masking a non-trivial computation, turns β\beta-reduction into an atomic rewriting rule, despite its varying operational complexity. In the current paper we propose a somewhat indirect average-case analysis of substitution resolution in the classic λ\lambda-calculus, based on the quantitative analysis of substitution in λυ\lambda\upsilon, an extension of λ\lambda-calculus internalising the υ\upsilon-calculus of explicit substitutions. Within this framework, we show that for any fixed n0n \geq 0, the probability that a uniformly random, conditioned on size, λυ\lambda\upsilon-term υ\upsilon-normalises in nn normal-order (i.e. leftmost-outermost) reduction steps tends to a computable limit as the term size tends to infinity. For that purpose, we establish an effective hierarchy (Gn)n\left(\mathscr{G}_n\right)_n of regular tree grammars partitioning υ\upsilon-normalisable terms into classes of terms normalising in nn normal-order rewriting steps. The main technical ingredient in our construction is an inductive approach to the construction of Gn+1\mathscr{G}_{n+1} out of Gn\mathscr{G}_n based, in turn, on the algorithmic construction of finite intersection partitions, inspired by Robinson's unification algorithm. Finally, we briefly discuss applications of our approach to other term rewriting systems, focusing on two closely related formalisms, i.e. the full λυ\lambda\upsilon-calculus and combinatory logic.

Keywords

Cite

@article{arxiv.1812.04452,
  title  = {Towards the average-case analysis of substitution resolution in $\lambda$-calculus},
  author = {Maciej Bendkowski},
  journal= {arXiv preprint arXiv:1812.04452},
  year   = {2018}
}
R2 v1 2026-06-23T06:39:01.903Z