Skip to content

Commit 2a9be98

Browse files
martinmartin
authored andcommitted
Check for unreachability before true / false in AI verification
There will be a few cases that were previously marked as either "SUCCESS" or "FAILURE (if reachable)" that will now be marked as "SUCCESS (unreachable)". In the first case this is definitely an improvement as it is more precise and generally people want to know when assertions are safe just because they are unreachable. In the second case it is a bit more debateable but I think that saying "FAILURE (if reachable)" is kind of disengenuous when we know that it isn't reachable.
1 parent 349b710 commit 2a9be98

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

regression/goto-analyzer/intervals_01/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ main.c
66
^\[main.assertion.1\] line 7 assertion i\s*>=\s*10: SUCCESS$
77
^\[main.assertion.2\] line 10 assertion i\s*!=\s*30: SUCCESS$
88
^\[main.assertion.3\] line 13 assertion i\s*!=\s*15: UNKNOWN$
9-
^\[main.assertion.4\] line 16 assertion 0: SUCCESS$
9+
^\[main.assertion.4\] line 16 assertion 0: SUCCESS \(unreachable\)$
1010
^\[main.assertion.5\] line 19 assertion j\s*>=\s*10: SUCCESS$
1111
^\[main.assertion.6\] line 22 assertion i\s*>=\s*j: UNKNOWN$
1212
^\[main.assertion.7\] line 25 assertion i\s*>=\s*11: SUCCESS$

regression/goto-analyzer/intervals_13/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ main.c
66
^\[main.assertion.1\] line 7 assertion i\s*>=\s*10: SUCCESS$
77
^\[main.assertion.2\] line 10 assertion i\s*!=\s*30: SUCCESS$
88
^\[main.assertion.3\] line 13 assertion i\s*!=\s*15: UNKNOWN$
9-
^\[main.assertion.4\] line 16 assertion 0: SUCCESS$
9+
^\[main.assertion.4\] line 16 assertion 0: SUCCESS \(unreachable\)$
1010
^\[main.assertion.5\] line 19 assertion j\s*>=\s*10: SUCCESS$
1111
^\[main.assertion.6\] line 22 assertion i\s*>=\s*j: UNKNOWN$
1212
^\[main.assertion.7\] line 25 assertion i\s*>=\s*11: SUCCESS$

src/goto-analyzer/static_verifier.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,12 @@ bool static_verifier(
307307
results.push_back(static_verifier_resultt());
308308
auto &result = results.back();
309309

310-
if(e.is_true())
310+
if(domain.is_bottom())
311+
{
312+
result.status = static_verifier_resultt::BOTTOM;
313+
++pass;
314+
}
315+
else if(e.is_true())
311316
{
312317
result.status = static_verifier_resultt::TRUE;
313318
++pass;
@@ -317,11 +322,6 @@ bool static_verifier(
317322
result.status = static_verifier_resultt::FALSE;
318323
++fail;
319324
}
320-
else if(domain.is_bottom())
321-
{
322-
result.status = static_verifier_resultt::BOTTOM;
323-
++pass;
324-
}
325325
else
326326
{
327327
result.status = static_verifier_resultt::UNKNOWN;

0 commit comments

Comments
 (0)