mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +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:
parent
3e38bbb009
commit
5c2c0ae900
7 changed files with 93 additions and 25 deletions
|
@ -131,6 +131,21 @@ namespace user_solver {
|
|||
m_id2justification.setx(v, lits, sat::literal_vector());
|
||||
m_fixed_eh(m_user_context, this, var2expr(v), lit.sign() ? m.mk_false() : m.mk_true());
|
||||
}
|
||||
|
||||
void solver::new_eq_eh(euf::th_eq const& eq) {
|
||||
if (!m_eq_eh)
|
||||
return;
|
||||
force_push();
|
||||
m_eq_eh(m_user_context, this, var2expr(eq.v1()), var2expr(eq.v2()));
|
||||
}
|
||||
|
||||
void solver::new_diseq_eh(euf::th_eq const& de) {
|
||||
if (!m_diseq_eh)
|
||||
return;
|
||||
force_push();
|
||||
m_diseq_eh(m_user_context, this, var2expr(eq.v1()), var2expr(eq.v2()));
|
||||
}
|
||||
|
||||
|
||||
void solver::push_core() {
|
||||
th_euf_solver::push_core();
|
||||
|
|
|
@ -144,6 +144,10 @@ namespace user_solver {
|
|||
bool get_case_split(sat::bool_var& var, lbool &phase) override;
|
||||
|
||||
void asserted(sat::literal lit) override;
|
||||
bool use_diseqs() const override { return (bool)m_diseq_eh; }
|
||||
void new_eq_eh(euf::th_eq const& eq) override;
|
||||
void new_diseq_eh(euf::th_eq const& de) override;
|
||||
|
||||
sat::check_result check() override;
|
||||
void push_core() override;
|
||||
void pop_core(unsigned n) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue