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

icon
Related questions
Question
Consider the following lambda calc expression: (Lx.x) ((Ly.yy) b)
Q4.1
1 Point
What is the result of doing exactly one beta-reduction using lazy (call by name) evaluation?
Original: (Lx.x) ((Ly.yy) b)
(Ly-yy) (b)
(Lx.x) (bb)
It is already in beta normal form, so no step can be taken. (Lx.x) ((Ly.yy) b)
It is not in beta normal form, but no step can be taken. (Lx.x) ((Ly.yy) b)
Save Answer
Q4.2
1 Point
What is the result of doing exactly one beta-reduction using eager (call by value) evaluation?
Original: (Lx.x) ((Ly.yy) b)
(Ly.yy) (b)
(Lx.x) (bb)
It is already in beta normal form, so no step can be taken. (Lx.x) ((Ly.yy) b)
It is not in beta normal form, but no step can be taken. (Lx.x) ((Ly.yy) b)
Save Answer
Transcribed Image Text:Consider the following lambda calc expression: (Lx.x) ((Ly.yy) b) Q4.1 1 Point What is the result of doing exactly one beta-reduction using lazy (call by name) evaluation? Original: (Lx.x) ((Ly.yy) b) (Ly-yy) (b) (Lx.x) (bb) It is already in beta normal form, so no step can be taken. (Lx.x) ((Ly.yy) b) It is not in beta normal form, but no step can be taken. (Lx.x) ((Ly.yy) b) Save Answer Q4.2 1 Point What is the result of doing exactly one beta-reduction using eager (call by value) evaluation? Original: (Lx.x) ((Ly.yy) b) (Ly.yy) (b) (Lx.x) (bb) It is already in beta normal form, so no step can be taken. (Lx.x) ((Ly.yy) b) It is not in beta normal form, but no step can be taken. (Lx.x) ((Ly.yy) 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.
Transcribed Image Text: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.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer