diff --git a/src/opt/maxres.cpp b/src/opt/maxres.cpp index 8784cf80a..827f211e6 100644 --- a/src/opt/maxres.cpp +++ b/src/opt/maxres.cpp @@ -186,7 +186,6 @@ public: init(); init_local(); trace(); - display(); while (m_lower < m_upper) { TRACE("opt", display_vec(tout, m_asms); @@ -220,7 +219,6 @@ public: init(); init_local(); trace(); - display(); exprs cs; while (m_lower < m_upper) { lbool is_sat = check_sat_hill_climb(m_asms); @@ -253,14 +251,6 @@ public: return l_true; } - void display() { - if (m_dump_benchmarks && m_c.sat_enabled()) { - unsigned sz = m_soft.size(); - inc_sat_display(verbose_stream(), s(), sz, - m_soft.c_ptr(), m_weights.c_ptr()); - } - } - lbool check_sat_hill_climb(expr_ref_vector& asms1) { expr_ref_vector asms(asms1); diff --git a/src/opt/opt_context.cpp b/src/opt/opt_context.cpp index 4ae4b0112..f3d0e9bd0 100644 --- a/src/opt/opt_context.cpp +++ b/src/opt/opt_context.cpp @@ -41,6 +41,7 @@ Notes: #include "ast_smt_pp.h" #include "filter_model_converter.h" #include "ast_pp_util.h" +#include "inc_sat_solver.h" namespace opt { @@ -220,7 +221,7 @@ namespace opt { TRACE("opt", tout << "Hard constraint: " << mk_ismt2_pp(m_hard_constraints[i].get(), m) << std::endl;); s.assert_expr(m_hard_constraints[i].get()); } - + display_benchmark(); IF_VERBOSE(1, verbose_stream() << "(optimize:check-sat)\n";); lbool is_sat = s.check_sat(0,0); TRACE("opt", tout << "initial search result: " << is_sat << "\n";); @@ -1069,6 +1070,18 @@ namespace opt { } } + void context::display_benchmark() { + if (opt_params(m_params).dump_benchmarks() && + sat_enabled() && + m_objectives.size() == 1 && + m_objectives[0].m_type == O_MAXSMT + ) { + objective& o = m_objectives[0]; + unsigned sz = o.m_terms.size(); + inc_sat_display(verbose_stream(), get_solver(), sz, o.m_terms.c_ptr(), o.m_weights.c_ptr()); + } + } + void context::display(std::ostream& out) { display_assignment(out); } diff --git a/src/opt/opt_context.h b/src/opt/opt_context.h index f872d70b5..aa8c0a69a 100644 --- a/src/opt/opt_context.h +++ b/src/opt/opt_context.h @@ -280,6 +280,8 @@ namespace opt { void validate_lex(); + void display_benchmark(); + // pareto void yield();