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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix A<br />

List assertion<br />

We want to prove that, for all finite lists xs and ys,<br />

|xs + ys| = |xs| + |ys|<br />

(A.1)<br />

which is one <strong>of</strong> our assertions for the list data-type (Figure 4.1). We prove this<br />

assertion for the different concatenation operations defined in Chapter 4.<br />

A.1 Unobfuscated version<br />

For standard lists, we define + as follows:<br />

[ ] + ys = ys<br />

(x : xs) + ys = x : (xs + ys)<br />

We prove Equation (A.1) by structural induction on xs.<br />

Base Case Suppose that xs = [ ]. Then<br />

|xs + ys|<br />

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

|[ ] + ys|<br />

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

|ys|<br />

= {arithmetic}<br />

0 + |ys|<br />

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

|[ ]| + |ys|<br />

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

|xs| + |ys|<br />

Step Case Suppose that xs = t : ts and that ts satisfies Equation (A.1).<br />

Then<br />

|xs + ys|<br />

144

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

Saved successfully!

Ooh no, something went wrong!