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 B. SET OPERATIONS 163<br />

|ly| = |ry|<br />

Pro<strong>of</strong> <strong>of</strong> (i) (⇐)<br />

If member xs a then head zs = a and<br />

⇒<br />

⇒<br />

|ly| = |ry|<br />

{Property (B.1)}<br />

unsplit 〈lz,rz〉 asp = zs<br />

{applying head to both sides (which are finite non-empty lists)}<br />

head (unsplit 〈lz,rz〉 asp ) = head zs<br />

⇒ {member xs a}<br />

head (unsplit 〈lz,rz〉 asp ) = a<br />

⇒ {property <strong>of</strong> head asp }<br />

head asp 〈lz,rz〉 asp = a<br />

⇒ {definition <strong>of</strong> head asp }<br />

⇒<br />

head lz = a<br />

{property <strong>of</strong> member}<br />

member l a<br />

Pro<strong>of</strong> <strong>of</strong> (ii) We can prove this result in the same way as we proved (i) or<br />

we can note that:<br />

¬(member l a) ⇔ ¬(|ly| = |ry|)<br />

Since member xs a then ¬(member l a) ≡ member r a and so (ii) holds.<br />

The tree for (i) (⇒) is<br />

inv (5.3) arith<br />

| | asp<br />

(B.1)<br />

(B.3⇒)<br />

span<br />

asp xs<br />

Since (B.1) is only used once for this pro<strong>of</strong> we do not declare it as a lemma (note<br />

that if we wanted the tree for the entire pro<strong>of</strong> then (B.1) would be declared as<br />

a lemma). Thus<br />

C (B.3 ⇒) = 6 + C (B.1) = 18<br />

H (B.3 ⇒) = 3 + max(2, H (B.1)) = 12

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

Saved successfully!

Ooh no, something went wrong!