The Turing combinator

Curry’s combinator solves the problem of recursion, but not flawlessly. One of its shortcomings we have already noted: it merely declares recursion. The identity YF\mathrm{Y}\,F=βF(YF){} =_\beta F\,(\mathrm{Y}\,F) rests on β-equality, and there is no direct reduction from YF\mathrm{Y}\,F to F(YF)F\,(\mathrm{Y}\,F) — to close the loop one has to step “backward” (a conversion). Let us try to fix this: to build another fixed-point combinator that unfolds recursion by a genuine forward β-reduction rather than proclaiming it as an equality.

We obtain this reduction — ΘF\Theta\,FβF(ΘF){} \twoheadrightarrow_\beta F\,(\Theta\,F) — by “pushing” the function itself, as an argument, inside the self-application: take GG=λxy.y(xxy){} = \lambda x\,y.\,y\,(x\,x\,y) and set Θ\Theta=GG{} = G\,G. Then in two β-steps:

ΘF\displaystyle \Theta\,F =(GG)F  \displaystyle {} = (G\,G)\,F \;β  (λy.y(GGy))F  \displaystyle {} \to_\beta\; (\lambda y.\,y\,(G\,G\,y))\,F \;β  F(GGF)\displaystyle {} \to_\beta\; F\,(G\,G\,F)=F(ΘF).\displaystyle {} = F\,(\Theta\,F).

The function (in the role of yy) is not lost here; on each turn it is applied anew to the recreated ΘF\Theta\,F=GGF{} = G\,G\,F, and that is why the equality turns into an honest reduction. Unfolding GG, we get the final form of the Turing combinator:

Θ\displaystyle \Theta =(λxy.y(xxy))(λxy.y(xxy)),\displaystyle {} = (\lambda x\,y.\,y\,(x\,x\,y))\,(\lambda x\,y.\,y\,(x\,x\,y)),ΘF\displaystyle \Theta\,FβF(ΘF)\displaystyle {} \twoheadrightarrow_\beta F\,(\Theta\,F)
(1.26)

Let us compute the same factorial as in the chapter on Curry’s combinator (the same template FF, the same numeral 3\overline{3}): now every turn of the recursion is a genuine β-reduction, not a β-equality:

fac  3\displaystyle \mathbf{fac}\;\overline{3} =ΘF  3\displaystyle {} = \Theta\,F\;\overline{3}βF(ΘF)  3\displaystyle {} \twoheadrightarrow_\beta F\,(\Theta\,F)\;\overline{3}βmul  3  (ΘF  2)\displaystyle {} \twoheadrightarrow_\beta \mathbf{mul}\;\overline{3}\;(\Theta\,F\;\overline{2})βmul  3  (mul  2  (mul  1  (ΘF  0)))\displaystyle {} \twoheadrightarrow_\beta \mathbf{mul}\;\overline{3}\;(\mathbf{mul}\;\overline{2}\;(\mathbf{mul}\;\overline{1}\;(\Theta\,F\;\overline{0})))βmul  3  (mul  2  (mul  1  1))\displaystyle {} \twoheadrightarrow_\beta \mathbf{mul}\;\overline{3}\;(\mathbf{mul}\;\overline{2}\;(\mathbf{mul}\;\overline{1}\;\overline{1}))=6\displaystyle {} = \overline{6}

Both give 6\overline{6}; the only difference is the status of the unfolding step — an equality for Curry versus a reduction for Turing.

In practice the Turing combinator is almost never used — its role is theoretical: it shows that recursion is reachable by an honest reduction, without a step “backward”, and in this capacity it is the standard companion of Y in textbooks.

But both Curry and Turing are designed for normal order (call-by-name). Under strict, eager order (call-by-value) both diverge: the argument FF — that is, YF\mathrm{Y}\,F or ΘF\Theta\,F itself — is evaluated in advance and unfolds forever, never reaching any useful work. This problem is solved by the next combinator — Z.