3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-01 21:08:55 +00:00

add an option to register callback on quantifier instantiation

Suppose a user propagator encodes axioms using quantifiers and uses E-matching for instantiation. If it wants to implement a custom priority scheme or drop some instances based on internal checks it can register a callback with quantifier instantiation
This commit is contained in:
Nikolaj Bjorner 2025-08-06 21:11:38 -07:00
parent d4a4dd6cc7
commit b33f444545
24 changed files with 126 additions and 3 deletions

View file

@ -110,6 +110,15 @@ void theory_user_propagator::register_cb(expr* e) {
add_expr(e, true);
}
void theory_user_propagator::register_on_binding(user_propagator::binding_eh_t& binding_eh) {
std::function<bool(quantifier* q, expr* inst)> on_binding =
[this, binding_eh](quantifier* q, expr* inst) {
return binding_eh(m_user_context, this, q, inst);
};
ctx.register_on_binding(on_binding);
}
bool theory_user_propagator::next_split_cb(expr* e, unsigned idx, lbool phase) {
if (e == nullptr) { // clear
m_next_split_var = nullptr;