MCS-287 Chapter 3 Homework

  1. Do exercise 3.1.1 on pages 70-71. However, in the the third line of the first expression, replace the + by *.
  2. Do exercise 3.4.3 on page 84. Note that this exercise asks you for two things: a syntactic derivation and an abstract syntax tree.
  3. Do the part of exercise 3.4.5, on page 86, that concerns free?.
  4. 3.x: Rewrite page 96's definition of apply-ff to not assume *fail* (or any other specific value) is outside of the finite function's range. Exercise 3.6.3 on page 98 suggests one way to do this, but there are others at least as good. A test of your code might look like:
         (define ff1 (extend-ff* '(a b c d) '(7 #f *fail* 9) (create-empty-ff)))
         (apply-ff ff1 'b) => #f
         (apply-ff ff1 'c) => *fail*
         (apply-ff ff1 'e) => call to (error "empty-ff: no association for symbol" symbol)