From ab8d3cdc447e278465563294d44c73ea29d098af Mon Sep 17 00:00:00 2001 From: TheRealNebus Date: Tue, 24 Apr 2018 17:59:21 +0100 Subject: [PATCH] WMax conflict budget bug fix --- src/opt/opt_context.cpp | 4 ++-- src/opt/opt_params.pyg | 2 +- src/opt/wmax.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/opt/opt_context.cpp b/src/opt/opt_context.cpp index 2f6bad9e8..4bbbc3865 100644 --- a/src/opt/opt_context.cpp +++ b/src/opt/opt_context.cpp @@ -398,10 +398,10 @@ namespace opt { /** \brief there is no need to use push/pop when all objectives are maxsat and engine - is maxres. + is maxres or mss. */ bool context::scoped_lex() { - if (m_maxsat_engine == symbol("maxres")) { + if (m_maxsat_engine == symbol("maxres") || m_maxsat_engine == symbol("mss")) { for (unsigned i = 0; i < m_objectives.size(); ++i) { if (m_objectives[i].m_type != O_MAXSMT) return true; } diff --git a/src/opt/opt_params.pyg b/src/opt/opt_params.pyg index 41548452a..e06836f61 100644 --- a/src/opt/opt_params.pyg +++ b/src/opt/opt_params.pyg @@ -3,7 +3,7 @@ def_module_params('opt', export=True, params=(('optsmt_engine', SYMBOL, 'basic', "select optimization engine: 'basic', 'farkas', 'symba'"), ('maxsat_engine', SYMBOL, 'maxres', "select engine for maxsat: 'core_maxsat', 'wmax', 'maxres', 'pd-maxres', 'mss'"), - ('priority', SYMBOL, 'lex', "select how to priortize objectives: 'lex' (lexicographic), 'pareto', or 'box'"), + ('priority', SYMBOL, 'lex', "select how to prioritize objectives: 'lex' (lexicographic), 'pareto', or 'box'"), ('dump_benchmarks', BOOL, False, 'dump benchmarks for profiling'), ('solution_prefix', SYMBOL, '', "path prefix to dump intermediary, but non-optimal, solutions"), ('timeout', UINT, UINT_MAX, 'timeout (in milliseconds) (UINT_MAX and 0 mean no timeout)'), diff --git a/src/opt/wmax.cpp b/src/opt/wmax.cpp index 52b87e536..513c68d6e 100644 --- a/src/opt/wmax.cpp +++ b/src/opt/wmax.cpp @@ -84,6 +84,9 @@ namespace opt { if (m.canceled()) { is_sat = l_undef; } + if (is_sat == l_undef) { + break; + } if (is_sat == l_false) { TRACE("opt", tout << "Unsat\n";); break; @@ -97,9 +100,6 @@ namespace opt { //DEBUG_CODE(verify_cores(cores);); s().assert_expr(fml); } - else { - //DEBUG_CODE(verify_cores(cores);); - } update_cores(wth(), cores); wth().init_min_cost(m_upper - m_lower); trace_bounds("wmax");