projects
/
lambda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[lambda.git]
/
assignment1.mdwn
diff --git
a/assignment1.mdwn
b/assignment1.mdwn
index
dd1fa12
..
93136f2
100644
(file)
--- a/
assignment1.mdwn
+++ b/
assignment1.mdwn
@@
-1,4
+1,5
@@
-**Reduction**
+Reduction
+---------
Find "normal forms" for the following (that is, reduce them as far as it's possible to reduce
them):
Find "normal forms" for the following (that is, reduce them as far as it's possible to reduce
them):
@@
-12,7
+13,8
@@
them):
7. (\x (x x x)) (\x (x x x))
7. (\x (x x x)) (\x (x x x))
-**Booleans**
+Booleans
+--------
Recall our definitions of true and false.
Recall our definitions of true and false.
@@
-24,7
+26,7
@@
In Racket, these can be defined like this:
(define true (lambda (t) (lambda (f) t)))
(define false (lambda (t) (lambda (f) f)))
(define true (lambda (t) (lambda (f) t)))
(define false (lambda (t) (lambda (f) f)))
-
* 8.
Define a "neg" operator that negates "true" and "false".
+
8. [8]
Define a "neg" operator that negates "true" and "false".
Expected behavior:
(((neg true) 10) 20)
Expected behavior:
(((neg true) 10) 20)
@@
-35,9
+37,9
@@
evaluates to 20, and
evaluates to 10.
evaluates to 10.
-
* 9.
Define an "and" operator.
+
9. [9]
Define an "and" operator.
-
* 10.
Define an "xor" operator. (If you haven't seen this term before, here's a truth table:
+
10. [10]
Define an "xor" operator. (If you haven't seen this term before, here's a truth table:
true xor true = false
true xor false = true
true xor true = false
true xor false = true