mirror of
https://github.com/Z3Prover/z3
synced 2025-09-05 01:27:41 +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
|
@ -28,6 +28,7 @@ Revision History:
|
|||
#include "params/qi_params.h"
|
||||
#include "ast/cost_evaluator.h"
|
||||
#include "util/statistics.h"
|
||||
#include "tactic/user_propagator_base.h"
|
||||
|
||||
namespace smt {
|
||||
class context;
|
||||
|
@ -52,6 +53,7 @@ namespace smt {
|
|||
cached_var_subst m_subst;
|
||||
svector<float> m_vals;
|
||||
double m_eager_cost_threshold = 0;
|
||||
std::function<bool(quantifier*,expr*)> m_on_binding;
|
||||
struct entry {
|
||||
fingerprint * m_qb;
|
||||
float m_cost;
|
||||
|
@ -95,6 +97,9 @@ namespace smt {
|
|||
void reset();
|
||||
void display_delayed_instances_stats(std::ostream & out) const;
|
||||
void collect_statistics(::statistics & st) const;
|
||||
void register_on_binding(std::function<bool(quantifier* q, expr* e)> & on_binding) {
|
||||
m_on_binding = on_binding;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue