mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
mbi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
39f73fa595
commit
4ff940a29e
6 changed files with 86 additions and 22 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -186,6 +186,7 @@ namespace opt {
|
|||
void add_hard_constraint(expr* f, expr* t);
|
||||
|
||||
void get_hard_constraints(expr_ref_vector& hard);
|
||||
expr_ref_vector get_hard_constraints() { expr_ref_vector hard(m); get_hard_constraints(hard); return hard; }
|
||||
expr_ref get_objective(unsigned i);
|
||||
|
||||
void push() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue