3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-05-20 08:59:34 +00:00

lll-cube: weight C(B) by column tightness to favor tight-box rows

Replace the unweighted greedy with a weighted cube cost
  C(B) = sum_j w_j * delta_j(B) + sum_i delta_i(B)
where w_j = max(1, 2/width(j)) for columns with finite [lb, ub] and 1
elsewhere. compute_col_weights() runs once after build_matrix(); the
breakpoint pairing in reduce_pair() now carries a combined weight and
sorts/medians/evaluates with it.

Soundness is unchanged: weights only steer the choice of B; the actual
delta_col(j) = (1/2)||row_j(B)||_1 used to tighten bounds is recomputed
from the resulting B.

On the QF_LIA Bromberger CAV_2009 family this enables the rounding path
to fire for the first time: v45_problem_2__028.slack solves in 0.88s
(LLL on) vs 7.05s (LLL off), with arith-lll-cube-success = 1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Lev Nachmanson 2026-05-15 14:43:41 -07:00
parent 66231210a9
commit 2ba7d7ed70
2 changed files with 48 additions and 20 deletions

View file

@ -67,6 +67,7 @@ namespace lp {
vector<vector<mpq>> m_H; // H = A * B; m x n
vector<vector<mpq>> m_B; // n x n unimodular
vector<vector<mpq>> m_B_inv; // B^{-1} = product of inverse elementaries
vector<mpq> m_col_w; // per-column weight in the cube cost
vector<impq> m_term_delta;
vector<impq> m_col_delta;
vector<impq> m_saved_x_J;
@ -78,6 +79,7 @@ namespace lp {
private:
bool collect_J_and_terms();
bool build_matrix();
void compute_col_weights();
bool compute_basis();
bool reduce_pair(unsigned j, unsigned k, bool& improved);
bool too_big(const mpq& v) const;