Exercises
- Do Ex. 2.7 from [Win].
-
Consider the following relation between arithmetic expressions of IMP:
a R a'
iff
there is an n in N such that for all &sigma in Sigma,
<a, &sigma> -> n iff <a', &sigma> -> n.
Prove that R is not an equivalence relation.
-
Prove that
for all X in Loc and c in Com,
skip ~ while not(X=X) do c.
- Do Ex. 3.5, 3.6, and 3.8(1) from [Win].
- Do Ex. 4.3 and 4.4 from [Win].
- Complete the proof of Prop. 4.7 in [Win] by proving the missing cases.
- Show by structural induction on arithmetic expressions that
the relation A[[a]], as defined in [Win],
is a total function for all arithmetic expressions a.
- Show by structural induction on Boolean expressions that
the relation B[[b]], as defined in [Win],
is a total function for all Boolean expressions b.
- Complete the proof seen in class of Lemma 5.4 by proving the missing cases.
- Use the your completed proof of Lemma 5.4 as a model to prove Lemma 5.3.
- Complete the proof seen in class of Theorem 5.7 by proving the missing cases.
- Do Ex. 5.9(i) from [Win].
- Do Ex. 6.5 and 6.15 from [Win].
- Prove the following partial correctness assertion
{ true }
R := X;
Q := 0;
while Y <= R do (R := R-Y; Q := Q+1)
{ X = (Q x Y) + R /\ R < Y}
Last Updated: Oct 21, 2003