mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 17:45:32 +00:00
accept term indices as columns in some lar_solver queries
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
f43f1629cf
commit
906d52ca1c
4 changed files with 14 additions and 3 deletions
|
@ -203,6 +203,8 @@ void lar_solver::calculate_implied_bounds_for_row(unsigned i, lp_bound_propagato
|
|||
}
|
||||
|
||||
unsigned lar_solver::adjust_column_index_to_term_index(unsigned j) const {
|
||||
if (is_term(j))
|
||||
return j;
|
||||
unsigned ext_var_or_term = m_var_register.local_to_external(j);
|
||||
return ext_var_or_term < m_terms_start_index ? j : ext_var_or_term;
|
||||
}
|
||||
|
|
|
@ -138,6 +138,9 @@ public:
|
|||
}
|
||||
|
||||
const mpq& get_column_value_rational(unsigned j) const {
|
||||
if (is_term(j)) {
|
||||
j = m_var_register.external_to_local(j);
|
||||
}
|
||||
return m_mpq_lar_core_solver.m_r_x[j].x;
|
||||
}
|
||||
|
||||
|
@ -565,10 +568,16 @@ public:
|
|||
}
|
||||
|
||||
constraint_index get_column_upper_bound_witness(unsigned j) const {
|
||||
if (is_term(j)) {
|
||||
j = m_var_register.external_to_local(j);
|
||||
}
|
||||
return m_columns_to_ul_pairs()[j].upper_bound_witness();
|
||||
}
|
||||
|
||||
constraint_index get_column_lower_bound_witness(unsigned j) const {
|
||||
if (is_term(j)) {
|
||||
j = m_var_register.external_to_local(j);
|
||||
}
|
||||
return m_columns_to_ul_pairs()[j].lower_bound_witness();
|
||||
}
|
||||
|
||||
|
|
|
@ -74,8 +74,7 @@ lp::lar_term core::subs_terms_to_columns(const lp::lar_term& t) const {
|
|||
}
|
||||
|
||||
bool core::ineq_holds(const ineq& n) const {
|
||||
lp::lar_term t = subs_terms_to_columns(n.term());
|
||||
return compare_holds(value(t), n.cmp(), n.rs());
|
||||
return compare_holds(value(n.term()), n.cmp(), n.rs());
|
||||
}
|
||||
|
||||
bool core::lemma_holds(const lemma& l) const {
|
||||
|
|
|
@ -90,7 +90,8 @@ void monotone::monotonicity_lemma(monic const& m) {
|
|||
}
|
||||
|
||||
void monotone::monotonicity_lemma_gt(const monic& m, const rational& prod_val) {
|
||||
TRACE("nla_solver", tout << "prod_val = " << prod_val << "\n";);
|
||||
TRACE("nla_solver", tout << "prod_val = " << prod_val << "\n";
|
||||
tout << "m = "; c().print_monic_with_vars(m, tout););
|
||||
add_empty_lemma();
|
||||
for (lpvar j : m.vars()) {
|
||||
c().add_abs_bound(j, llc::GT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue