mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
bugfixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
97225b7d8f
commit
03e012c1d8
14 changed files with 167 additions and 139 deletions
|
@ -97,7 +97,10 @@ namespace euf {
|
|||
|
||||
enode* bv_plugin::mk_value(rational const& v, unsigned sz) {
|
||||
auto e = bv.mk_numeral(v, sz);
|
||||
return mk(e, 0, nullptr);
|
||||
auto n = mk(e, 0, nullptr);
|
||||
if (m_ensure_th_var)
|
||||
m_ensure_th_var(n);
|
||||
return n;
|
||||
}
|
||||
|
||||
void bv_plugin::propagate_merge(enode* x, enode* y) {
|
||||
|
@ -331,7 +334,7 @@ namespace euf {
|
|||
v = div(v, rational::power_of_two(lo));
|
||||
if (hi + 1 != width(n))
|
||||
v = mod(v, rational::power_of_two(hi + 1));
|
||||
return mk(bv.mk_numeral(v, hi - lo + 1), 0, nullptr);
|
||||
return mk_value(v, hi - lo + 1);
|
||||
}
|
||||
return mk(bv.mk_extract(hi, lo, n->get_expr()), 1, &n);
|
||||
}
|
||||
|
|
|
@ -41,11 +41,10 @@ namespace euf {
|
|||
|
||||
bv_util bv;
|
||||
slice_info_vector m_info; // indexed by enode::get_id()
|
||||
|
||||
|
||||
|
||||
enode_vector m_xs, m_ys;
|
||||
|
||||
std::function<void(enode*)> m_ensure_th_var;
|
||||
|
||||
bool is_concat(enode* n) const { return bv.is_concat(n->get_expr()); }
|
||||
bool is_concat(enode* n, enode*& a, enode*& b) { return is_concat(n) && (a = n->get_arg(0), b = n->get_arg(1), true); }
|
||||
bool is_extract(enode* n, unsigned& lo, unsigned& hi) { expr* body; return bv.is_extract(n->get_expr(), lo, hi, body); }
|
||||
|
@ -109,6 +108,8 @@ namespace euf {
|
|||
void propagate() override;
|
||||
|
||||
void undo() override;
|
||||
|
||||
void set_ensure_th_var(std::function<void(enode*)>& f) { m_ensure_th_var = f; }
|
||||
|
||||
std::ostream& display(std::ostream& out) const override;
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ namespace euf {
|
|||
}
|
||||
|
||||
void egraph::add_th_eq(theory_id id, theory_var v1, theory_var v2, enode* c, enode* r) {
|
||||
TRACE("euf_verbose", tout << "eq: " << v1 << " == " << v2 << "\n";);
|
||||
TRACE("euf", tout << "eq: " << v1 << " == " << v2 << " - " << bpp(c) << " == " << bpp(r) << "\n";);
|
||||
m_new_th_eqs.push_back(th_eq(id, v1, v2, c, r));
|
||||
m_updates.push_back(update_record(update_record::new_th_eq()));
|
||||
++m_stats.m_num_th_eqs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue