3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00

fixing the bugs

This commit is contained in:
Lev Nachmanson 2023-09-07 15:59:20 -07:00
parent c43b99daae
commit c050af922f
6 changed files with 39 additions and 25 deletions

View file

@ -789,6 +789,8 @@ namespace lp {
void lar_solver::detect_rows_with_changed_bounds() { void lar_solver::detect_rows_with_changed_bounds() {
for (auto j : m_columns_with_changed_bounds) for (auto j : m_columns_with_changed_bounds)
detect_rows_with_changed_bounds_for_column(j); detect_rows_with_changed_bounds_for_column(j);
if (m_find_monics_with_changed_bounds_func)
m_find_monics_with_changed_bounds_func(m_columns_with_changed_bounds);
} }
void lar_solver::update_x_and_inf_costs_for_columns_with_changed_bounds_tableau() { void lar_solver::update_x_and_inf_costs_for_columns_with_changed_bounds_tableau() {

View file

@ -670,6 +670,7 @@ class lar_solver : public column_namer {
return 0; return 0;
return m_usage_in_terms[j]; return m_usage_in_terms[j];
} }
std::function<void (const indexed_uint_set& columns_with_changed_bound)> m_find_monics_with_changed_bounds_func = nullptr;
friend int_solver; friend int_solver;
friend int_branch; friend int_branch;
}; };

View file

@ -259,8 +259,8 @@ namespace nla {
} }
void monomial_bounds::unit_propagate() { void monomial_bounds::unit_propagate() {
for (auto const& m : c().m_emons) for (lpvar v : c().m_monics_with_changed_bounds)
unit_propagate(m); unit_propagate(c().emons()[v]);
} }
void monomial_bounds::unit_propagate(monic const& m) { void monomial_bounds::unit_propagate(monic const& m) {

View file

@ -21,8 +21,7 @@ namespace nla {
typedef lp::lar_term term; typedef lp::lar_term term;
core::core(lp::lar_solver& s, params_ref const& p, reslimit & lim) : core::core(lp::lar_solver& s, params_ref const& p, reslimit& lim) : m_evars(),
m_evars(),
lra(s), lra(s),
m_reslim(lim), m_reslim(lim),
m_params(p), m_params(p),
@ -38,9 +37,22 @@ core::core(lp::lar_solver& s, params_ref const& p, reslimit & lim) :
m_grobner(this), m_grobner(this),
m_emons(m_evars), m_emons(m_evars),
m_use_nra_model(false), m_use_nra_model(false),
m_nra(s, m_nra_lim, *this) m_nra(s, m_nra_lim, *this) {
{
m_nlsat_delay = lp_settings().nlsat_delay(); m_nlsat_delay = lp_settings().nlsat_delay();
lra.m_find_monics_with_changed_bounds_func = [&](const indexed_uint_set& columns_with_changed_bounds) {
m_monics_with_changed_bounds.clear();
for (const auto& m : m_emons) {
if (columns_with_changed_bounds.contains(m.var())) {
m_monics_with_changed_bounds.push_back(m.var());
continue;
}
for (lpvar j : m.vars()) {
if (columns_with_changed_bounds.contains(j)) {
m_monics_with_changed_bounds.push_back(m.var());
break;
}
}
} };
} }
bool core::compare_holds(const rational& ls, llc cmp, const rational& rs) const { bool core::compare_holds(const rational& ls, llc cmp, const rational& rs) const {

View file

@ -88,6 +88,7 @@ class core {
vector<lemma> * m_lemma_vec; vector<lemma> * m_lemma_vec;
vector<ineq> * m_literal_vec = nullptr; vector<ineq> * m_literal_vec = nullptr;
indexed_uint_set m_to_refine; indexed_uint_set m_to_refine;
vector<lpvar> m_monics_with_changed_bounds;
tangents m_tangents; tangents m_tangents;
basics m_basics; basics m_basics;
order m_order; order m_order;

View file

@ -1532,8 +1532,6 @@ namespace smt {
bool max, bool max,
bool maintain_integrality, bool maintain_integrality,
bool& has_shared) { bool& has_shared) {
return UNBOUNDED;
m_stats.m_max_min++; m_stats.m_max_min++;
unsigned best_efforts = 0; unsigned best_efforts = 0;
bool inc = false; bool inc = false;