However, I was able to prove this function to be correct (as well as the examples that call this function) without requiring the separation between pointer arguments, just with a slightly different postcondition:
I'm just showing this in case you prefer this solution, or in case the exercise actually consisted in identifying the separation between pointer arguments (which as you can see, it's not really required).
This contract can indeed be validated, but note that it does not prevent the function to modify *a and *b. Thus, I should add a sentence about the fact that *p and *q must remain unchanged.
In exercise 3.2.5.3 (addition of pointed values) part 2, this is the solution provided:
However, I was able to prove this function to be correct (as well as the examples that call this function) without requiring the separation between pointer arguments, just with a slightly different postcondition:
I'm just showing this in case you prefer this solution, or in case the exercise actually consisted in identifying the separation between pointer arguments (which as you can see, it's not really required).