Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the lecture, we have used the pure lambda-calculus to construct natural numbers and encoded some operations on them. In such encoding, a number n

image text in transcribed

In the lecture, we have used the pure lambda-calculus to construct natural numbers and encoded some operations on them. In such encoding, a number n is encoded as a function lambda f z. f^n z (denoted as n). In this problem, we will define more useful operations on numbers. If you get stuck in any question, try to proceed by assuming the previous function is properly defined. You can reuse any encoding given in lectures and previous questions. a) Define a function ISZERO in lambda-calculus, so that given a number n, it returns TRUE (the encoding of true) if n = 0: FALSE (the encoding of false) if n notequalto 0. b) Define a function PRED in lambda-calculus, so that given a number n, the function returns its predecessor, assuming the predecessor of 0 is 0. c) Use your encoding of PRED to define a subtraction function MINUS, so that MINUS n_1 n_2 returns n_1 - n_2 when n_1 greaterthanorequalto n_2, and 0 otherwise. d) Recall that in lecture note 2, we have defined MULT (the encoding of times) based on PLUS (the encoding of +): MULT Delta Equal To lambda n_1 n_2. (n_1 (PLUS n2_) 0). Try to define MULT on Church numerals without using PLUS (replacing PLUS with an equivalent term under alpha/beta reduction doesn't count as a solution)

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

=+Where do you want to live and work?

Answered: 1 week ago

Question

=+1 Where are the best places in the world to live (and work)?

Answered: 1 week ago

Question

=+Are you interested in working on global teams?

Answered: 1 week ago