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