mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
fix push/pop bugs in optimize context, add example to c++, fix bug in arithemtic bounds axiom addition
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
31f16d7aa4
commit
3f8083dfa6
3 changed files with 34 additions and 1 deletions
|
@ -139,6 +139,7 @@ namespace opt {
|
|||
for (; it != end; ++it) {
|
||||
dealloc(it->m_value);
|
||||
}
|
||||
m_maxsmts.reset();
|
||||
}
|
||||
|
||||
void context::push() {
|
||||
|
@ -149,21 +150,29 @@ namespace opt {
|
|||
for (unsigned i = 0; i < n; ++i) {
|
||||
m_scoped_state.pop();
|
||||
}
|
||||
m_model.reset();
|
||||
reset_maxsmts();
|
||||
m_optsmt.reset();
|
||||
m_hard_constraints.reset();
|
||||
}
|
||||
|
||||
void context::set_hard_constraints(ptr_vector<expr>& fmls) {
|
||||
m_scoped_state.set(fmls);
|
||||
m_model.reset();
|
||||
}
|
||||
|
||||
void context::add_hard_constraint(expr* f) {
|
||||
m_scoped_state.add(f);
|
||||
m_model.reset();
|
||||
}
|
||||
|
||||
unsigned context::add_soft_constraint(expr* f, rational const& w, symbol const& id) {
|
||||
m_model.reset();
|
||||
return m_scoped_state.add(f, w, id);
|
||||
}
|
||||
|
||||
unsigned context::add_objective(app* t, bool is_max) {
|
||||
m_model.reset();
|
||||
return m_scoped_state.add(t, is_max);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue