Static Verifier: Status should be UNKNOWN when there are true and false reachable traces #6286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consider
Running
goto-analyzer wrong.c --verify --recursive-interprocedural --vsd --loop-unwind-and-branching 10
giveswhich is, to put it kindly, an overapproximation.
However running
goto-analyzer wrong.c --verify --recursive-interprocedural --vsd` gives
which is as correct as that configuration can give.
There are four paths through the code. Two are safe (take both ifs, take neither if), but the two take-one-if paths (which are spurious) will definitely fail. In an ideal world they'd be blocked, but we are not yet in that world.
The static verifier does not account for this "might be a red path but that doesn't mean it fails because that path could be an over-approximation" and returned a FAILURE when an UNKNOWN would be more appropriate.
(In the test cases updated in this PR, there are existing comments articulating this same issue.)