Skip to content

Commit 47a9205

Browse files
committed
BV refinement must not touch the formula before requesting the model
A SAT instance that is satisfiable need not remain so when adding clauses. Solvers strictly asserting this (such as Cadical) would refuse getting the model of a satisfiable instance after having added further clauses since the last solve() call. Thus, request the values of all approximations first, and only then add further constraints. Doing so makes cbmc-library/Float-div1-refine pass again, even when using Cadical.
1 parent bc9e79b commit 47a9205

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/solvers/refinement/bv_refinement_loop.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ void bv_refinementt::check_SAT()
123123

124124
arrays_overapproximated();
125125

126+
// get values before modifying the formula
127+
for(approximationt &approximation : this->approximations)
128+
get_values(approximation);
129+
126130
for(approximationt &approximation : this->approximations)
127131
check_SAT(approximation);
128132
}

src/solvers/refinement/refine_arithmetic.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ void bv_refinementt::get_values(approximationt &a)
157157
/// refine overapproximation
158158
void bv_refinementt::check_SAT(approximationt &a)
159159
{
160-
// get values
161-
get_values(a);
162-
163160
// see if the satisfying assignment is spurious in any way
164161

165162
const typet &type = a.expr.type();

0 commit comments

Comments
 (0)