3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 22:23:22 +00:00

fix collect_fixed

This commit is contained in:
Jakob Rath 2023-08-18 15:26:09 +02:00
parent efe0fa8e15
commit 5bd35d764f

View file

@ -558,6 +558,8 @@ namespace polysat {
} }
bool slicing::try_get_value(enode* s, rational& val) const { bool slicing::try_get_value(enode* s, rational& val) const {
if (!s)
return false;
app* a = s->get_app(); app* a = s->get_app();
if (a->get_num_args() != 1) if (a->get_num_args() != 1)
return false; return false;
@ -1514,10 +1516,10 @@ namespace polysat {
unsigned lo = 0; unsigned lo = 0;
for (auto it = base.rbegin(); it != base.rend(); ++it) { for (auto it = base.rbegin(); it != base.rend(); ++it) {
enode* const n = *it; enode* const n = *it;
enode* const r = n->get_root(); enode* const nv = get_value_node(n);
unsigned const w = width(n); unsigned const w = width(n);
unsigned const hi = lo + w - 1; unsigned const hi = lo + w - 1;
if (try_get_value(r, a)) if (try_get_value(nv, a))
out.push_back({hi, lo, a, n}); out.push_back({hi, lo, a, n});
lo += w; lo += w;
} }