Skip to content

Commit 83618df

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 a4792d0 commit 83618df

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
@@ -158,9 +158,6 @@ void bv_refinementt::get_values(approximationt &a)
158158
/// refine overapproximation
159159
void bv_refinementt::check_SAT(approximationt &a)
160160
{
161-
// get values
162-
get_values(a);
163-
164161
// see if the satisfying assignment is spurious in any way
165162

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

0 commit comments

Comments
 (0)