mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 21:38:44 +00:00
fixes in patch blocking
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
4728a1fb0c
commit
e7bb8e57cb
|
@ -358,7 +358,7 @@ public:
|
|||
|
||||
template <typename Blocker, typename ChangeReport>
|
||||
bool try_to_patch(lpvar j, const mpq& val,
|
||||
const Blocker& blocker,
|
||||
const Blocker& is_blocked,
|
||||
const ChangeReport& change_report) {
|
||||
if (is_base(j)) {
|
||||
TRACE("nla_solver", get_int_solver()->display_row_info(tout, row_of_basic_column(j)) << "\n";);
|
||||
|
@ -367,7 +367,7 @@ public:
|
|||
}
|
||||
|
||||
impq ival(val);
|
||||
if (!blocker(j, ival))
|
||||
if (is_blocked(j, ival))
|
||||
return false;
|
||||
|
||||
impq delta = get_column_value(j) - ival;
|
||||
|
@ -378,7 +378,7 @@ public:
|
|||
impq rj_new_val = a * delta + get_column_value(rj);
|
||||
// if (column_is_int(rj) && !rj_new_val.is_int())
|
||||
// return false;
|
||||
if (blocker(rj, rj_new_val))
|
||||
if (is_blocked(rj, rj_new_val))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1287,11 +1287,11 @@ bool core::has_real(const monic& m) const {
|
|||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool core::patch_blocker(lpvar u, const monic& m, const lp::impq& ival) const {
|
||||
// returns true if the patching is blocking
|
||||
bool core::patch_is_blocked(lpvar u, const monic& m, const lp::impq& ival) const {
|
||||
SASSERT(m_to_refine.contains(m.var()));
|
||||
if (m_cautious_patching && !m_lar_solver.inside_bounds(u, ival))
|
||||
return false;
|
||||
return true; // blocking
|
||||
if (var_breaks_correct_monic(u)) {
|
||||
TRACE("nla_solver", tout << "u = " << u << " blocked as used in a correct monomial\n";);
|
||||
return true;
|
||||
|
@ -1306,10 +1306,10 @@ bool core::patch_blocker(lpvar u, const monic& m, const lp::impq& ival) const {
|
|||
}
|
||||
|
||||
bool core::try_to_patch(lpvar k, const rational& v, const monic & m) {
|
||||
auto blocker = [this, k, m](lpvar u, const lp::impq& v)
|
||||
{ return u != k && patch_blocker(u, m, v); };
|
||||
auto is_blocked = [this, k, m](lpvar u, const lp::impq& v)
|
||||
{ return u != k && patch_is_blocked(u, m, v); };
|
||||
auto change_report = [this](lpvar u) { update_to_refine_of_var(u); };
|
||||
return m_lar_solver.try_to_patch(k, v, blocker, change_report);
|
||||
return m_lar_solver.try_to_patch(k, v, is_blocked, change_report);
|
||||
}
|
||||
|
||||
bool in_power(const svector<lpvar>& vs, unsigned l) {
|
||||
|
|
|
@ -474,7 +474,7 @@ public:
|
|||
void update_to_refine_of_var(lpvar j);
|
||||
bool try_to_patch(lpvar, const rational&, const monic&);
|
||||
bool to_refine_is_correct() const;
|
||||
bool patch_blocker(lpvar u, const monic& m, const lp::impq&) const;
|
||||
bool patch_is_blocked(lpvar u, const monic& m, const lp::impq&) const;
|
||||
bool has_big_num(const monic&) const;
|
||||
bool var_is_big(lpvar) const;
|
||||
bool has_real(const factorization&) const;
|
||||
|
|
Loading…
Reference in a new issue