X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=assignment1.mdwn;h=313db95633e36c857b5e6afe417a9ffb03c33b9c;hp=5be29cf8c195872eb33673ce806d76cdb4bf8dc6;hb=da04ac1d11456ea14ab5c07a1ba8a16e45ffcd58;hpb=4803493600460bc19487604b9d95b432661e60f1 diff --git a/assignment1.mdwn b/assignment1.mdwn index 5be29cf8..313db956 100644 --- a/assignment1.mdwn +++ b/assignment1.mdwn @@ -24,14 +24,14 @@ In Racket, these can be defined like this: (define true (lambda (t) (lambda (f) t))) (define false (lambda (t) (lambda (f) f))) - -8. Define a "neg" operator that negates "true" and "false". -Expeceted behavior: (((neg true) 10) 20) evaluates to 20, +(8). Define a "neg" operator that negates "true" and "false". +Expected behavior: (((neg true) 10) 20) evaluates to 20, (((neg false) 10) 20) evaluates to 10. -9. Define an "and" operator. +(9). Define an "and" operator. 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 false xor true = true @@ -44,6 +44,7 @@ one of those values, call it a black-or-white-value, we should be able to write: the-black-or-white-value if-black if-white + (where if-black and if-white are anything), and get back one of if-black or if-white, depending on which of the black-or-white values we started with. Give a definition for each of "black" and "white". (Do it in both lambda calculus