{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

004 - '9(At Myzt ant y True True)True Problem 4 Exercise...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: / '9 (At. Myzt). ant). y) True True -)True Problem 4:- Exercise 9.3.2 1 Solution: - The expressions in Polymorphic lambda calculus for integers can be written as follows 0 E AL'Mf: t—>t). szt). x 1 5 At. Mf: t—at). Mxtt). f(x) 2 2 At. m: t—)t). szt). f(f(x)) i’lE AL'Mf: ‘t—)t). Mm). f(n)(x) The type of.the integer is (.t->t)-)(990 A For plus Plus m n 3 AI. Mf: t——)t). szt). f‘m+“)(x) Since, 1 E At. Mfr t—->t). Mint). f(x) 2 2 AL Mf: t——>t). szt). f(f(x)) Plus 1 2 a At. Mf: t—>t). Mm). f“+2)(x) a At. Mfz/t—n). szt). twat) 2 3 For mult Mult m n a At'. Mf: t—)t). szt). (t‘m*“)(x)) Since, 2 E'At. Mf: t——)t). szt). f(f(x)) 3 a At. Mf: t—>t). szt). f(f(f(x))) Mult 2 3 a At. Mf: t—>t). szt). (52‘3’00) a At. Mf: t—>t). szt). 6%)) E 6 x ...
View Full Document

{[ snackBarMessage ]}