mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 17:30:23 +00:00
Added decide-callback to user-propagator (#5978)
* Fixed registering expressions in push/pop * Reused existing function * Reverted reusing can_propagate * Added decide-callback to user-propagator * Refactoring * Fixed index
This commit is contained in:
parent
9ecd4f8406
commit
e11496bc65
16 changed files with 284 additions and 87 deletions
|
@ -531,7 +531,6 @@ namespace smt {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool theory_bv::get_fixed_value(theory_var v, numeral & result) const {
|
||||
result.reset();
|
||||
unsigned i = 0;
|
||||
|
@ -1821,6 +1820,39 @@ namespace smt {
|
|||
st.update("bv dynamic eqs", m_stats.m_num_eq_dynamic);
|
||||
}
|
||||
|
||||
theory_bv::var_enode_pos theory_bv::get_bv_with_theory(bool_var v, theory_id id) const {
|
||||
atom* a = get_bv2a(v);
|
||||
svector<var_enode_pos> vec;
|
||||
if (!a->is_bit())
|
||||
return var_enode_pos(nullptr, UINT32_MAX);
|
||||
bit_atom * b = static_cast<bit_atom*>(a);
|
||||
var_pos_occ * curr = b->m_occs;
|
||||
while (curr) {
|
||||
enode* n = get_enode(curr->m_var);
|
||||
if (n->get_th_var(id) != null_theory_var)
|
||||
return var_enode_pos(n, curr->m_idx);
|
||||
curr = curr->m_next;
|
||||
}
|
||||
return var_enode_pos(nullptr, UINT32_MAX);
|
||||
}
|
||||
|
||||
bool_var theory_bv::get_first_unassigned(unsigned start_bit, enode* n) const {
|
||||
theory_var v = n->get_th_var(get_family_id());
|
||||
auto& bits = m_bits[v];
|
||||
unsigned sz = bits.size();
|
||||
|
||||
for (unsigned i = start_bit; i < sz; ++i) {
|
||||
if (ctx.get_assignment(bits[i].var()) != l_undef)
|
||||
return bits[i].var();
|
||||
}
|
||||
for (unsigned i = 0; i < start_bit; ++i) {
|
||||
if (ctx.get_assignment(bits[i].var()) != l_undef)
|
||||
return bits[i].var();
|
||||
}
|
||||
|
||||
return null_bool_var;
|
||||
}
|
||||
|
||||
bool theory_bv::check_assignment(theory_var v) {
|
||||
if (!is_root(v))
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue