3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

add option for using corr set and use partial cores

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-08-30 14:48:24 -07:00
parent 7f219e84de
commit 0ed38ed59b
6 changed files with 84 additions and 18 deletions

View file

@ -33,7 +33,7 @@ namespace sat {
m_mus.reset();
m_model.reset();
m_best_value = 0;
m_max_restarts = 10;
m_max_restarts = (s.m_stats.m_restart - m_restart) + 10;
m_restart = s.m_stats.m_restart;
}
@ -59,12 +59,13 @@ namespace sat {
lbool mus::operator()() {
flet<bool> _disable_min(s.m_config.m_minimize_core, false);
flet<bool> _disable_min_partial(s.m_config.m_minimize_core_partial, false);
flet<bool> _disable_opt(s.m_config.m_optimize_model, false);
flet<bool> _is_active(m_is_active, true);
IF_VERBOSE(3, verbose_stream() << "(sat.mus " << s.get_core() << ")\n";);
reset();
return mus1();
lbool r = mus1();
m_restart = s.m_stats.m_restart;
return r;
}
lbool mus::mus1() {
@ -95,6 +96,11 @@ namespace sat {
// IF_VERBOSE(0, verbose_stream() << "num literals: " << core << " " << mus << "\n";);
break;
}
if (s.m_config.m_minimize_core_partial && s.m_stats.m_restart - m_restart > m_max_restarts) {
IF_VERBOSE(1, verbose_stream() << "restart budget exceeded\n";);
set_core();
return l_true;
}
literal lit = core.back();
core.pop_back();
@ -166,7 +172,7 @@ namespace sat {
lbool mus::qx(literal_set& assignment, literal_set& support, bool has_support) {
lbool is_sat = l_true;
if (s.m_stats.m_restart - m_restart > m_max_restarts) {
if (s.m_config.m_minimize_core_partial && s.m_stats.m_restart - m_restart > m_max_restarts) {
IF_VERBOSE(1, verbose_stream() << "restart budget exceeded\n";);
return l_true;
}

View file

@ -940,7 +940,6 @@ namespace sat {
bool solver::init_weighted_assumptions(unsigned num_lits, literal const* lits, double const* weights, double max_weight) {
flet<bool> _min1(m_config.m_minimize_core, false);
flet<bool> _min2(m_config.m_minimize_core_partial, false);
m_weight = 0;
m_blocker.reset();
svector<lbool> values;
@ -2017,7 +2016,7 @@ namespace sat {
idx--;
}
reset_unmark(old_size);
if (m_config.m_minimize_core || m_config.m_minimize_core_partial) {
if (m_config.m_minimize_core) {
if (m_min_core_valid && m_min_core.size() < m_core.size()) {
IF_VERBOSE(1, verbose_stream() << "(sat.updating core " << m_min_core.size() << " " << m_core.size() << ")\n";);
m_core.reset();