CS 3520 Homework 1 - Due August 28This homework is due August 28, 11:59 PM. Place all of the requested functions in a single file, hw1.txt, and submit it with handin for hw1, e.g.:
handin cs3520 hw1 hw1.txtThe questions below refer to the language of algebra defined in class.
Exercise 1.1, EvaluationsShow a complete sequence of evaluation steps for the following programs:
- f(x) = (x + x) f((4 + 5))
A "complete sequence of evaluation steps" is a sequence of <prog> elements separated by ->, where the final element has a number expression after the definitions. You do not have to identify the rule used in each step, since it's obvious enough for now.
- g(y) = (y - 1) h(z) = (z + g(z)) h(17)
Exercise 1.2, Membership ProofsWhich of the following are programs? For each program, provide a proof tree showing that it is an element of <prog>.
- f(x) = 1 (1 + 1) g(x) = 2 (2 + 2)
Here's an example showing how to type a proof tree in a text file:
- f(x) = 1 g(x) = 1 (1 - 1)
n in <id>
p in <id> n in <id> n in <expr>
p(n) = n in <defn>but your trees will alayws have something in <prog> at the bottom. Your answer doesn't have to be pretty, but it must be readable.
|Last update: Thursday, August 23rd, firstname.lastname@example.org|