diff --git a/src/muz/base/dl_context.cpp b/src/muz/base/dl_context.cpp index c418d2327..54cc55bd7 100644 --- a/src/muz/base/dl_context.cpp +++ b/src/muz/base/dl_context.cpp @@ -354,10 +354,9 @@ namespace datalog { void context::restrict_predicates(func_decl_set const& preds) { m_preds.reset(); - func_decl_set::iterator it = preds.begin(), end = preds.end(); - for (; it != end; ++it) { - TRACE("dl", tout << mk_pp(*it, m) << "\n";); - m_preds.insert(*it); + for (func_decl* p : preds) { + TRACE("dl", tout << mk_pp(p, m) << "\n";); + m_preds.insert(p); } } @@ -742,7 +741,7 @@ namespace datalog { } expr_ref context::get_background_assertion() { - return mk_and(m_background); + return mk_and(m_background); } void context::assert_expr(expr* e) { @@ -961,18 +960,17 @@ namespace datalog { rule_ref_vector rv (rm); get_rules_along_trace (rv); expr_ref fml (m); - rule_ref_vector::iterator it = rv.begin (), end = rv.end (); - for (; it != end; it++) { - m_rule_manager.to_formula (**it, fml); + for (auto* r : rv) { + m_rule_manager.to_formula (*r, fml); rules.push_back (fml); // The concatenated names are already stored last-first, so do not need to be reversed here - const symbol& rule_name = (*it)->name(); + const symbol& rule_name = r->name(); names.push_back (rule_name); TRACE ("dl", if (rule_name == symbol::null) { tout << "Encountered unnamed rule: "; - (*it)->display(*this, tout); + r->display(*this, tout); tout << "\n"; }); } @@ -1064,9 +1062,7 @@ namespace datalog { --i; } } - rule_set::iterator it = m_rule_set.begin(), end = m_rule_set.end(); - for (; it != end; ++it) { - rule* r = *it; + for (rule* r : m_rule_set) { rm.to_formula(*r, fml); func_decl* h = r->get_decl(); if (m_rule_set.is_output_predicate(h)) { diff --git a/src/smt/smt_context.cpp b/src/smt/smt_context.cpp index 801d0a3e3..6c120c833 100644 --- a/src/smt/smt_context.cpp +++ b/src/smt/smt_context.cpp @@ -4483,9 +4483,9 @@ namespace smt { return false; } - void context::get_model(model_ref & m) { - if (inconsistent()) - m = nullptr; + void context::get_model(model_ref & mdl) { + if (inconsistent() || !m.inc()) + mdl = nullptr; else { mk_proto_model(); if (!m_model && m_proto_model) { @@ -4497,7 +4497,7 @@ namespace smt { // no op } } - m = m_model.get(); + mdl = m_model.get(); } } diff --git a/src/smt/theory_seq.cpp b/src/smt/theory_seq.cpp index a537f2678..09e3c139c 100644 --- a/src/smt/theory_seq.cpp +++ b/src/smt/theory_seq.cpp @@ -507,8 +507,6 @@ bool theory_seq::fixed_length(expr* len_e, bool is_zero) { m_fixed.contains(e)) { return false; } - - m_trail_stack.push(insert_obj_trail(m_fixed, e)); m_fixed.insert(e); @@ -520,8 +518,7 @@ bool theory_seq::fixed_length(expr* len_e, bool is_zero) { } else if (!is_zero) { unsigned _lo = lo.get_unsigned(); - expr_ref_vector elems(m); - + expr_ref_vector elems(m); for (unsigned j = 0; j < _lo; ++j) { m_sk.decompose(seq, head, tail); elems.push_back(head);