3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 04:03:39 +00:00

clear tactic user propagate state on solver destructor

This commit is contained in:
Nikolaj Bjorner 2021-12-07 03:11:54 -08:00
parent fdc253afdd
commit 658a334ecf
4 changed files with 23 additions and 5 deletions

View file

@ -413,16 +413,21 @@ public:
} }
} }
void user_propagate_init( void user_propagate_clear() override {
void* ctx, m_user_ctx = nullptr;
user_propagator::push_eh_t& push_eh,
user_propagator::pop_eh_t& pop_eh,
user_propagator::fresh_eh_t& fresh_eh) override {
m_vars.reset(); m_vars.reset();
m_fixed_eh = nullptr; m_fixed_eh = nullptr;
m_final_eh = nullptr; m_final_eh = nullptr;
m_eq_eh = nullptr; m_eq_eh = nullptr;
m_diseq_eh = nullptr; m_diseq_eh = nullptr;
}
void user_propagate_init(
void* ctx,
user_propagator::push_eh_t& push_eh,
user_propagator::pop_eh_t& pop_eh,
user_propagator::fresh_eh_t& fresh_eh) override {
user_propagate_clear();
m_user_ctx = ctx; m_user_ctx = ctx;
m_push_eh = push_eh; m_push_eh = push_eh;
m_pop_eh = pop_eh; m_pop_eh = pop_eh;

View file

@ -112,6 +112,11 @@ public:
return m_tactic->user_propagate_register(e); return m_tactic->user_propagate_register(e);
} }
void user_propagate_clear() override {
if (m_tactic)
m_tactic->user_propagate_clear();
}
expr_ref_vector cube(expr_ref_vector& vars, unsigned ) override { expr_ref_vector cube(expr_ref_vector& vars, unsigned ) override {
set_reason_unknown("cubing is not supported on tactics"); set_reason_unknown("cubing is not supported on tactics");
@ -148,6 +153,7 @@ tactic2solver::tactic2solver(ast_manager & m, tactic * t, params_ref const & p,
} }
tactic2solver::~tactic2solver() { tactic2solver::~tactic2solver() {
user_propagate_clear();
} }
void tactic2solver::updt_params(params_ref const & p) { void tactic2solver::updt_params(params_ref const & p) {

View file

@ -192,6 +192,10 @@ public:
return m_t2->user_propagate_register(e); return m_t2->user_propagate_register(e);
} }
void user_propagate_clear() override {
m_t2->user_propagate_clear();
}
}; };
tactic * and_then(tactic * t1, tactic * t2) { tactic * and_then(tactic * t1, tactic * t2) {

View file

@ -56,6 +56,9 @@ namespace user_propagator {
virtual unsigned user_propagate_register(expr* e) { virtual unsigned user_propagate_register(expr* e) {
throw default_exception("user-propagators are only supported on the SMT solver"); throw default_exception("user-propagators are only supported on the SMT solver");
} }
virtual void user_propagate_clear() {
}
}; };