Skip to content

Commit 25e8895

Browse files
committed
Status is UNKNOWN when there are true and false reachable traces
1 parent 43c7f71 commit 25e8895

File tree

6 files changed

+44
-13
lines changed

6 files changed

+44
-13
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <assert.h>
2+
3+
int global;
4+
5+
int main(void)
6+
{
7+
int local;
8+
unsigned int nondet;
9+
10+
local = 1;
11+
global = 1;
12+
13+
if(nondet == 0)
14+
{
15+
local = 2;
16+
}
17+
if(nondet == 0)
18+
{
19+
global = 2;
20+
}
21+
22+
assert(local == global);
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.c
3+
--verify --recursive-interprocedural --vsd
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
\[main.assertion.1\] .* local == global: UNKNOWN
7+
--
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.c
3+
--verify --recursive-interprocedural --vsd --loop-unwind-and-branching 10
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
\[main.assertion.1\] .* local == global: UNKNOWN
7+
--

regression/goto-analyzer/context_sensitivity_05/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ main.c
66
^\[f00.assertion.3\] .* assertion 0: SUCCESS \(unreachable\)$
77
^\[f00.assertion.4\] .* assertion x >= 0: SUCCESS$
88
^\[f00.assertion.5\] .* assertion x < 0: FAILURE \(if reachable\)$
9-
^\[f00.assertion.6\] .* assertion x < 2: FAILURE \(if reachable\)$
9+
^\[f00.assertion.6\] .* assertion x < 2: UNKNOWN$
1010
^\[f00.assertion.7\] .* assertion \(x <= 0\) \? 1 : y: UNKNOWN$
1111
^\[f00.assertion.8\] .* assertion \(x <= 1\) \? 0 : y: UNKNOWN$
1212
^\[f00.assertion.9\] .* assertion \(x <= 2\) \? \(\(x <= 3\) \? 1 : 0\) : y: UNKNOWN$

regression/goto-analyzer/local_control_flow_history_01/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ main.c
55
^SIGNAL=0$
66
^\[main.assertion.1\] .* assertion x != 0: SUCCESS$
77
^\[main.assertion.2\] .* assertion x == 1: SUCCESS$
8-
^\[main.assertion.3\] .* assertion x == -1: FAILURE \(if reachable\)$
8+
^\[main.assertion.3\] .* assertion x == -1: UNKNOWN$
99
^\[main.assertion.4\] .* assertion x == 0: SUCCESS$
1010
--
1111
^warning: ignoring

src/goto-analyzer/static_verifier.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,8 @@ static_verifier_resultt::static_verifier_resultt(
215215
// The awkward case, there are traces that (may) reach it and
216216
// some are true, some are false. It is not entirely fair to say
217217
// "FAILURE (if reachable)" because it's a bit more complex than
218-
// that, "FAILURE (if reachable via a particular trace)" would be
219-
// more accurate summary of what we know at this point.
220-
// Given that all results of FAILURE from this analysis are
221-
// caveated with some reachability questions, the following is not
222-
// entirely unreasonable.
223-
status = ai_verifier_statust::FALSE_IF_REACHABLE;
218+
// that, and so the best we can say is UNKNOWN.
219+
status = ai_verifier_statust::UNKNOWN;
224220
}
225221
}
226222
}
@@ -473,11 +469,9 @@ bool static_verifier(
473469
static_verifier_console(results, ns, m);
474470
}
475471

476-
m.status() << m.bold << "Summary: "
477-
<< pass << " pass, "
478-
<< fail << " fail if reachable, "
479-
<< unknown << " unknown"
480-
<< m.reset << messaget::eom;
472+
m.status() << m.bold << "Summary: " << pass << " pass, " << fail
473+
<< " fail if reachable, " << unknown << " unknown" << m.reset
474+
<< messaget::eom;
481475

482476
return false;
483477
}

0 commit comments

Comments
 (0)