->combinatory
[lambda.git] / exercises / assignment3.mdwn
index 21997ee..9545021 100644 (file)
@@ -24,7 +24,7 @@
 
 8. Recall our proposed encoding for the numbers, called "Church's encoding". As we explained last week, it's similar to our proposed encoding of lists in terms of their folds. In last week's homework, you defined `succ` for numbers so encoded. Can you now define `pred` in the Lambca Calculus? Let `pred 0` result in whatever `err` is bound to. This is challenging. For some time theorists weren't sure it could be done. (Here is [some interesting commentary](http://okmij.org/ftp/Computation/lambda-calc.html#predecessor).) However, in this week's notes we examined one strategy for defining `tail` for our chosen encodings of lists, and given the similarities we explained between lists and numbers, perhaps that will give you some guidance in defining `pred` for numbers.
 
-9. Define `leq` for numbers (that is, ≤) in the Lambda Calculus. Here is the expected behavior, 
+9. Define `leq` for numbers (that is, ≤) in the Lambda Calculus. Here is the expected behavior,
 where `one` abbreviates `succ zero`, and `two` abbreviates `succ (succ zero)`.
 
         leq zero zero ~~> true
@@ -40,7 +40,7 @@ where `one` abbreviates `succ zero`, and `two` abbreviates `succ (succ zero)`.
 
     You'll need to make use of the predecessor function, but it's not essential to understanding this problem that you have successfully implemented it yet. You can treat it as a black box.
 
-## Combinatorial Logic
+## Combinatory Logic
 
 Reduce the following forms, if possible:
 
@@ -53,7 +53,7 @@ Reduce the following forms, if possible:
 
 <!-- -->
 
-16. Give Combinatorial Logic combinators (that is, expressed in terms of `S`, `K`, and `I`) that behave like our boolean functions. You'll need combinators for `true`, `false`, `neg`, `and`, `or`, and `xor`.
+16. Give Combinatory Logic combinators (that is, expressed in terms of `S`, `K`, and `I`) that behave like our boolean functions. You'll need combinators for `true`, `false`, `neg`, `and`, `or`, and `xor`.
 
 Using the mapping specified in this week's notes, translate the following lambda terms into combinatory logic:
 
@@ -75,8 +75,8 @@ Evaluation strategies in Combinatory Logic
 Calculus.  Call it Skomega.
 
 24. Are there evaluation strategies in CL corresponding to leftmost
-reduction and rightmost reduction in the lambda calculus?  
-What counts as a redex in CL? 
+reduction and rightmost reduction in the lambda calculus?
+What counts as a redex in CL?
 
 25. Consider the CL term K I Skomega.  Does leftmost (alternatively,
 rightmost) evaluation give results similar to the behavior of K I