Chapter 16 — When verification fails¶
A failed proof means the verifier found inputs or paths that break your stated properties—treat that as actionable feedback on the code, the contracts, or both.
Understanding the report¶
Diagnostics name the obligation that failed and often include a counterexample: concrete values for variables that violate the claim. Use those values to see which assumption or branch is wrong.
Adjusting contracts¶
Situation |
Response |
|---|---|
Precondition too weak |
Strengthen |
Postcondition too strong |
Weaken |
Loop invariant too weak |
Add facts to |
Spec vs machine integers disagree |
Use |
Recursive specification |
Use |
Pointer aliasing |
Prove distinct pointers or declare |
Overflow / divide-by-zero ( |
Add the precondition the counterexample points to (see Chapter 18 — Undefined behavior) |
Further reference: Language reference.