next up previous
Next: About this document

Computer Science 6220
Fall 1999
Assignment 5

Due: Oct. 14

  1. An expression of tex2html_wrap_inline17 -calculus is in normal form if there are no tex2html_wrap_inline19 -reductions that can be done on it. Reduce each of the following to normal form.
    1. tex2html_wrap_inline21
    2. tex2html_wrap_inline23
    3. tex2html_wrap_inline25
  2. Let tex2html_wrap_inline27 . Assume that rules are arithmetic are available for reducing arithmetic expressions to numbers. Let sq = tex2html_wrap_inline29 . Evaluate the following. Remember that function application associates to the left, so tex2html_wrap_inline31 .
    1. tex2html_wrap_inline33
    2. tex2html_wrap_inline35
    3. tex2html_wrap_inline37
  3. Suppose that the operations of addition and subtraction and test for zero are available, and that natural numbers are primitive things. (That is, do not be concerned with the representation of numbers as functions.) Write a definition of the multiplication function on natural numbers, using the Y operator. Your definition should have the form mult = ..., where you just give a definition of mult. You may use if-then-else in your definition, as a primitive concept.
  4. You can write the Y operator in Astarte, using recursion. Here it is, but called fix instead of Y.
         Lazylet fix ?f ?x = f (fix f) x.
    Implement your definition of multiplication using fix. Try it to see if it works.




Karl Abrahamson
Thu Oct 7 17:59:32 EDT 1999