3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +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:
Nikolaj Bjorner 2015-04-01 19:32:50 -07:00
parent 9978cba5a8
commit fc36d861a7
3 changed files with 13 additions and 6 deletions

View file

@ -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)
{

View file

@ -271,6 +271,7 @@ namespace opt {
void add_maxsmt(symbol const& id);
void set_simplify(tactic *simplify);
void set_pareto(pareto_base* p);
void clear_state();
bool is_numeral(expr* e, rational& n) const;

View file

@ -3,7 +3,7 @@ def_module_params('opt',
export=True,
params=(('timeout', UINT, UINT_MAX, 'set timeout'),
('optsmt_engine', SYMBOL, 'basic', "select optimization engine: 'basic', 'farkas', 'symba'"),
('maxsat_engine', SYMBOL, 'wmax', "select engine for maxsat: 'fu_malik', 'core_maxsat', 'wmax', 'pbmax', 'maxres', 'pd-maxres', 'bcd2', 'wpm2', 'sls', 'maxhs'"),
('maxsat_engine', SYMBOL, 'maxres', "select engine for maxsat: 'fu_malik', 'core_maxsat', 'wmax', 'pbmax', 'maxres', 'pd-maxres', 'bcd2', 'wpm2', 'sls', 'maxhs'"),
('priority', SYMBOL, 'lex', "select how to priortize objectives: 'lex' (lexicographic), 'pareto', or 'box'"),
('dump_benchmarks', BOOL, False, 'dump benchmarks for profiling'),
('print_model', BOOL, False, 'display model for satisfiable constraints'),