Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for question(d) and (e) 2. Given the following lambda expressions and corresponding interpretations: The interpretation of f.!r.c is natural number 0 (zero). The interpretation of

image text in transcribed

image text in transcribed

image text in transcribed

for question(d) and (e)

2. Given the following lambda expressions and corresponding interpretations: The interpretation of f.!r.c is natural number 0 (zero). The interpretation of fr.f (f (... .:))), with n applications off on r, is the natural number n > 0. The interpretation of An.Af...(f ((n f) :)) is a successor function succ for natural numbers, where n is the formal parameter corresponding to the number whose successor is computed. The interpretation of Am.An.((m succ) n) is the addition function add for two natural numbers, where m and n are the formal parameters corresponding to the numbers whose sum is computed. The interpretation of Am.An.((m (add n)) zero) is the multiplication function mul for two natural numbers, where m and n are the formal parameters corresponding to the numbers whose product is computed. The interpretation of S.r.ly.c is propositional constant true. The interpretation of S.r.ly.y is propositional constant false. The interpretation of la.b. Xh.((h a) b) is a pair of entities a and b on which some function h can be applied. We will refer to this function as Pair. The first or second element of the pair ((Pair 21) 22) can be obtained by applying on it the functions Ag.gla.lb.a) (referred to as f st) and gg la.16.b) (referred to as sec), respectively. That is. (fst (Pair 21) 22)) = 21 and (sec ((Pair zi) x2)) = 22. The interpretation of a pair ((Pair m) n) where m and n are natural numbers is a signed num- ber whose valuation is difference between m and n i.e., m n). For instance, ((Pair f...x.x) \f.Arf 2)) represents a signed number -1. Identify the mathematical/logical interpretation for the following expressions. Justify your answer. (In all these problems, apply the functions on some actual arguments and examine the results; does the result correspond to some interpretation that you already know about-basic arithmetic or logical operations. We have done similar problems, when we identified the interpretation of functions repre- senting addition and multiplication of naturals, and negation, conjunction and disjuction of proposi- tions.). (a) .r.(:1 false) true), where x is the formal parameter corresponding to propositional con- stants. (b) In.((n .p.((Pfalse) true)) false), where n is the formal parameter corresponding to natural numbers. (c) Im.An.((m (mul n)) (succ zero)), where m and n are formal parameters corresponding to natural numbers. (d) p.(Pair (sec p)) (fst p)), where p is the formal parameter correspond to some signed number. 0) diri dan cepair (led (1st pu) ke pan ended we pu) (at v), where pe and pe (e) \pi. Ap2.((Pair ((add (f st p)) (sec p2))) ((add (sec p)) (fst p2))), where p1 and p2 are formal paratemeters corresponding to some signed numbers. 2. Given the following lambda expressions and corresponding interpretations: The interpretation of f.!r.c is natural number 0 (zero). The interpretation of fr.f (f (... .:))), with n applications off on r, is the natural number n > 0. The interpretation of An.Af...(f ((n f) :)) is a successor function succ for natural numbers, where n is the formal parameter corresponding to the number whose successor is computed. The interpretation of Am.An.((m succ) n) is the addition function add for two natural numbers, where m and n are the formal parameters corresponding to the numbers whose sum is computed. The interpretation of Am.An.((m (add n)) zero) is the multiplication function mul for two natural numbers, where m and n are the formal parameters corresponding to the numbers whose product is computed. The interpretation of S.r.ly.c is propositional constant true. The interpretation of S.r.ly.y is propositional constant false. The interpretation of la.b. Xh.((h a) b) is a pair of entities a and b on which some function h can be applied. We will refer to this function as Pair. The first or second element of the pair ((Pair 21) 22) can be obtained by applying on it the functions Ag.gla.lb.a) (referred to as f st) and gg la.16.b) (referred to as sec), respectively. That is. (fst (Pair 21) 22)) = 21 and (sec ((Pair zi) x2)) = 22. The interpretation of a pair ((Pair m) n) where m and n are natural numbers is a signed num- ber whose valuation is difference between m and n i.e., m n). For instance, ((Pair f...x.x) \f.Arf 2)) represents a signed number -1. Identify the mathematical/logical interpretation for the following expressions. Justify your answer. (In all these problems, apply the functions on some actual arguments and examine the results; does the result correspond to some interpretation that you already know about-basic arithmetic or logical operations. We have done similar problems, when we identified the interpretation of functions repre- senting addition and multiplication of naturals, and negation, conjunction and disjuction of proposi- tions.). (a) .r.(:1 false) true), where x is the formal parameter corresponding to propositional con- stants. (b) In.((n .p.((Pfalse) true)) false), where n is the formal parameter corresponding to natural numbers. (c) Im.An.((m (mul n)) (succ zero)), where m and n are formal parameters corresponding to natural numbers. (d) p.(Pair (sec p)) (fst p)), where p is the formal parameter correspond to some signed number. 0) diri dan cepair (led (1st pu) ke pan ended we pu) (at v), where pe and pe (e) \pi. Ap2.((Pair ((add (f st p)) (sec p2))) ((add (sec p)) (fst p2))), where p1 and p2 are formal paratemeters corresponding to some signed numbers

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_2

Step: 3

blur-text-image_3

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

25 Vba Macros For Data Analysis In Microsoft Excel

Authors: Klemens Nguyen

1st Edition

B0CNSXYMTC, 979-8868455629

More Books

Students also viewed these Databases questions

Question

identify various mental models about goals, AppendixLO1

Answered: 1 week ago