Lecture 008

We can turn the following into a control graph to check validity.

0 \leq x \leq 3 \to [\text{ while } \ (x > 1) \ x := x - 2](x \leq x \leq 1)

Control Graph of Loop Program

Control Graph of Loop Program

\begin{align*} R &: 0\leq x \leq 3, \lnot(x > 1) \models 0 \leq x \leq 1 \tag{valid}\\ LR &: 0 \leq x \leq 3, x > 1, x' = x - 2, \lnot(x' > 1) \models 0 \leq x' \leq 1 \tag{valid}\\ LL &: 0 \leq x \leq 3, x > 1, x' = x - 2, x' > 1 \models 0 \leq x' \leq 3 \tag{contradiction}\\ \end{align*}

Table of Content