mirror of
https://github.com/Z3Prover/z3
synced 2025-08-18 17:22:15 +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:
parent
d4a4dd6cc7
commit
b33f444545
24 changed files with 126 additions and 3 deletions
|
@ -168,6 +168,7 @@ public:
|
|||
m_frozen.push_back(e);
|
||||
}
|
||||
|
||||
|
||||
void user_propagate_clear() override {
|
||||
if (m_simp) {
|
||||
pop(1);
|
||||
|
|
|
@ -200,6 +200,10 @@ public:
|
|||
m_t2->user_propagate_register_diseq(diseq_eh);
|
||||
}
|
||||
|
||||
void user_propagate_register_on_binding(user_propagator::binding_eh_t& binding_eh) override {
|
||||
m_t2->user_propagate_register_on_binding(binding_eh);
|
||||
}
|
||||
|
||||
void user_propagate_register_expr(expr* e) override {
|
||||
m_t1->user_propagate_register_expr(e);
|
||||
m_t2->user_propagate_register_expr(e);
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace user_propagator {
|
|||
typedef std::function<void(void*, callback*, expr*)> created_eh_t;
|
||||
typedef std::function<void(void*, callback*, expr*, unsigned, bool)> decide_eh_t;
|
||||
typedef std::function<void(void*, expr*, unsigned, unsigned const*, unsigned, expr* const*)> on_clause_eh_t;
|
||||
typedef std::function<bool(void*, callback*, expr*, expr*)> binding_eh_t;
|
||||
|
||||
class plugin : public decl_plugin {
|
||||
public:
|
||||
|
@ -92,6 +93,10 @@ namespace user_propagator {
|
|||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
virtual void user_propagate_register_on_binding(binding_eh_t& r) {
|
||||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
virtual void user_propagate_clear() {
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue