Discrete Mathematics 2 - Homework IV

K. Subramani LCSEE, West Virginia University, Morgantown, WV {ksmani@csee.wvu.edu}

1 Instructions

1. The homework is due on May 10.

2. Attempt as many problems as you can. You will be given partial credit, as per the policy discussed in class.

3. Please show all the steps in your proof, using explicit justifications.

4. The work must be entirely your own. You are expressly prohibited from consulting with colleagues or the internet (with the exception of the material on the course website and the laws of trigonometry.)

2 Problems

1. Consider the theory T_{cons}^{P A} defined on page 102 of [BM07]. Argue that the relation ≺_{c} is well-founded.

2. Argue that the following formula is valid in T_{cons}^{P A}:

(∀u) flat(u) → (|rvs(u)| = |u|).

3. Let T be a binary tree, with root r. The level of a node is the number of edges on the unique path from that node to the root. The height of a tree is the maximum level of any node. Assume that T has n nodes and height h. Prove that n ≤ 2^{h+1} − 1.

4. Implement the Ackermann function discussed in class as a pi program and prove that it always halts.

5. Consider the abs function discussed on Page 173 of [BM07]. Annotate the function, list the basic paths and verification conditions, and argue that the verification conditions are valid. In short, prove the partial correctness of abs.

References

[BM07] Aaron R. Bradley and Zohar Manna. The calculus of computation - decision procedures with applications to verification. Springer, 1^{st} edition, 2007.