Question: Exercise 4 . This is a classic exercise but very important. We will demonstrate how to encode certain notions in Simply Typed Lambda Calculus. Fix

Exercise 4. This is a classic exercise but very important. We will demonstrate how to
encode certain notions in Simply Typed Lambda Calculus. Fix a type a and let T be nat
=(aa)aa. The idea here is to encode each natural number n into a term
whose type is nat. For example, the natural number 0 is represented by fa-axa.x;
the natural number 1 by hat(f)a-axa.fx;1 and the natural number 2 by fa-axaf(fx).
(i) For each f,xinV, consider the following recursive definition:
fnx={x,sen=0f(fn-1x),sen>0
for each ninN. To start, show that fm(fnx)=fm+nx for each m,ninN.
(ii) For each ninN, we will write ?n7 to denote the previously typed term fa-xa*fnx.
Show that n is legal for each ninN.
(iii) Consider the following previously typed term suc =anatfa-axa.f(afx).
Show that sum is legal and that suc[n]=[n+1] for each ninN.
(iv) Consider the following previously typed term:
sum =anatbnatfa-axa*af(bfx).
Show that sum is legal and that ???[m][n]=[m+n] for each m,ninN.
 Exercise 4. This is a classic exercise but very important. We

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!