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: Ly. (Lx.x)b Q6.1 1 Point What is the result of doing exactly one beta-reduction using lazy (call by name) evaluation? Original: Ly. (Lx.x)b (Lx.x) b Ly.b It is already in beta normal form, so no step can be taken. Ly. (Lx.x) b It is not in beta normal form, but no step can be taken. Ly. (Lx.x) b Save Answer Q6.2 1 Point What is the result of doing exactly one beta-reduction using eager (call by value) evaluation? Original: Ly. (Lx.x) b (Lx.x) b Ly.b It is already in beta normal form, so no step can be taken. Ly. (Lx.x) b It is not in beta normal form, but no step can be taken. Ly. (Lx.x) 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: Ly. (Lx.x)b Q6.1 1 Point What is the result of doing exactly one beta-reduction using lazy (call by name) evaluation? Original: Ly. (Lx.x)b (Lx.x) b Ly.b It is already in beta normal form, so no step can be taken. Ly. (Lx.x) b It is not in beta normal form, but no step can be taken. Ly. (Lx.x) b Save Answer Q6.2 1 Point What is the result of doing exactly one beta-reduction using eager (call by value) evaluation? Original: Ly. (Lx.x) b (Lx.x) b Ly.b It is already in beta normal form, so no step can be taken. Ly. (Lx.x) b It is not in beta normal form, but no step can be taken. Ly. (Lx.x) 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