Problem Set 4
Home Up Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Problem Set 6 Problem Set 7 Problem Set 8 Problem Set 9 Problem Set 10 Final Project

 

Due 5PM Wednesday, October 6.

Chapter 10:

Exercises 10.1 and 10.2  in SOE.
(Note: nothing needs to be turned in for this part of the assignment.)

(Warning: for some reason these examples do not work properly -- the Hugs window mysteriously disappears when draw is invoked!!  I am trying to fix the code (it used to work...) but until then, please work on the problems from Chapter 11.)

(Update: by Wednesday 10/6 afternoon there will be a new version of Hugs installed, in the folder "HugsNov02" on the Zoo Windows machines.  This is an older version of Hugs that does not exhibit the bug mentioned above, so all of the SOE code should work.)

Chapter 11:

  1. Exercise 11.1 in SOE.
     
  2. Exercise 11.2 in SOE, but only for the 2nd fold law in Table 11.1,
    and the third take/drop law in Table 11.2.
     
  3. Exercise 11.3 in SOE.
     
  4. Exercise 11.5 in SOE.
     
  5. Consider the example involving the tree data type in the lecture notes
    for Chapter 11.
    1. Prove the lemma.
    2. Can you think of a useful generalization of this lemma, involving
      just foldl or foldr and (++), that would be suitable to add
      to Table 11.1 or 11.2?  Prove that it is correct.
       
  6. Prove that the evaluate function defined recursively in Chapter 7 is equivalent to the evaluate function defined in Problem 2 from Problem Set 3.

 

Solutions.