3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 02:45:51 +00:00

fixes in branching

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-04-26 16:12:54 -07:00
parent 236edad8dc
commit 530f77281c
9 changed files with 20 additions and 40 deletions

View file

@ -45,7 +45,7 @@ namespace lp {
lia.m_k = mpq(0);
}
else {
lia.m_upper = lra.settings().branch_flip()? lia.random() % 2 : left_branch_is_more_narrow_than_right(j);
lia.m_upper = lia.random() % 2;
lia.m_k = lia.m_upper? floor(lia.get_value(j)) : ceil(lia.get_value(j));
}
@ -55,23 +55,6 @@ namespace lp {
return lia_move::branch;
}
bool int_branch::left_branch_is_more_narrow_than_right(unsigned j) {
switch (lra.get_column_type(j)) {
case column_type::fixed:
return false;
case column_type::boxed: {
auto k = floor(lia.get_value(j));
return k - lia.lower_bound(j).x < lia.upper_bound(j).x - (k + mpq(1));
}
case column_type::lower_bound:
return true;
case column_type::upper_bound:
return false;
default:
return false;
}
}
int int_branch::find_inf_int_base_column() {
unsigned inf_int_count = 0;
int j = find_inf_int_boxed_base_column_with_smallest_range(inf_int_count);
@ -93,8 +76,9 @@ namespace lp {
}
int int_branch::find_inf_int_nbasis_column() const {
for (unsigned j : lra.r_nbasis())
if (!lia.column_is_int_inf(j)) {
if (lia.column_is_int_inf(j)) {
return j;
}
return -1;