3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 11:25:51 +00:00

add a unit test for monics, plus some cosmetic changes

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-03-12 18:22:53 -07:00
parent 0207878f5f
commit 26631ce38d
5 changed files with 103 additions and 6 deletions

View file

@ -1705,7 +1705,7 @@ bool lar_solver::all_vars_are_registered(const vector<std::pair<mpq, var_index>>
return true;
}
// do not register this term if ext_i == -1
// do not register this term if ext_i == UINT_MAX
var_index lar_solver::add_term(const vector<std::pair<mpq, var_index>> & coeffs, unsigned ext_i) {
TRACE("lar_solver_terms", print_linear_combination_of_column_indices_only(coeffs, tout) << ", ext_i =" << ext_i << "\n";);
m_term_register.add_var(ext_i, term_is_int(coeffs));
@ -2370,7 +2370,7 @@ std::pair<constraint_index, constraint_index> lar_solver::add_equality(lpvar j,
vector<std::pair<mpq, var_index>> coeffs;
coeffs.push_back(std::make_pair(mpq(1),j));
coeffs.push_back(std::make_pair(mpq(-1),k));
unsigned term_index = add_term(coeffs, -1); // -1 is the external null var
unsigned term_index = add_term(coeffs, UINT_MAX); // UINT_MAX is the external null var
return std::pair<constraint_index, constraint_index>(
add_var_bound(term_index, lconstraint_kind::LE, mpq(0)),
add_var_bound(term_index, lconstraint_kind::GE, mpq(0)));