mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
update default to maxres for MaxSAT, reset pareto and box state on every constraint update
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
9978cba5a8
commit
fc36d861a7
3 changed files with 13 additions and 6 deletions
|
@ -154,7 +154,7 @@ namespace opt {
|
|||
for (unsigned i = 0; i < n; ++i) {
|
||||
m_scoped_state.pop();
|
||||
}
|
||||
m_model.reset();
|
||||
clear_state();
|
||||
reset_maxsmts();
|
||||
m_optsmt.reset();
|
||||
m_hard_constraints.reset();
|
||||
|
@ -162,21 +162,21 @@ namespace opt {
|
|||
|
||||
void context::set_hard_constraints(ptr_vector<expr>& fmls) {
|
||||
m_scoped_state.set(fmls);
|
||||
m_model.reset();
|
||||
clear_state();
|
||||
}
|
||||
|
||||
void context::add_hard_constraint(expr* f) {
|
||||
m_scoped_state.add(f);
|
||||
m_model.reset();
|
||||
clear_state();
|
||||
}
|
||||
|
||||
unsigned context::add_soft_constraint(expr* f, rational const& w, symbol const& id) {
|
||||
m_model.reset();
|
||||
clear_state();
|
||||
return m_scoped_state.add(f, w, id);
|
||||
}
|
||||
|
||||
unsigned context::add_objective(app* t, bool is_max) {
|
||||
m_model.reset();
|
||||
clear_state();
|
||||
return m_scoped_state.add(t, is_max);
|
||||
}
|
||||
|
||||
|
@ -1122,6 +1122,12 @@ namespace opt {
|
|||
}
|
||||
}
|
||||
|
||||
void context::clear_state() {
|
||||
set_pareto(0);
|
||||
m_box_index = UINT_MAX;
|
||||
m_model.reset();
|
||||
}
|
||||
|
||||
void context::set_pareto(pareto_base* p) {
|
||||
#pragma omp critical (opt_context)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue