Question

(a): (λx.x) (b): (λx.x) y (c): (λxy.xz) y (d):(λx.x) (λy.yx) For each of the expressions, show...

(a): (λx.x)
(b): (λx.x) y
(c): (λxy.xz) y

(d):(λx.x) (λy.yx)

For each of the expressions, show what it reduces to. (If an expression doesn't reduce any further, just write the expression as-is as your answer.)

Hint: You are allowed to, and probably should, use an interpreter such as the one at http://jacksongl.github.io/files/demo/lambda/

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

Here, we can see there is no input. so, it will be the same and it will not be reduced.

The output from your given interpreter:

b)  

From our expression: param = x

output = x

input = y

put y in output function and you will get y as output. i.e. x:= x where x=y

so, reduce form is y.

you can rename unbound variable something say x0.

so reduce form will be x0.

Output:

C)

(λxy.xz) y

param or argument to function = xy

output function body or expression = xz, just rename it to say x0 or you can leave. but, renaming it makes you easier to handle multiple variables.

input = y

so the new expression is like: (λxy.x0) y

now put input in expression, i.e. x0(xy:=y)

so, it will reduce to x0

Output:

D)

(λx.x) (λy.yx)

here, we are passing a function output as input to another function.

the parameter to left function = x

output expression to left function is x

and the input is a function i.e. (λy.yx)

Now, look in the left function((λx.x)). the parameter is x and output is also x. i.e. it just returns the parameter. If we have some function output as input it will return that output. so, basically, the output of the left function ((λx.x)) is the same as the output of the input function (i.e. (λy.yx)).

so reduced value will be (λy.yx) and you can rename unbound parameter yx by x0.

so the new form will be  (λy.x0)

Output:

Add a comment
Know the answer?
Add Answer to:
(a): (λx.x) (b): (λx.x) y (c): (λxy.xz) y (d):(λx.x) (λy.yx) For each of the expressions, show...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT