diff --git a/Exercises/exercise-7/Lambda.hs b/Exercises/exercise-7/Lambda.hs index 377ce8e..eeb4d32 100644 --- a/Exercises/exercise-7/Lambda.hs +++ b/Exercises/exercise-7/Lambda.hs @@ -40,3 +40,32 @@ pretty x = case x of -- (Lx.((x *z*) (Ly.(x y)))) -- ((Lx.(x *z*)) Ly.(*w* (Lw.(((w y) *z*) *x*)))) -- Lx.((x "y") (Lx.("y" x))) + +-------------------- +-- Exercise 4 +-------------------- +---------- +-- 1.) +---------- +-- (((Lz.z) (Ly.yy)) (Lx.xa)) +-- ((Ly.yy) (Lx.xa)) +-- (Lx.xa (Lx.xa)) +-- (Lx.xa) a +-- (a a) + +---------- +-- 2.) +---------- +-- (Lx.(x x))(Ly.(y x)) z +-- (Ly.(y x)) (Ly.(y x)) z +-- ((Ly.(y x)) x) z +-- (x x) z +-- x x z + +---------- +-- 3.) +---------- +-- ((Lx.(x x))(Ly.y))(Ly.y) +-- ((Ly.y Ly.y))(Ly.y) +-- (Ly.y)(Ly.y) +-- (Ly.y)