Skip to content

Commit 2c7f23c

Browse files
Concretize arrays in axioms when string solver checks axioms
This makes the string solver more likely to come up with a solution to the formulas that are passed to it.
1 parent e18a6bd commit 2c7f23c

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/solvers/refinement/string_refinement.cpp

+17-13
Original file line numberDiff line numberDiff line change
@@ -1140,21 +1140,25 @@ bool string_refinementt::check_axioms()
11401140

11411141
exprt negaxiom=negation_of_constraint(axiom_in_model);
11421142

1143-
debug() << " - axiom:\n"
1144-
<< " " << from_expr(ns, "", axiom) << eom;
1145-
debug() << " - axiom_in_model:\n"
1146-
<< " " << from_expr(ns, "", axiom_in_model) << eom;
1147-
debug() << " - negated_axiom:\n"
1148-
<< " " << from_expr(ns, "", negaxiom) << eom;
1149-
1150-
substitute_array_access(negaxiom, true);
1151-
1152-
debug() << " - negated_axiom_without_array_access:\n"
1153-
<< " " << from_expr(ns, "", negaxiom) << eom;
1154-
1143+
debug() << " "<< i << ".\n"
1144+
<< " - axiom:\n"
1145+
<< " " << from_expr(ns, "", axiom) << eom;
1146+
debug() << " - axiom_in_model:\n"
1147+
<< " " << from_expr(ns, "", axiom_in_model) << eom;
1148+
debug() << " - negated_axiom:\n"
1149+
<< " " << from_expr(ns, "", negaxiom) << eom;
1150+
1151+
exprt with_concretized_arrays=concretize_arrays_in_expression(
1152+
negaxiom, generator.max_string_length);
1153+
debug() << " - negated_axiom_with_concretized_array_access:\n"
1154+
<< " " << from_expr(ns, "", with_concretized_arrays) << eom;
1155+
1156+
substitute_array_access(with_concretized_arrays);
1157+
debug() << " - negated_axiom_without_array_access:\n"
1158+
<< " " << from_expr(ns, "", with_concretized_arrays) << eom;
11551159
exprt witness;
11561160

1157-
bool is_sat=is_axiom_sat(negaxiom, univ_var, witness);
1161+
bool is_sat=is_axiom_sat(with_concretized_arrays, univ_var, witness);
11581162

11591163
if(is_sat)
11601164
{

0 commit comments

Comments
 (0)