diff --git a/src/opt/maxres.cpp b/src/opt/maxres.cpp index 7f4dbdb1e..3c5834797 100644 --- a/src/opt/maxres.cpp +++ b/src/opt/maxres.cpp @@ -869,7 +869,7 @@ public: m_pivot_on_cs = p.maxres_pivot_on_correction_set(); m_wmax = p.maxres_wmax(); m_dump_benchmarks = p.dump_benchmarks(); - m_enable_lns = p.enable_lns() && m_c.sat_enabled(); + m_enable_lns = p.enable_lns(); m_lns_conflicts = p.lns_conflicts(); } diff --git a/src/opt/opt_context.cpp b/src/opt/opt_context.cpp index 429b537b9..ffb83e30d 100644 --- a/src/opt/opt_context.cpp +++ b/src/opt/opt_context.cpp @@ -41,7 +41,7 @@ Notes: #include "tactic/generic_model_converter.h" #include "ackermannization/ackermannize_bv_tactic.h" #include "sat/sat_solver/inc_sat_solver.h" -#include "qe/qsat.h" +#include "sat/sat_params.hpp" #include "opt/opt_context.h" #include "opt/opt_solver.h" #include "opt/opt_params.hpp" @@ -680,20 +680,23 @@ namespace opt { } void context::update_solver() { - if (!m_enable_sat || !probe_bv()) { - return; - } - if (m_maxsat_engine != symbol("maxres") && - m_maxsat_engine != symbol("pd-maxres") && - m_maxsat_engine != symbol("bcd2") && - m_maxsat_engine != symbol("sls")) { - return; - } - if (opt_params(m_params).priority() == symbol("pareto")) { - return; - } - if (m.proofs_enabled()) { - return; + sat_params p(m_params); + if (!p.euf()) { + if (!m_enable_sat || !probe_fd()) { + return; + } + if (m_maxsat_engine != symbol("maxres") && + m_maxsat_engine != symbol("pd-maxres") && + m_maxsat_engine != symbol("bcd2") && + m_maxsat_engine != symbol("sls")) { + return; + } + if (opt_params(m_params).priority() == symbol("pareto")) { + return; + } + if (m.proofs_enabled()) { + return; + } } m_params.set_bool("minimize_core_partial", true); m_params.set_bool("minimize_core", true); @@ -711,28 +714,28 @@ namespace opt { } } - struct context::is_bv { - struct found {}; + struct context::is_fd { + struct found_fd {}; ast_manager& m; pb_util pb; bv_util bv; - is_bv(ast_manager& m): m(m), pb(m), bv(m) {} - void operator()(var *) { throw found(); } - void operator()(quantifier *) { throw found(); } + is_fd(ast_manager& m): m(m), pb(m), bv(m) {} + void operator()(var *) { throw found_fd(); } + void operator()(quantifier *) { throw found_fd(); } void operator()(app *n) { family_id fid = n->get_family_id(); if (fid != m.get_basic_family_id() && fid != pb.get_family_id() && fid != bv.get_family_id() && (!is_uninterp_const(n) || (!m.is_bool(n) && !bv.is_bv(n)))) { - throw found(); + throw found_fd(); } } }; - bool context::probe_bv() { + bool context::probe_fd() { expr_fast_mark1 visited; - is_bv proc(m); + is_fd proc(m); try { for (objective& obj : m_objectives) { if (obj.m_type != O_MAXSMT) return false; @@ -749,7 +752,7 @@ namespace opt { quick_for_each_expr(proc, visited, f); } } - catch (const is_bv::found &) { + catch (const is_fd::found_fd &) { return false; } return true; diff --git a/src/opt/opt_context.h b/src/opt/opt_context.h index 28cff40d3..0ed7bf9f2 100644 --- a/src/opt/opt_context.h +++ b/src/opt/opt_context.h @@ -302,8 +302,8 @@ namespace opt { inf_eps get_upper_as_num(unsigned idx); - struct is_bv; - bool probe_bv(); + struct is_fd; + bool probe_fd(); struct is_propositional_fn; bool is_propositional(expr* e); diff --git a/src/smt/smt_kernel.h b/src/smt/smt_kernel.h index 5218df623..aef5cd073 100644 --- a/src/smt/smt_kernel.h +++ b/src/smt/smt_kernel.h @@ -150,10 +150,14 @@ namespace smt { */ lbool preferred_sat(expr_ref_vector const& asms, vector& cores); - void set_phase(expr * e) { NOT_IMPLEMENTED_YET(); } - solver::phase* get_phase() { NOT_IMPLEMENTED_YET(); return nullptr; } - void set_phase(solver::phase* p) { NOT_IMPLEMENTED_YET(); } - void move_to_front(expr* e) { NOT_IMPLEMENTED_YET(); } + /** + \brief control phase selection and variable ordering. + Base implementation is a no-op. + */ + void set_phase(expr * e) { } + solver::phase* get_phase() { return nullptr; } + void set_phase(solver::phase* p) { } + void move_to_front(expr* e) { } /** \brief Return the model associated with the last check command.