3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 02:45:51 +00:00

force-push on new_eq, new_diseq in user propagator, other fixes to Python bindings for user propagator

This update allows the python bindings for user-propagator to handle functions that are declared to be registered with the user propagator plugin. It fixes a bug in UserPropagateBase.add to allow registering terms dynamically during search.
It also fixes a bug in theory_user_propagate as scopes were not fully pushed when the solver gets the callbacks for new equalities and new disequalities.
It also adds equality and disequality interfaces to the sat/smt solver version (which isn't being exercised in earnest yet)
This commit is contained in:
Nikolaj Bjorner 2022-07-25 03:42:29 +02:00
parent 3e38bbb009
commit 5c2c0ae900
7 changed files with 93 additions and 25 deletions

View file

@ -1429,7 +1429,7 @@ ast_manager::~ast_manager() {
}
m_plugins.reset();
while (!m_ast_table.empty()) {
DEBUG_CODE(IF_VERBOSE(0, verbose_stream() << "ast_manager LEAKED: " << m_ast_table.size() << std::endl););
DEBUG_CODE(IF_VERBOSE(1, verbose_stream() << "ast_manager LEAKED: " << m_ast_table.size() << std::endl););
ptr_vector<ast> roots;
ast_mark mark;
for (ast * n : m_ast_table) {
@ -1465,22 +1465,21 @@ ast_manager::~ast_manager() {
break;
}
}
for (ast * n : m_ast_table) {
if (!mark.is_marked(n)) {
for (ast * n : m_ast_table)
if (!mark.is_marked(n))
roots.push_back(n);
}
}
SASSERT(!roots.empty());
for (unsigned i = 0; i < roots.size(); ++i) {
ast* a = roots[i];
DEBUG_CODE(
std::cout << "Leaked: ";
if (is_sort(a)) {
std::cout << to_sort(a)->get_name() << "\n";
}
else {
std::cout << mk_ll_pp(a, *this, false) << "id: " << a->get_id() << "\n";
});
IF_VERBOSE(1,
verbose_stream() << "Leaked: ";
if (is_sort(a))
verbose_stream() << to_sort(a)->get_name() << "\n";
else
verbose_stream() << mk_ll_pp(a, *this, false) << "id: " << a->get_id() << "\n";
););
a->m_ref_count = 0;
delete_node(a);
}