The following questions will provide you with a lambda expression and ask you to perform a single beta reduction using both the eager and lazy evaluation. They are intended to help you think through exactly what the order of operations for Lambda Calc is. For a reminder: 1) Lambda Calc is left-associative. This means that if you see something like A B C, read this as (A B) C, and evaluate the application A B before applying c to its result. It also means that if you see something like A B, you should fully reduce д before trying to complete the application, regardless of your reduction strategy. 2) Eager vs. Lazy: Eager says if you see something like A B, (first, you should fully reduce A before trying to complete the application, because of left-associativity), then you should fully reduce B, then perform the application. Lazy says if you see something like AB, (first, you should fully reduce д before trying to complete A the application, because of left-associativity), then perform the application before having fully reduced B. Consider the following lambda calc expression: (a) ((Ly.y) b) Q5.1 1 Point What is the result of doing exactly one beta-reduction using lazy (call by name) evaluation? Original: (a) ((Ly.y) b) (a) (b) It is already in beta normal form, so no step can be taken. (a) ((Ly.y) b) It is not in beta normal form, but no step can be taken. (a) ((Ly.y) b) Save Answer Q5.2 1 Point What is the result of doing exactly one beta-reduction using eager (call by value) evaluation? Original: (a) ((Ly.y) b) (a) (b) It is already in beta normal form, so no step can be taken. (a) ((Ly.y) b) It is not in beta normal form, but no step can be taken. (a) ((Ly.y) b) Save Answer
The following questions will provide you with a lambda expression and ask you to perform a single beta reduction using both the eager and lazy evaluation. They are intended to help you think through exactly what the order of operations for Lambda Calc is. For a reminder: 1) Lambda Calc is left-associative. This means that if you see something like A B C, read this as (A B) C, and evaluate the application A B before applying c to its result. It also means that if you see something like A B, you should fully reduce д before trying to complete the application, regardless of your reduction strategy. 2) Eager vs. Lazy: Eager says if you see something like A B, (first, you should fully reduce A before trying to complete the application, because of left-associativity), then you should fully reduce B, then perform the application. Lazy says if you see something like AB, (first, you should fully reduce д before trying to complete A the application, because of left-associativity), then perform the application before having fully reduced B. Consider the following lambda calc expression: (a) ((Ly.y) b) Q5.1 1 Point What is the result of doing exactly one beta-reduction using lazy (call by name) evaluation? Original: (a) ((Ly.y) b) (a) (b) It is already in beta normal form, so no step can be taken. (a) ((Ly.y) b) It is not in beta normal form, but no step can be taken. (a) ((Ly.y) b) Save Answer Q5.2 1 Point What is the result of doing exactly one beta-reduction using eager (call by value) evaluation? Original: (a) ((Ly.y) b) (a) (b) It is already in beta normal form, so no step can be taken. (a) ((Ly.y) b) It is not in beta normal form, but no step can be taken. (a) ((Ly.y) b) Save Answer
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps