Decoding composed iteration terms

A symbolic evaluator represents a nonnegative integer using a Church numeral, a lambda term that applies its first argument to its second argument that many times. Two stored numerals are


C2=λu.λv.u (u v),C3=λu.λv.u (u (u v)).C_2 = \lambda u.\lambda v.u\,(u\,v), \qquad C_3 = \lambda u.\lambda v.u\,(u\,(u\,v)).


The evaluator also stores these two terms:


R=λm.λn.λf.λx.m (n f) (f x),S=λm.λn.λf.λx.m f (n f (n f x)).\begin{aligned} R &= \lambda m.\lambda n.\lambda f.\lambda x. m\,(n\,f)\,(f\,x),\\ S &= \lambda m.\lambda n.\lambda f.\lambda x. m\,f\,(n\,f\,(n\,f\,x)). \end{aligned}


All capitalized names are abbreviations for their displayed lambda terms. Application associates to the left. For this question, fkxf^k x means kk nested applications of ff to xx, rather than numerical exponentiation.


With ff and xx treated as distinct free variables, reduce R C2 C3 f xR\,C_2\,C_3\,f\,x and S C2 C3 f xS\,C_2\,C_3\,f\,x to forms fkxf^k x. Enter each iteration count kk as an exact integer; the counts are dimensionless. Count applications of ff, not beta-reduction steps.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Lambda Calculus Questions: