25.06.2013 Views

1 transparent par page - Montefiore

1 transparent par page - Montefiore

1 transparent par page - Montefiore

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Correction de programmes<br />

Un programme est totalement correct s’il vérifie deux propriétés :<br />

◮ Correction <strong>par</strong>tielle : Si le programme atteint un état terminal à<br />

<strong>par</strong>tir d’un état initial vérifiant la précondition, alors cet état<br />

satisfait la postcondition.<br />

◮ Terminaison : Le programme atteint toujours un état terminal à<br />

<strong>par</strong>tir d’un état initial vérifiant la précondition<br />

L’un n’implique pas l’autre. Le programme suivant est seulement<br />

<strong>par</strong>tiellement correct :<br />

1 while x = y<br />

2 y = y + 1<br />

Pre((x, y)) = “x, y ∈ Z”<br />

Post((x, y)) = “x = y”<br />

La correction <strong>par</strong>tielle se montre généralement <strong>par</strong> le principe d’invariant.<br />

La terminaison se montre <strong>par</strong> le principe du bon ordre.<br />

95

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

Saved successfully!

Ooh no, something went wrong!