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 151<br />

Step Case Suppose that xsp = 〈x 0 ,x 1 〉 b(k) (and so |xsp| b(k)<br />

= |x 0 | + |x 1 |).<br />

Then we have two subcases depending on whether x 1 is empty.<br />

Subcase 1 Suppose that x 0 = a : l, x 1 = [ ] and 〈l, [ ]〉 b(k) satisfies Equation<br />

(A.5). Then<br />

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

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

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

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

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

= {Equation (A.6)}<br />

1 + |〈l, [ ]〉 b(k) + b(k) ysp| b(k)<br />

= {induction hypothesis}<br />

1 + |〈l, [ ]〉 b(k) | b(k)<br />

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

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

}<br />

1 + |l| + |[ ]| + |ysp| b(k)<br />

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

|a : l| + |[ ]| + |ysp| b(k)<br />

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

}<br />

|〈a : l, [ ]〉 b(k) | b(k)<br />

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

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

|xsp| b(k)<br />

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

Subcase 2 Now suppose that x 0 = a : l, x 1 = r (where r ≠ [ ]) and 〈l +<br />

[head r], tail r〉 b(k) satisfies (A.5). Then<br />

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

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

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

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

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

= {Equation (A.6)}<br />

1 + |〈l + [head r], tail r〉 b(k) + b(k) ysp| b(k)<br />

= {induction hypothesis}<br />

1 + |〈l + [head r], tail r〉 b(k) | b(k)<br />

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

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

}<br />

1 + |l + [head r]| + |tail r| + |ysp| b(k)<br />

= {Equation (A.1)}

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

Saved successfully!

Ooh no, something went wrong!