mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
9d759a187e
commit
d8e00bc02e
|
@ -1042,6 +1042,8 @@ public:
|
||||||
rational r;
|
rational r;
|
||||||
lp_api::bound_kind k;
|
lp_api::bound_kind k;
|
||||||
theory_var v = null_theory_var;
|
theory_var v = null_theory_var;
|
||||||
|
bool_var bv = ctx().mk_bool_var(atom);
|
||||||
|
ctx().set_var_theory(bv, get_id());
|
||||||
if (a.is_le(atom, n1, n2) && is_numeral(n2, r) && is_app(n1)) {
|
if (a.is_le(atom, n1, n2) && is_numeral(n2, r) && is_app(n1)) {
|
||||||
v = internalize_def(to_app(n1));
|
v = internalize_def(to_app(n1));
|
||||||
k = lp_api::upper_t;
|
k = lp_api::upper_t;
|
||||||
|
@ -1057,10 +1059,9 @@ public:
|
||||||
else {
|
else {
|
||||||
TRACE("arith", tout << "Could not internalize " << mk_pp(atom, m) << "\n";);
|
TRACE("arith", tout << "Could not internalize " << mk_pp(atom, m) << "\n";);
|
||||||
found_unsupported(atom);
|
found_unsupported(atom);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
bool_var bv = ctx().mk_bool_var(atom);
|
|
||||||
ctx().set_var_theory(bv, get_id());
|
|
||||||
if (is_int(v) && !r.is_int()) {
|
if (is_int(v) && !r.is_int()) {
|
||||||
r = (k == lp_api::upper_t) ? floor(r) : ceil(r);
|
r = (k == lp_api::upper_t) ? floor(r) : ceil(r);
|
||||||
}
|
}
|
||||||
|
@ -2241,12 +2242,14 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (m_asserted_qhead < m_asserted_atoms.size() && !ctx().inconsistent()) {
|
while (m_asserted_qhead < m_asserted_atoms.size() && !ctx().inconsistent()) {
|
||||||
bool_var bv = m_asserted_atoms[m_asserted_qhead].m_bv;
|
bool_var bv = m_asserted_atoms[m_asserted_qhead].m_bv;
|
||||||
bool is_true = m_asserted_atoms[m_asserted_qhead].m_is_true;
|
bool is_true = m_asserted_atoms[m_asserted_qhead].m_is_true;
|
||||||
m_to_check.push_back(bv);
|
m_to_check.push_back(bv);
|
||||||
lp_api::bound& b = *m_bool_var2bound.find(bv);
|
lp_api::bound* b = nullptr;
|
||||||
assert_bound(bv, is_true, b);
|
if (m_bool_var2bound.find(bv, b)) {
|
||||||
++m_asserted_qhead;
|
assert_bound(bv, is_true, *b);
|
||||||
|
++m_asserted_qhead;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ctx().inconsistent()) {
|
if (ctx().inconsistent()) {
|
||||||
m_to_check.reset();
|
m_to_check.reset();
|
||||||
|
@ -2691,11 +2694,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void propagate_basic_bounds() {
|
void propagate_basic_bounds() {
|
||||||
for (auto const& bv : m_to_check) {
|
for (auto const& bv : m_to_check) {
|
||||||
lp_api::bound& b = *m_bool_var2bound.find(bv);
|
lp_api::bound* b = nullptr;
|
||||||
propagate_bound(bv, ctx().get_assignment(bv) == l_true, b);
|
if (m_bool_var2bound.find(bv, b)) {
|
||||||
if (ctx().inconsistent()) break;
|
propagate_bound(bv, ctx().get_assignment(bv) == l_true, *b);
|
||||||
|
if (ctx().inconsistent()) break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_to_check.reset();
|
m_to_check.reset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue