Sémantique Axiomatique ou Logique de Hoare - Ensiie
Sémantique Axiomatique ou Logique de Hoare - Ensiie
Sémantique Axiomatique ou Logique de Hoare - Ensiie
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Suppose we wish to prove :<br />
{x > 2}if x > 2 then y := 1 else y := −1{y > 0}<br />
The proof rule for conditionals suggests we prove :<br />
Simplifying :<br />
{x > 2 ∧ x > 2}y := 1{y > 0}<br />
{x > 2 ∧ ¬(x > 2)}y := −1{y > 0}<br />
{x > 2}y := 1{y > 0} (1)<br />
{false}y := −1{y > 0} (2)<br />
For subgoal (1) the assignment axiom tells us that<br />
{1 > 0}y := 1{y > 0}<br />
For subgoal (2) the assignment axiom tells us that<br />
How to go on ?<br />
−→ we need logical rules<br />
{−1 > 0}y := −1{y > 0}<br />
(ENSIIE) <strong>Hoare</strong> 21 / 52