15.11.2014 Views

con Isabelle/Isar - Dpto. Ciencias de la Computación e Inteligencia ...

con Isabelle/Isar - Dpto. Ciencias de la Computación e Inteligencia ...

con Isabelle/Isar - Dpto. Ciencias de la Computación e Inteligencia ...

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.

34 Capítulo 3. Distinción <strong>de</strong> casos e inducción<br />

Nota 3.3.13. Demostración automática <strong>de</strong> 3.3.12.<br />

lemma ap<strong>la</strong>na(espejo t) = rev(ap<strong>la</strong>na t)<br />

by (induct t) auto<br />

Nota 3.3.14. Demostración estructurada <strong>de</strong> 3.3.12.<br />

lemma ap<strong>la</strong>na(espejo t) = rev(ap<strong>la</strong>na t) (is ?P t)<br />

proof (induct t)<br />

fix x :: ′ a show ?P (Hoja x) by simp<br />

next<br />

fix t1 :: ′ a arbol assume h1: ?P t1<br />

fix t2 :: ′ a arbol assume h2: ?P t2<br />

fix x :: ′ a<br />

show ?P (Nodo x t1 t2)<br />

proof −<br />

have ap<strong>la</strong>na (espejo (Nodo x t1 t2)) = ap<strong>la</strong>na (Nodo x (espejo t2) (espejo t1)) by simp<br />

also have . . . = (ap<strong>la</strong>na(espejo t2))@[x]@(ap<strong>la</strong>na(espejo t1)) by simp<br />

also have . . . = (rev(ap<strong>la</strong>na t2))@[x]@(rev(ap<strong>la</strong>na t1)) using h1 h2 by simp<br />

also have . . . = rev((ap<strong>la</strong>na t1)@[x]@(ap<strong>la</strong>na t2)) by simp<br />

also have . . . = rev(ap<strong>la</strong>na (Nodo x t1 t2)) by simp<br />

finally show ?thesis .<br />

qed<br />

qed

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

Saved successfully!

Ooh no, something went wrong!