14.09.2014 Views

Sémantique Axiomatique ou Logique de Hoare - Ensiie

Sémantique Axiomatique ou Logique de Hoare - Ensiie

Sémantique Axiomatique ou Logique de Hoare - Ensiie

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.

Come back to the conditional example<br />

To end the proof we can use twice the logical rule.<br />

Let us <strong>de</strong>tail the proof !<br />

From x > 2 ⇒ 1 > 0 (valid formula why ?) and<br />

from {1 > 0}y := 1{y > 0}<br />

we can <strong>de</strong>duce (with the logical rule on preconditions)<br />

{x > 2}y := 1{y > 0} (1)<br />

and also from false ⇒ (−1 > 0) (valid ! why ?) and from<br />

{−1 > 0}y := −1{y > 0}<br />

we can <strong>de</strong>duce (with the logical rule on preconditions)<br />

{false}y := −1{y > 0} (2)<br />

Altogether we obtain an inference tree (or <strong>de</strong>rivation tree) that sums up<br />

the <strong>de</strong>monstration and the way we have reasoned.<br />

(ENSIIE) <strong>Hoare</strong> 24 / 52

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

Saved successfully!

Ooh no, something went wrong!