Skip to content

Commit ca8213f

Browse files
Simplify not_contains constraints before negation
This is necessary for the negation procedure to know the existential bounds and unfold the quantification as a conjunction.
1 parent 92897f7 commit ca8213f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/solvers/refinement/string_refinement.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
13081308

13091309
symbol_exprt univ_var=generator.fresh_univ_index(
13101310
"not_contains_univ_var", nc_axiom.s0().length().type());
1311-
const string_not_contains_constraintt nc_axiom_in_model(
1311+
string_not_contains_constraintt nc_axiom_in_model(
13121312
get(univ_bound_inf),
13131313
get(univ_bound_sup),
13141314
get(prem),
@@ -1317,6 +1317,11 @@ static std::pair<bool, std::vector<exprt>> check_axioms(
13171317
to_array_string_expr(get(s0)),
13181318
to_array_string_expr(get(s1)));
13191319

1320+
// necessary so that expressions such as `1 + (3 - (TRUE ? 0 : 0))` do not
1321+
// appear in bounds
1322+
nc_axiom_in_model =
1323+
to_string_not_contains_constraint(simplify_expr(nc_axiom_in_model, ns));
1324+
13201325
exprt negaxiom =
13211326
negation_of_not_contains_constraint(nc_axiom_in_model, univ_var);
13221327

0 commit comments

Comments
 (0)