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

Create successful ePaper yourself

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

The rule for the loop<br />

I is called the loop invariant.<br />

{I ∧ cond}i{I}<br />

{I}while cond do i{I ∧ ¬cond}<br />

I remains true each time ar<strong>ou</strong>nd the loop (but not necessarily<br />

during execution of the loop body)<br />

If the loop terminates the control condition must be false, so<br />

¬cond appears in the post-condition.<br />

In the premise of the rule, the body of the loop i is only executed if<br />

cond is true, so it appears in the pre-condition.<br />

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

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

Saved successfully!

Ooh no, something went wrong!