23.11.2013 Views

Obfuscation of Abstract Data-Types - Rowan

Obfuscation of Abstract Data-Types - Rowan

Obfuscation of Abstract Data-Types - Rowan

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

APPENDIX A. LIST ASSERTION 149<br />

The tree for this pro<strong>of</strong> is:<br />

(A.3)<br />

Base<br />

Step<br />

xsp<br />

xsp<br />

cat asp<br />

cat asp<br />

| | asp<br />

arith<br />

IH<br />

(A.4)<br />

xsp<br />

(A.4)<br />

We declare (A.4) as a lemma and so L(A.3) = {(A.4)}. So, for this pro<strong>of</strong>:<br />

xsp<br />

C (A.3) = 11 + C (A.4) = 15<br />

and H (A.3) = 6 + max(1, H (A.4)) = 10<br />

A.3 Block Split for Lists<br />

We want to prove that<br />

|xsp + b(k) ysp| b(k)<br />

= |xsp| b(k)<br />

+ |ysp| b(k)<br />

(A.5)<br />

The definition <strong>of</strong> + b(k) is<br />

〈[ ], [ ]〉 b(k) + b(k) ysp = ysp<br />

〈a : l, [ ]〉 b(k) + b(k) ysp = cons b(k) a (〈l, [ ]〉 b(k) + b(k) ysp)<br />

〈a : l,r〉 b(k) + b(k) ysp = cons b(k) a (〈l + [head r], tail r〉 b(k) + b(k) ysp)<br />

We first need to prove that<br />

|cons b(k) a〈l,r〉 b(k) | b(k)<br />

= 1 + |〈l,r〉 b(k) | b(k)<br />

(A.6)<br />

We have two cases:<br />

Case 1 If |l| < k then<br />

|cons b(k) a 〈l,r〉 b(k) | b(k)<br />

= {definition <strong>of</strong> cons b(k) with |l| < k}<br />

|〈a : l,r〉 bk | b(k)<br />

= {definition <strong>of</strong> | | b(k)<br />

}<br />

|a : l| + |r|<br />

= {definition <strong>of</strong> | |}<br />

1 + |l| + |r|<br />

= {definition <strong>of</strong> | | b(k)<br />

}<br />

1 + |〈l,r〉 b(k) | b(k)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!