3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 10:52:02 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-02-25 18:14:41 -08:00
parent 39f73fa595
commit 4ff940a29e
6 changed files with 86 additions and 22 deletions

View file

@ -1166,7 +1166,13 @@ namespace opt {
out << mk_pp(term, m);
app* q = m.mk_fresh_const(out.str().c_str(), m.get_sort(term));
if (!fm) fm = alloc(generic_model_converter, m, "opt");
m_hard_constraints.push_back(m.mk_eq(q, term));
if (m_arith.is_int_real(term)) {
m_hard_constraints.push_back(m_arith.mk_ge(q, term));
m_hard_constraints.push_back(m_arith.mk_le(q, term));
}
else {
m_hard_constraints.push_back(m.mk_eq(q, term));
}
fm->hide(q);
return q;
}