Skip to content

Commit c0b731c

Browse files
committed
Correctly handle SMT solver errors
`check_sat` in scratch_programt was treating UNSAT and ERROR as the same. This was causing SMT solver errors to be silently ignored, and be treated as UNSAT results instead.
1 parent efc313d commit c0b731c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/goto-instrument/accelerate/scratch_program.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,18 @@ bool scratch_programt::check_sat(bool do_slice, guard_managert &guard_manager)
7171
std::cout << "Finished symex, invoking decision procedure.\n";
7272
#endif
7373

74-
return ((*checker)() == decision_proceduret::resultt::D_SATISFIABLE);
74+
switch((*checker)())
75+
{
76+
case decision_proceduret::resultt::D_ERROR:
77+
throw "error running the SMT solver";
78+
case decision_proceduret::resultt::D_SATISFIABLE:
79+
return true;
80+
case decision_proceduret::resultt::D_UNSATISFIABLE:
81+
return false;
82+
UNREACHABLE;
83+
}
84+
85+
UNREACHABLE;
7586
}
7687

7788
exprt scratch_programt::eval(const exprt &e)

0 commit comments

Comments
 (0)