Skip to content

Commit fde97f0

Browse files
Replace string symbols only for the dependencies
In the string refinement we replace symbols corresponding to arrays of characters by cannonical element to ensure that symbols resolving to the same expression are associated the same node. We should not replace char array in equations that are passed to supert, since the underlying solver should handle pointers and arrays, and string_refinementt should not interfer with it.
1 parent 30190ec commit fde97f0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/solvers/refinement/string_refinement.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,6 @@ decision_proceduret::resultt string_refinementt::dec_solve()
633633
}
634634
#endif
635635

636-
debug() << "dec_solve: Replacing char pointer symbols" << eom;
637-
replace_symbols_in_equations(symbol_resolve, equations);
638-
639636
debug() << "dec_solve: Replacing string ids in function applications" << eom;
640637
for(equal_exprt &eq : equations)
641638
{
@@ -657,7 +654,11 @@ decision_proceduret::resultt string_refinementt::dec_solve()
657654
std::vector<equal_exprt> local_equations;
658655
for(const equal_exprt &eq : equations)
659656
{
660-
if(!add_node(dependencies, eq, generator.array_pool))
657+
equal_exprt eq_copy = eq;
658+
// Char array symbols are replaced by cannonical element to ensure
659+
// equal arrays are associated to the same nodes in the graph.
660+
symbol_resolve.replace_expr(eq_copy);
661+
if(!add_node(dependencies, eq_copy, generator.array_pool))
661662
local_equations.push_back(eq);
662663
}
663664
equations.clear();

0 commit comments

Comments
 (0)