Incorrect Answer.


if (x > y) {
	z = x;
} else {
	z = y + 1;
}
z = z - 1;

For the relation parT P z = max(x,y) to hold, it has to be the case that at any state satisfying T ("true"), if the program in question terminates, then the resulting store satisfies "z = max(x,y)". This is not the case for the P above. For consider any terminating run of the program: This case analysis reveals that, after program termination, the value stored in z equals the larger of the values stored in x and y in case that y is larger than x. Otherwise, the program is "off" by one as it returns the value of x - 1 and not the value of x, as desired.
Back to Question.
Next Question.


Back to Question.
Next Question.

If x > y then z ends up as x - 1.
Back to Question.
Next Question.