Question: Lambda Calculus Consider a function if which takes three arguments: a boolean, an expression to evaluate if the boolean is true, and a second expression
Lambda Calculus
Consider a function if which takes three arguments: a boolean, an expression to evaluate if the boolean is true, and a second expression to evaluate if the boolean is false.
a) Given the lambda expressions for boolean constants and operators, write the lambda expression for this if function.
b) Write the lambda expression for a function ifthenelse which takes five arguments: a boolean, an expression to evaluate if the boolean is true, another boolean, an expression to evaluate if the second boolean is true, and a third expression to evaluate if both booleans are false. You may assume that a correct implementation of function if from (a) is available to you, and use it if you like.
expressions for boolean constants and operators:
true = x.y.(x) false = x.y.(y) not = v.w.x.(v x w) or = v.w.(v v w) and = v.w.(v w v)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
