@@ -25,6 +25,7 @@ using namespace smt;
2525theory_user_propagator::theory_user_propagator (context& ctx):
2626 theory(ctx, ctx.get_manager().mk_family_id(user_propagator::plugin::name())),
2727 m_var2expr(ctx.get_manager()),
28+ m_push_popping(false ),
2829 m_to_add(ctx.get_manager())
2930{}
3031
@@ -38,7 +39,7 @@ void theory_user_propagator::force_push() {
3839 theory::push_scope_eh ();
3940 m_prop_lim.push_back (m_prop.size ());
4041 m_to_add_lim.push_back (m_to_add.size ());
41- m_push_eh (m_user_context);
42+ m_push_eh (m_user_context, this );
4243 }
4344}
4445
@@ -122,15 +123,17 @@ final_check_status theory_user_propagator::final_check_eh() {
122123 if (!(bool )m_final_eh)
123124 return FC_DONE ;
124125 force_push ();
125- unsigned sz = m_prop.size ();
126+ unsigned sz1 = m_prop.size ();
127+ unsigned sz2 = m_expr2var.size ();
126128 try {
127129 m_final_eh (m_user_context, this );
128130 }
129131 catch (...) {
130132 throw default_exception (" Exception thrown in \" final\" -callback" );
131133 }
132134 propagate ();
133- bool done = (sz == m_prop.size ()) && !ctx.inconsistent ();
135+ // check if it became inconsistent or something new was propagated/registered
136+ bool done = !can_propagate () && !ctx.inconsistent ();
134137 return done ? FC_DONE : FC_CONTINUE ;
135138}
136139
@@ -169,11 +172,11 @@ void theory_user_propagator::pop_scope_eh(unsigned num_scopes) {
169172 old_sz = m_to_add_lim.size () - num_scopes;
170173 m_to_add.shrink (m_to_add_lim[old_sz]);
171174 m_to_add_lim.shrink (old_sz);
172- m_pop_eh (m_user_context, num_scopes);
175+ m_pop_eh (m_user_context, this , num_scopes);
173176}
174177
175178bool theory_user_propagator::can_propagate () {
176- return m_qhead < m_prop.size () || ! m_to_add.empty ();
179+ return m_qhead < m_prop.size () || m_to_add_qhead < m_to_add.size ();
177180}
178181
179182void theory_user_propagator::propagate_consequence (prop_info const & prop) {
0 commit comments