Incorrect Answer.


The program P:
x = y;
if (x < z) { x = z; }

satisfies the Hoare triple y = z P x < y with respect to the partial correctness relation par, if at any state satisfying "y = z", if the program P terminates, then the resulting store satisfies "x < y". After this static analysis, we can easily construct a to the claim of partial correctness above. We saw that any terminating instance of case 2 renders a counterexample. Consider the initial store in which x, y, and z have values 2, 3, and 2, respectively. Verify that this is indeed an terminating instance of case 2.
Back to Question.
Next Question.