3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-19 15:04:42 +00:00

Adopt C++17 structured bindings for map/pair iteration (#8159)

* Initial plan

* Adopt structured bindings for map iteration

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Fix DEBUG_CODE macro issue with structured bindings

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2026-01-11 17:44:12 -08:00 committed by Nikolaj Bjorner
parent f15b0b2a56
commit d68837693c
10 changed files with 20 additions and 23 deletions

View file

@ -198,12 +198,10 @@ bool theory_seq::reduce_ne(unsigned idx) {
tout << "num eqs: " << eqs.size() << "\n";
tout << "num new eqs: " << new_eqs.size() << "\n";
tout << eqs << "\n";
for (auto const& p : new_eqs) tout << p.first << " != " << p.second << "\n";
for (auto const& [fst, snd] : new_eqs) tout << fst << " != " << snd << "\n";
tout << p.first << " != " << p.second << "\n";);
for (auto const& p : eqs) {
expr* nl = p.first;
expr* nr = p.second;
for (auto const& [nl, nr] : eqs) {
if (m_util.is_seq(nl) || m_util.is_re(nl)) {
ls.reset();
rs.reset();

View file

@ -208,11 +208,10 @@ namespace smt {
svector<expr_bool_pair> sorted_exprs;
top_sort_expr(exprs, num_exprs, sorted_exprs);
TRACE(deep_internalize, for (auto & kv : sorted_exprs) tout << "#" << kv.first->get_id() << " " << kv.second << "\n"; );
for (auto & kv : sorted_exprs) {
expr* e = kv.first;
TRACE(deep_internalize, for (auto & [e, b] : sorted_exprs) tout << "#" << e->get_id() << " " << b << "\n"; );
for (auto & [e, b] : sorted_exprs) {
SASSERT(should_internalize_rec(e));
internalize_rec(e, kv.second);
internalize_rec(e, b);
}
}
void context::internalize_deep(expr* n) {