Let o= [a = (x)x, b = (y)y.a, c = (x)[d = (y)x.b]].Show the reduction of o.c.d.
Exercise 18.2
Let o= [a = (x)(x.a:=(y)(y.a:=(z)[ ]))].Show the reduction of o.a.a.
Exercise 18.3
Develop an encoding of true and false as objects with three methods: not, if, and ifnot. The if and ifnot methods should each return a binary function, relying our syntactic sugar for functions and application.The encoding must obey the following laws:
true.not=false
false.not=true
true.ifv1v2=v1
true.ifnotv1v2=v2
false.ifv1v2=v2
false.ifnotv1v2=v1
Important: Remember that true and false will just be abbreviations, so thay cannot be defined recursively, as in true= [not = (x)false, ...] and false= [not = (x)true, ...].
Exercise 18.4
Optional Challenge: Define versions of true and false that provide only the methods not and if.
Last update: Tuesday, March 28th, 2000mflatt@cs.utah.edu