CSE502  Functional Programming                      Assignment # 5
Assigned: Oct. 25, 2004     Due, in class: Wednesday, Nov. 3, 2004


REGIONS
-----------------------------------------
1) Exercise 8.2, page 97 of the text
     (area and perimeter for negative arguments)

2) Exercise 8.3, page 98 of the text
     (define an annulus function)

3) Exercise 8.5, page 99 of the text
     (add HalfPlane to the datatype Region)

HIGHER-ORDER and POLYMORPHIC FUNCTIONS
-----------------------------------------
4) Exercise 9.4, page 108 of the text
     (define applyEach a polymorphic function)

5) Exercise 9.5, page 108 of the text
     (define applyAll a polymorphic function)

6) Exercise 9.9, page 111 of the text (Think hard about this one)
     (the function fix)

7) Exercise 9.10, page 113 of the text
     (define ( map (\ x -> (x+1)/2) xs ) as a composition of sections)

PROOFS BY INDUCTION
---------------------------------------------------------------
8) Prove Lemma3: map f x ++ map f y = map f (x ++ y).
   Use the following steps:
  a) List all the definitions and equations you use.
  b) Label each with a name
  c) Set up the structure of the proof
  d) label each step with the label of the definition
     or equation that justifes it.

2) A modified version of Exercise 11.2 (page 140) from the text.
   Choose any property in Table 11.2 (page 139) that we haven't
   used as an example in the lectures and prove it by induction.
   If it requires a helper lemma, prove the helper lemma as well.