mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
Added eq/fixed/final functions in C++ user propagator as methods (#5607)
This commit is contained in:
parent
fc3a701888
commit
3557e0b0c5
|
@ -3954,12 +3954,28 @@ namespace z3 {
|
||||||
Z3_solver_propagate_fixed(ctx(), *s, fixed_eh);
|
Z3_solver_propagate_fixed(ctx(), *s, fixed_eh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void register_fixed() {
|
||||||
|
assert(s);
|
||||||
|
m_fixed_eh = [this](unsigned id, expr const& e) {
|
||||||
|
fixed(id, e);
|
||||||
|
};
|
||||||
|
Z3_solver_propagate_fixed(ctx(), *s, fixed_eh);
|
||||||
|
}
|
||||||
|
|
||||||
void register_eq(eq_eh_t& f) {
|
void register_eq(eq_eh_t& f) {
|
||||||
assert(s);
|
assert(s);
|
||||||
m_eq_eh = f;
|
m_eq_eh = f;
|
||||||
Z3_solver_propagate_eq(ctx(), *s, eq_eh);
|
Z3_solver_propagate_eq(ctx(), *s, eq_eh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void register_eq() {
|
||||||
|
assert(s);
|
||||||
|
m_eq_eh = [this](unsigned x, unsigned y) {
|
||||||
|
eq(x, y);
|
||||||
|
};
|
||||||
|
Z3_solver_propagate_eq(ctx(), *s, eq_eh);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief register a callback on final-check.
|
\brief register a callback on final-check.
|
||||||
During the final check stage, all propagations have been processed.
|
During the final check stage, all propagations have been processed.
|
||||||
|
@ -3974,6 +3990,21 @@ namespace z3 {
|
||||||
Z3_solver_propagate_final(ctx(), *s, final_eh);
|
Z3_solver_propagate_final(ctx(), *s, final_eh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void register_final() {
|
||||||
|
assert(s);
|
||||||
|
m_final_eh = [this]() {
|
||||||
|
final();
|
||||||
|
};
|
||||||
|
Z3_solver_propagate_final(ctx(), *s, final_eh);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
virtual void fixed(unsigned id, expr const& e) { }
|
||||||
|
|
||||||
|
virtual void eq(unsigned x, unsigned y) { }
|
||||||
|
|
||||||
|
virtual void final() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief tracks \c e by a unique identifier that is returned by the call.
|
\brief tracks \c e by a unique identifier that is returned by the call.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue