I'm unsure about the value of x
in this Hoare triple: { a = 0 } while (x > a) do (x := x − 1) { x = 0 }
.
I have 2 potential ideas for how to prove whether this Hoare triple is valid or not:
- Assuming
x
is 0, the Hoare triple is valid, or - Assuming
x
is any arbitrary value, we break it down into cases and conclude that the Hoare triple is not valid for all values ofx
Are either of the above approaches valid, or is there another approach I should take?