All exercises cited by number come from the Gries & Schneider text.
1. Do Exercise 8.1. (Recall that G&S denote function application by a period (or "full stop", if you prefer), as in c.x, when the argument is atomic, but they use the more traditional notation when the function's argument is non-atomic (e.g., a(c.x)).)
2. Do Exercise 8.3.
For problems 3 and 4, let s1 and s2 be the following two states.
To clarify, b[0..4]:(2,-1,0,7,3) means that b is an array with index range 0..4 and that b[0] has value 2, b[1] has value -1, ..., b[4] has value 3.
3. Let E be the expression
(a)
Indicate, for each occurrence of a variable in E,
whether it is bound or free.
(b)
Compute s1.E (i.e., the value of E in state
s1).
(c)
Compute s2.E (i.e., the value of E in state
s2).
Show your work. (That is, show the value of each subexpression!)
4. Let F be the expression
(a)
Indicate, for each occurrence of a variable in F,
whether it is bound or free.
(b) Compute s1.F.
(c) Compute s2.F.
Show your work.
5. Use (8.17) (the second Range Split axiom) to prove this classic theorem regarding sets:
Using the ∈ ("is member of") predicate, we can express |S| (the cardinality of S) by the quantification
Also, we observe the following relationships between set union and disjunction and between set intersection and conjunction:
x ∈ S ∩ T ≡ x ∈ S ∧ x ∈ T