mirror of
https://github.com/Z3Prover/z3
synced 2025-05-08 00:05:46 +00:00
add a check in gomory cut
Signed-off-by: Lev Nachmanson <levnach@microsoft.com>
This commit is contained in:
parent
1490b7a15f
commit
04824e7372
4 changed files with 18 additions and 2 deletions
|
@ -273,6 +273,12 @@ void int_solver::gomory_cut_adjust_t_and_k_for_size_1(const vector<std::pair<mpq
|
|||
}
|
||||
|
||||
|
||||
bool int_solver::current_solution_is_inf_on_cut(const lar_term& t, const mpq& k) const {
|
||||
const auto & x = m_lar_solver->m_mpq_lar_core_solver.m_r_x;
|
||||
impq v = t.apply(x);
|
||||
TRACE("gomory_cut", tout << "v = " << v << " k = " << k << std::endl;);
|
||||
return v > k;
|
||||
}
|
||||
|
||||
lia_move int_solver::report_gomory_cut(lar_term& t, mpq& k, mpq &lcm_den, unsigned num_ints) {
|
||||
lp_assert(!t.is_empty());
|
||||
|
@ -282,6 +288,7 @@ lia_move int_solver::report_gomory_cut(lar_term& t, mpq& k, mpq &lcm_den, unsign
|
|||
else
|
||||
gomory_cut_adjust_t_and_k_for_size_gt_1(pol, t, k, num_ints, lcm_den);
|
||||
m_lar_solver->subs_term_columns(t);
|
||||
lp_assert(current_solution_is_inf_on_cut(t, k));
|
||||
return lia_move::cut;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue