mirror of
https://github.com/Z3Prover/z3
synced 2025-06-19 04:13:38 +00:00
catch the possible infeasible column when adding an equality
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
562be531e9
commit
c2e7dd3378
1 changed files with 5 additions and 2 deletions
|
@ -1693,7 +1693,7 @@ bool lar_solver::all_vars_are_registered(const vector<std::pair<mpq, var_index>>
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// do not register this term if ext_i == UINT_MAX
|
// do not register in m_var_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) {
|
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";);
|
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));
|
m_term_register.add_var(ext_i, term_is_int(coeffs));
|
||||||
|
@ -2362,6 +2362,9 @@ std::pair<constraint_index, constraint_index> lar_solver::add_equality(lpvar j,
|
||||||
coeffs.push_back(std::make_pair(mpq(1),j));
|
coeffs.push_back(std::make_pair(mpq(1),j));
|
||||||
coeffs.push_back(std::make_pair(mpq(-1),k));
|
coeffs.push_back(std::make_pair(mpq(-1),k));
|
||||||
unsigned term_index = add_term(coeffs, UINT_MAX); // UINT_MAX is the external null var
|
unsigned term_index = add_term(coeffs, UINT_MAX); // UINT_MAX is the external null var
|
||||||
|
if (get_column_value(j) != get_column_value(k)) {
|
||||||
|
set_infeasible_column(map_term_index_to_column_index(term_index));
|
||||||
|
}
|
||||||
return std::pair<constraint_index, constraint_index>(
|
return std::pair<constraint_index, constraint_index>(
|
||||||
add_var_bound(term_index, lconstraint_kind::LE, mpq(0)),
|
add_var_bound(term_index, lconstraint_kind::LE, mpq(0)),
|
||||||
add_var_bound(term_index, lconstraint_kind::GE, mpq(0)));
|
add_var_bound(term_index, lconstraint_kind::GE, mpq(0)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue