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.

And now let’s prove a program !<br />

Program (with specification) :<br />

{ TRUE }<br />

i:=0;<br />

s:=0;<br />

while (i != n) do<br />

i:=i+1;<br />

s:=s+(2*i-1)<br />

{ s=n*n }<br />

(The sum of the first n odd numbers is n 2 )<br />

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

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

Saved successfully!

Ooh no, something went wrong!