f λgn if then 1 else multiply n g predecessor n Now consider Y f This is a

F λgn if then 1 else multiply n g predecessor n now

This preview shows page 8 out of 8 pages.

f = ( λgn · if 0 then 1 else ( multiply n ( g ( predecessor n )))) . Now, consider Y f . This is a fixed-point of f - that is, f ( Y f ) = Y f . This means that f ( Y f ) = ( λn · if 0 then 1 else ( multiply n (( Y f ) ( predecessor n )))) = Y f. where the first equality follows by the rule for application, and the second equality follows since Y f is a fixed point of f . In particular, Y f = ( λn · if 0 then 1 else ( multiply n (( Y f ) ( predecessor n )))) . Thus, Y f is the “factorial” function! This trick can be applied to recursively define a λ -term in terms of itself - consider a λ -term f which takes an argument g and calls g wherever the final recursive call occurs. Now, Y f is the recursive definition we originally wanted. How would you implement mutually recursive λ -terms? Explore this. 8
Image of page 8
  • Fall '19
  • Satyadev Nandakumar

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes