mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 13:06:05 +00:00
fix remove lar_solver::add_constraint
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
7cd90537c3
commit
3c5b1086a1
8 changed files with 164 additions and 122 deletions
|
@ -386,17 +386,19 @@ namespace lp {
|
|||
return ret;
|
||||
}
|
||||
|
||||
void add_constraint_to_solver(lar_solver * solver, formula_constraint & fc) {
|
||||
void add_constraint_to_solver(lar_solver * solver, formula_constraint & fc, unsigned i) {
|
||||
vector<std::pair<mpq, var_index>> ls;
|
||||
for (auto & it : fc.m_coeffs) {
|
||||
ls.push_back(std::make_pair(it.first, solver->add_var(register_name(it.second), false)));
|
||||
}
|
||||
solver->add_constraint(ls, fc.m_kind, fc.m_right_side);
|
||||
unsigned j = solver->add_term(ls, i);
|
||||
solver->add_var_bound(j, fc.m_kind, fc.m_right_side);
|
||||
}
|
||||
|
||||
void fill_lar_solver(lar_solver * solver) {
|
||||
unsigned i = 0;
|
||||
for (formula_constraint & fc : m_constraints)
|
||||
add_constraint_to_solver(solver, fc);
|
||||
add_constraint_to_solver(solver, fc, i++);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue