mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
fix minimize->maxsat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
da348fe1c0
commit
e307c5fdda
1 changed files with 12 additions and 1 deletions
|
@ -221,7 +221,18 @@ namespace opt {
|
|||
if (is_minimize(fml, term, index)) {
|
||||
TRACE("opt", tout << "try to convert minimization" << mk_pp(term, m) << "\n";);
|
||||
rational coeff(0);
|
||||
return get_pb_sum(term, terms, weights, coeff);
|
||||
// minimize 2*x + 3*y
|
||||
// <=>
|
||||
// (assret-soft (not x) 2)
|
||||
// (assert-soft (not y) 3)
|
||||
//
|
||||
if (get_pb_sum(term, terms, weights, coeff) && coeff.is_zero()) {
|
||||
// TBD: and weights are positive?
|
||||
for (unsigned i = 0; i < terms.size(); ++i) {
|
||||
terms[i] = m.mk_not(terms[i].get());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue