1. Consider the following lambda expression (\\lambda~x.~(\\lambda~y.y+x) ((\\la
ID: 3724662 • Letter: 1
Question
1. Consider the following lambda expression (lambda~x.~(lambda~y.y+x) ((lambda~z.z+x)x) 3) ( x . ( y . y + x ) ( ( z . z + x ) x ) 3 ) What is the outcome after the first reduction step that eliminates the right-most lambda?
a. ((lambda~y.y+3) ((lambda~z.z+3)3))
b. (lambda~x.~((lambda~z.z+x)x)+x) 3)
c. (lambda~x.~(x+x+x) 3)
d. ((lambda~y.y+3) (3+3))
e. none of the above
2. Consider the following lambda expression
What is the outcome after the first reduction step that eliminates the left-most lambda?
e. none of the above
Does using a sequence of left-most or a sequence of right-most reductions of lambda expressions always yields the same normal form (if it exists)?
a.
Explanation / Answer
Hi.. Please check below.
1. Consider the following lambda expression (lambda~x.~(lambda~y.y+x) ((lambda~z.z+x)x) 3) ( x . ( y . y + x ) ( ( z . z + x ) x ) 3 ) What is the outcome after the first reduction step that eliminates the right-most lambda?
a. ((lambda~y.y+3) ((lambda~z.z+3)3))
b. (lambda~x.~((lambda~z.z+x)x)+x) 3)
c. (lambda~x.~(x+x+x) 3)
d. ((lambda~y.y+3) (3+3))
e. none of the above
Answer: c
(lambda~x.~(x+x+x) 3)
2. Consider the following lambda expression
(lambda~x.~(lambda~y.y+x) ((lambda~z.z+x)x) 3)( x. ( y.y+x)(( z.z+x)x)3)( x. ( y.y+x)(( z.z+x)x)3)
What is the outcome after the first reduction step that eliminates the left-most lambda?
a. (lambda~x.~((lambda~z.z+x)x)+x) 3)
b. This answer is set as correct
c. ((lambda~y.y+3) (3+3))
d. (lambda~x.~(x+x+x) 3)
e. none of the above
Answer: c
((lambda~y.y+3) (3+3))
Does using a sequence of left-most or a sequence of right-most reductions of lambda expressions always yields the same normal form (if it exists)?
a. True
b. False
Answer: True
Please check above and let me know any issues. Thank you. All the best.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.