Skip to content

Commit cb39c3d

Browse files
Give all formulas to the solver
Even if they are not equations, they may contain formulas talking about char arrays and other expressions which require special handling by the solver.
1 parent e333b06 commit cb39c3d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/solvers/strings/string_refinement.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,18 +283,10 @@ void string_refinementt::set_to(const exprt &expr, bool value)
283283
{
284284
PRECONDITION(expr.type().id() == ID_bool);
285285
PRECONDITION(equality_propagation);
286-
287-
if(expr.id() == ID_equal && value)
288-
{
289-
const equal_exprt &eq_expr = to_equal_expr(expr);
290-
equations.push_back(eq_expr);
291-
}
286+
if(!value)
287+
equations.push_back(not_exprt{expr});
292288
else
293-
{
294-
INVARIANT(
295-
!has_char_array_subexpr(expr, ns), "char array only appear in equations");
296-
supert::set_to(expr, value);
297-
}
289+
equations.push_back(expr);
298290
}
299291

300292
/// Add association for each char pointer in the equation

0 commit comments

Comments
 (0)