Skip to content

Commit ae4deff

Browse files
Debug information for string equations
We number equations to make it easier to debug function manipulating equations, in particular string_identifiers_resolution_from_equations. We also output symbol resolution information for strings
1 parent 954060e commit ae4deff

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/solvers/refinement/string_refinement.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ void output_equations(
531531
const std::vector<equal_exprt> &equations,
532532
const namespacet &ns)
533533
{
534-
for(const auto &eq : equations)
535-
output << " * " << from_expr(ns, "", eq.lhs())
536-
<< " == " << from_expr(ns, "", eq.rhs()) << std::endl;
534+
for(std::size_t i = 0; i < equations.size(); ++i)
535+
output << " [" << i << "] " << from_expr(ns, "", equations[i].lhs())
536+
<< " == " << from_expr(ns, "", equations[i].rhs()) << std::endl;
537537
}
538538

539539
/// Main decision procedure of the solver. Looks for a valuation of variables
@@ -620,6 +620,14 @@ decision_proceduret::resultt string_refinementt::dec_solve()
620620

621621
const union_find_replacet string_id_symbol_resolve =
622622
string_identifiers_resolution_from_equations(equations, ns, debug());
623+
#ifdef DEBUG
624+
debug() << "symbol resolve string:" << eom;
625+
for(const auto &pair : string_id_symbol_resolve.to_vector())
626+
{
627+
debug() << from_expr(ns, "", pair.first) << " --> "
628+
<< from_expr(ns, "", pair.second) << eom;
629+
}
630+
#endif
623631

624632
debug() << "dec_solve: Replacing char pointer symbols" << eom;
625633
replace_symbols_in_equations(symbol_resolve, equations);

0 commit comments

Comments
 (0)