Skip to content

Commit 665abf7

Browse files
authored
Merge pull request #6221 from TGWDB/SMT-unknown-handling
Smt unknown handling
2 parents 00c32e3 + 141f3ce commit 665abf7

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

regression/cbmc/z3/Issue5977.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <assert.h>
2+
3+
void main()
4+
{
5+
int i;
6+
__CPROVER_assume(i % 2 == 0);
7+
assert(__CPROVER_exists {
8+
int j;
9+
i == j + j
10+
});
11+
}

regression/cbmc/z3/Issue5977.desc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE smt-backend broken-cprover-smt-backend
2+
Issue5977.c
3+
--z3
4+
^EXIT=(6|10)$
5+
^SIGNAL=0$
6+
^SMT2 solver returned "unknown"$
7+
--
8+
--
9+
This tests that an "unknown" result from the SMT solver is reported.

src/solvers/smt2/smt2_dec.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ decision_proceduret::resultt smt2_dect::read_result(std::istream &in)
154154
res=resultt::D_SATISFIABLE;
155155
else if(parsed.id()=="unsat")
156156
res=resultt::D_UNSATISFIABLE;
157+
else if(parsed.id() == "unknown")
158+
{
159+
messaget log{message_handler};
160+
log.error() << "SMT2 solver returned \"unknown\"" << messaget::eom;
161+
return decision_proceduret::resultt::D_ERROR;
162+
}
157163
else if(
158164
parsed.id().empty() && parsed.get_sub().size() == 1 &&
159165
parsed.get_sub().front().get_sub().size() == 2)

0 commit comments

Comments
 (0)