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 181<br />
Subcase 1 Suppose that z is even:<br />
member 3 p (mktree3 (x : xs))<br />
= {definition <strong>of</strong> mktree3}<br />
member 3 p (Fork 3 z (mktree3 ys) (mktree3 zs) jt)<br />
= {definition <strong>of</strong> member 3 , with z even}<br />
z == p ∨ member 3 p (mktree3 zs) ∨ member 3 p (mktree3 ys)<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 />
Subcase 2 Suppose that z is odd:<br />
member 3 p (mktree3 (x : xs))<br />
= {definition <strong>of</strong> mktree3}<br />
member 3 p (Fork 3 z kt (mktree3 zs) (mktree3 ys))<br />
= {definition <strong>of</strong> member 3 , with z odd}<br />
z == p ∨ member 3 p (mktree3 zs) ∨ member 3 p (mktree3 ys)<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 />
The basic structure <strong>of</strong> the pro<strong>of</strong> tree is:<br />
(D.12)<br />
Base<br />
even odd<br />
mktree3<br />
member 3<br />
elem