mirror of
https://github.com/Z3Prover/z3
synced 2026-03-03 20:24:36 +00:00
create scalars for fixed variables in rows for grobner
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
279bcb733d
commit
c6e5d434b2
5 changed files with 48 additions and 18 deletions
|
|
@ -1482,7 +1482,17 @@ void core::add_var_and_its_factors_to_q_and_collect_new_rows(lpvar j, svector<lp
|
|||
}
|
||||
|
||||
|
||||
dd::pdd core::pdd_expr(const rational& c, lpvar j) {
|
||||
dd::pdd core::pdd_expr(const rational& c, lpvar j, u_dependency*& dep) {
|
||||
unsigned lc, uc;
|
||||
m_lar_solver.get_bound_constraint_witnesses_for_column(j, lc, uc);
|
||||
if (lc != null_lpvar)
|
||||
dep = m_intervals.mk_join(dep, m_intervals.mk_leaf(lc));
|
||||
if (uc != null_lpvar)
|
||||
dep = m_intervals.mk_join(dep, m_intervals.mk_leaf(uc));
|
||||
if (var_is_fixed(j)) {
|
||||
return m_pdd_manager.mk_val(c * m_lar_solver.column_lower_bound(j).x);
|
||||
}
|
||||
|
||||
if (!is_monic_var(j))
|
||||
return c * m_pdd_manager.mk_var(j);
|
||||
|
||||
|
|
@ -1490,7 +1500,14 @@ dd::pdd core::pdd_expr(const rational& c, lpvar j) {
|
|||
dd::pdd r = m_pdd_manager.mk_val(c);
|
||||
const monic& m = emons()[j];
|
||||
for (lpvar k : m.vars()) {
|
||||
r *= m_pdd_manager.mk_var(k);
|
||||
if (var_is_fixed(k)) {
|
||||
r *= m_pdd_manager.mk_val(m_lar_solver.column_lower_bound(k).x);
|
||||
m_lar_solver.get_bound_constraint_witnesses_for_column(k, lc, uc);
|
||||
dep = m_intervals.mk_join(dep, m_intervals.mk_leaf(lc));
|
||||
dep = m_intervals.mk_join(dep, m_intervals.mk_leaf(uc));
|
||||
} else {
|
||||
r *= m_pdd_manager.mk_var(k);
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
|
@ -1499,14 +1516,7 @@ void core::add_row_to_pdd_grobner(const vector<lp::row_cell<rational>> & row) {
|
|||
u_dependency *dep = nullptr;
|
||||
dd::pdd sum = m_pdd_manager.mk_val(rational(0));
|
||||
for (const auto &p : row) {
|
||||
dd::pdd e = pdd_expr(p.coeff(), p.var());
|
||||
sum += e;
|
||||
unsigned lc, uc;
|
||||
m_lar_solver.get_bound_constraint_witnesses_for_column(p.var(), lc, uc);
|
||||
if (lc != null_lpvar)
|
||||
dep = m_intervals.mk_join(dep, m_intervals.mk_leaf(lc));
|
||||
if (uc != null_lpvar)
|
||||
dep = m_intervals.mk_join(dep, m_intervals.mk_leaf(uc));
|
||||
sum += pdd_expr(p.coeff(), p.var(), dep);
|
||||
}
|
||||
m_pdd_grobner.add(sum, dep);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue