Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions