Asperti and Guerrini (1998, Optimal Implementation of Functional Programming Languages, CUP Press, see especially Chapters 5 and 6) describe some of the more painful lambda terms that arise from Jean-Jacques Levy's theory of families of rudiments and labeled reduction: they give measures of complexity interactions between colliding beta contractions, where a reduction or redex creates work for another.
A relatively simple example of colliding abbreviations:
let D = λx(xx); F= λf.(f (fy)); and I= λx.x in (D (FI))
which has two beta redefinitions and boils down to (yy) : reduces either one of them by regular substitution, and you will create two new redexes, each of which is associated with a part of the structure in the original terminal.
Church iterative numbers are equally good:
let T = λfx. f(f( x)) in λfx.(T (T (T (TT))) fx)
(which reduces the size of the Church to 65,536), which generates a lot of counter alterations.
As a rule, applying higher-order terms to each other, whether they are “typical” or have an obvious meaning, is a good source of hard work that generates a complex intermediate structure.
source share