diff --git a/src/cmd_context/cmd_context.cpp b/src/cmd_context/cmd_context.cpp index 0d36e976b..e8f6ec6fa 100644 --- a/src/cmd_context/cmd_context.cpp +++ b/src/cmd_context/cmd_context.cpp @@ -1346,6 +1346,7 @@ void cmd_context::push() { s.m_macros_stack_lim = m_macros_stack.size(); s.m_aux_pdecls_lim = m_aux_pdecls.size(); s.m_assertions_lim = m_assertions.size(); + pm().push(); unsigned timeout = m_params.m_timeout; m().limit().push(m_params.rlimit()); cancel_eh eh(m().limit()); @@ -1474,6 +1475,7 @@ void cmd_context::pop(unsigned n) { restore_assertions(s.m_assertions_lim); restore_psort_inst(s.m_psort_inst_stack_lim); m_scopes.shrink(new_lvl); + pm().pop(n); while (n--) { m().limit().pop(); } diff --git a/src/cmd_context/pdecl.cpp b/src/cmd_context/pdecl.cpp index a9688f64a..6aab2390b 100644 --- a/src/cmd_context/pdecl.cpp +++ b/src/cmd_context/pdecl.cpp @@ -716,9 +716,24 @@ void pdecl_manager::notify_datatype(sort *r, psort_decl* p, unsigned n, sort* co m.notify_new_dt(r, p); } m_notified.insert(r); + m_notified_trail.push_back(r); } } +void pdecl_manager::push() { + m_notified_lim.push_back(m_notified_trail.size()); +} + +void pdecl_manager::pop(unsigned n) { + SASSERT(n > 0); + unsigned new_sz = m_notified_lim[m_notified_lim.size() - n]; + for (unsigned i = m_notified_trail.size(); i-- > new_sz; ) { + m_notified.erase(m_notified_trail[i]); + } + m_notified_trail.shrink(new_sz); + m_notified_lim.shrink(m_notified_lim.size() - n); +} + bool pdatatypes_decl::instantiate(pdecl_manager & m, sort * const * s) { UNREACHABLE(); return false; diff --git a/src/cmd_context/pdecl.h b/src/cmd_context/pdecl.h index 8f8c94dcc..d65b52ae8 100644 --- a/src/cmd_context/pdecl.h +++ b/src/cmd_context/pdecl.h @@ -288,6 +288,8 @@ class pdecl_manager { obj_map m_sort2info; // for pretty printing sorts obj_hashtable m_notified; + ptr_vector m_notified_trail; + unsigned_vector m_notified_lim; void init_list(); void del_decl_core(pdecl * p); @@ -318,6 +320,8 @@ public: sort * instantiate_datatype(psort_decl* p, symbol const& name, unsigned n, sort * const* s); sort * instantiate(psort * s, unsigned num, sort * const * args); void notify_datatype(sort *r, psort_decl* p, unsigned n, sort* const* s); + void push(); + void pop(unsigned n); void lazy_dec_ref(pdecl * p) { p->dec_ref(); if (p->get_ref_count() == 0) m_to_delete.push_back(p); } template diff --git a/src/smt/seq_regex.cpp b/src/smt/seq_regex.cpp index 6f3da301b..c10a4ded2 100644 --- a/src/smt/seq_regex.cpp +++ b/src/smt/seq_regex.cpp @@ -293,7 +293,7 @@ namespace smt { conds.push_back(lcond); d = el; break; - case l_undef: + case l_undef: #if 1 ctx.mark_as_relevant(lcond); trigger = lcond; @@ -315,6 +315,7 @@ namespace smt { } else { ctx.mark_as_relevant(lcond); + trigger = lcond; return false; } break; diff --git a/src/smt/theory_seq.cpp b/src/smt/theory_seq.cpp index 01f222aa8..1ec005ac8 100644 --- a/src/smt/theory_seq.cpp +++ b/src/smt/theory_seq.cpp @@ -2331,7 +2331,7 @@ theory_var theory_seq::mk_var(enode* n) { } bool theory_seq::can_propagate() { - return m_axioms_head < m_axioms.size() || !m_replay.empty() || m_new_solution || m_unicode.can_propagate(); + return m_axioms_head < m_axioms.size() || !m_replay.empty() || m_new_solution || m_unicode.can_propagate() || m_regex.can_propagate(); } bool theory_seq::canonize(expr* e, dependency*& eqs, expr_ref& result) {