3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00

convert term indices to columns in lar_solver::add_equality()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-03-24 12:44:50 -07:00
parent e2538afd32
commit bc5b68b16e

View file

@ -2364,6 +2364,12 @@ bool lar_solver::fetch_normalized_term_column(const lar_term& c, std::pair<mpq,
std::pair<constraint_index, constraint_index> lar_solver::add_equality(lpvar j, lpvar k) {
vector<std::pair<mpq, var_index>> coeffs;
if (tv::is_term(j))
j = map_term_index_to_column_index(j);
if (tv::is_term(k))
k = map_term_index_to_column_index(k);
coeffs.push_back(std::make_pair(mpq(1),j));
coeffs.push_back(std::make_pair(mpq(-1),k));
unsigned term_index = add_term(coeffs, UINT_MAX); // UINT_MAX is the external null var