Borrowed from CSE340 at Arizona State University and CMSC 330 at the University of Maryland
Use parentheses to make the order of evaluation explicit in the following expressions.
-
λx. x z λy. x y
-
(λx. x z) λy. w λw. w y z x
-
λx. x y λx. y x
Identify all the free variables in the following expressions.
-
λx. x z λy. x y
-
(λx. x z) λy. w λw. w y z x
-
λx. x y λx. y x
Reduce the following expressions as much as possible.
-
(λx. x λy. λz. z y x)(y z)
-
(λn. λf. λx. f(n f x))(λx. λf. x x x x f)
-
(λx. x(λx. λy. y)(λy. λx. y))(λx. λy. y)
-
(λx. λy. xy)(λz. (λc. y) z)
-
(λx. λy. x y)(λz. (λc. c y) z)
-
(λx. x q)(λy. y y y)
-
(λc. c(λx. (λx. λy. y))(λx. λy. x))(λq. q)
-
(λz. z)(λy. y y)(λx. x a)
-
(λz. z)(λz. z z)(λz. z y)
-
(λx. λy. x y y)(λa. a) b
-
(λx. λy. x y y)(λy. y) y
-
(λx. x x)(λy. y x) z
-
(λx. (λy. (x y)) y) z
-
((λx. x x)(λy. y))(λy. y)
-
(((λx. λy. (x y))(λy. y)) w)
-
(λx. y)((λy. y y y)(λx. x x x))