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

no calling cut_solver when there are bounded columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

use special bounds inf find_cube for x+y, x-y

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

bug fixes in column patching, add stats to patching, restructure int_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

comment out m_old_values from int_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

avoid calling pivot_fixed_vars_from_basis() in int_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fix the return value from path_nbasic_columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fix the return value from path_nbasic_columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

work in patch_columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

work on int_solver check()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

exit from find_free_interval() when l >= u

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

experiment with branching on nbasic columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

remove m_old_values

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

add rounding to patch_columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

qflia

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

patch all columns, round non-patched, branch or basic columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

refactor int_solver::check()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

restore  move_non_basic_columns_to_bounds() after a failure in find_cube()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

optimize gomory cuts search

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

produce gomory cuts without moving columns to bounds

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

call find_feasible_solution() after moving columns

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

alway move colums to bounds before gomory cut

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

merge from best branch

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2018-04-03 17:29:58 -07:00
parent 7e82ab595e
commit c04bcb411d
13 changed files with 341 additions and 276 deletions

View file

@ -2131,7 +2131,7 @@ var_index lar_solver:: to_var_index(unsigned ext_j) const {
return it->second.internal_j();
}
bool lar_solver::tighten_term_bounds_by_delta(unsigned term_index, const mpq& delta) {
bool lar_solver::tighten_term_bounds_by_delta(unsigned term_index, const impq& delta) {
unsigned tj = term_index + m_terms_start_index;
auto it = m_ext_vars_to_columns.find(tj);
if (it == m_ext_vars_to_columns.end())
@ -2141,17 +2141,23 @@ bool lar_solver::tighten_term_bounds_by_delta(unsigned term_index, const mpq& de
TRACE("cube", tout << "delta = " << delta << std::endl;
m_int_solver->display_column(tout, j); );
if (slv.column_has_upper_bound(j) && slv.column_has_lower_bound(j)) {
if (slv.m_upper_bounds[j].x - delta < slv.m_lower_bounds[j].x + delta) {
if (slv.m_upper_bounds[j] - delta < slv.m_lower_bounds[j] + delta) {
TRACE("cube", tout << "cannot tighten, delta = " << delta;);
return false;
}
}
TRACE("cube", tout << "can tighten";);
if (slv.column_has_upper_bound(j)) {
add_var_bound(tj, lconstraint_kind::LE, slv.m_upper_bounds[j].x - delta);
if (!is_zero(delta.y))
add_var_bound(tj, lconstraint_kind::LT, slv.m_upper_bounds[j].x - delta.x);
else
add_var_bound(tj, lconstraint_kind::LE, slv.m_upper_bounds[j].x - delta.x);
}
if (slv.column_has_lower_bound(j)) {
add_var_bound(tj, lconstraint_kind::GE, slv.m_lower_bounds[j].x + delta);
if (!is_zero(delta.y))
add_var_bound(tj, lconstraint_kind::GT, slv.m_lower_bounds[j].x + delta.x);
else
add_var_bound(tj, lconstraint_kind::GE, slv.m_lower_bounds[j].x + delta.x);
}
return true;
}