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