Obfuscation of Abstract Data-Types - Rowan
Obfuscation of Abstract Data-Types - Rowan
Obfuscation of Abstract Data-Types - Rowan
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
APPENDIX D. PROVING A TREE ASSERTION 173<br />
False<br />
= {definition <strong>of</strong> elem}<br />
elem p [ ]<br />
Step Case Now, consider a list xs. For the induction hypothesis, we suppose<br />
that (D.1) is true (∀ts) • |ts| < |xs|. Let (ys, (z : zs)) = splitAt n xs<br />
member p (mktree xs)<br />
= {definition <strong>of</strong> mktree}<br />
member p (Fork (mktree ys) z (mktree zs))<br />
= {definition <strong>of</strong> member}<br />
z == p ∨ member p (mktree ys) ∨ member p (mktree zs)<br />
= {induction hypothesis, using (D.4)}<br />
z == p ∨ elem p ys ∨ elem p zs<br />
= {commutativity and associativity <strong>of</strong> ∨}<br />
elem p ys ∨ (z == p ∨ elem p zs)<br />
= {definition <strong>of</strong> elem}<br />
elem p ys ∨ elem p (z : zs)<br />
= {Equation (D.5)}<br />
elem p (ys + (z : zs))<br />
= {definition <strong>of</strong> xs, Equation (D.3)}<br />
elem p xs<br />
(D.1)<br />
Base<br />
Step<br />
mktree<br />
mktree<br />
member<br />
member<br />
elem<br />
IH (D.4)<br />
∨<br />
elem<br />
(D.5)<br />
xs (D.3)<br />
For this tree it seems that we only use (D.3) once. But in fact, we use it<br />
twice: once in the tree above and once in the pro<strong>of</strong> <strong>of</strong> (D.4). This means that<br />
we must declare (D.3) as a lemma and so we obtain<br />
C (D.1) = 10 + C (D.4) + C (D.5) = 34<br />
H (D.1) = 4 + max(H (D.4), 3 + H (D.5), 4 + H (D.3)) = 13