notes for week 4
[lambda.git] / assignment3.mdwn
index f89f501..f93afd6 100644 (file)
@@ -4,7 +4,7 @@ Assignment 3
 Once again, the lambda evaluator will make working through this
 assignment much faster and more secure.
 
-*Writing recursive functions on version 1 style lists*
+##Writing recursive functions on version 1 style lists##
 
 Recall that version 1 style lists are constructed like this:
 
@@ -46,7 +46,7 @@ eq 3 3
 
 Then `length mylist` evaluates to 3.
 
-1. What does `head (tail (tail mylist))` evaluate to?
+1. Warm-up: What does `head (tail (tail mylist))` evaluate to?
 
 2. Using the `length` function as a model, and using the predecessor
 function, write a function that computes factorials.  (Recall that n!,
@@ -62,13 +62,20 @@ intensive).
 same length.  That is,
 
      listLenEq mylist (makeList meh (makeList meh (makeList meh nil))) ~~> true
+
      listLenEq mylist (makeList meh (makeList meh nil))) ~~> false
 
+4. Now write the same function, but don't use the length function (hint: use `leq` as a model).
+
+##Trees##
+
+Since we'll be working with linguistic objects, let's approximate
+trees as follows: a tree is a version 1 list
+a Church number is a tree, and 
+if A and B are trees, then (make-pair A B) is a tree.
+
 
-4. Now write the same function (true iff two lists have the same
-length) but don't use the length function (hint: use `leq` as a model).
 
-   That is, (makeList 1 (makeList 2 (makeList 3 nil))) 
 
 [The following should be correct, but won't run in my browser: