Skip to content

Smt unknown handling #6221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions regression/cbmc/z3/Issue5977.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <assert.h>

void main()
{
int i;
__CPROVER_assume(i % 2 == 0);
assert(__CPROVER_exists {
int j;
i == j + j
});
}
9 changes: 9 additions & 0 deletions regression/cbmc/z3/Issue5977.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE smt-backend broken-cprover-smt-backend
Issue5977.c
--z3
^EXIT=(6|10)$
^SIGNAL=0$
^SMT2 solver returned "unknown"$
--
--
This tests that an "unknown" result from the SMT solver is reported.
6 changes: 6 additions & 0 deletions src/solvers/smt2/smt2_dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ decision_proceduret::resultt smt2_dect::read_result(std::istream &in)
res=resultt::D_SATISFIABLE;
else if(parsed.id()=="unsat")
res=resultt::D_UNSATISFIABLE;
else if(parsed.id() == "unknown")
{
messaget log{message_handler};
log.error() << "SMT2 solver returned \"unknown\"" << messaget::eom;
return decision_proceduret::resultt::D_ERROR;
}
else if(
parsed.id().empty() && parsed.get_sub().size() == 1 &&
parsed.get_sub().front().get_sub().size() == 2)
Expand Down