3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-09-01 07:15:13 -07:00
parent 74a2bf1588
commit ecddaeae66
6 changed files with 33 additions and 62 deletions

View file

@ -1602,7 +1602,6 @@ namespace sat {
}
lbool solver::bounded_search() {
#if 1
lbool is_sat = l_undef;
while (is_sat == l_undef && !should_cancel()) {
if (inconsistent()) is_sat = resolve_conflict_core();
@ -1614,26 +1613,6 @@ namespace sat {
else if (!decide()) is_sat = final_check();
}
return is_sat;
#else
while (true) {
checkpoint();
bool done = false;
while (!done) {
lbool is_sat = propagate_and_backjump_step(done);
if (is_sat != l_true) return is_sat;
}
SASSERT(!inconsistent());
do_gc();
if (!decide()) {
lbool is_sat = final_check();
if (is_sat != l_undef) {
return is_sat;
}
}
}
#endif
}
bool solver::should_propagate() const {
@ -1641,30 +1620,6 @@ namespace sat {
}
lbool solver::propagate_and_backjump_step(bool& done) {
done = true;
propagate(true);
if (!inconsistent()) {
return should_restart() ? l_undef : l_true;
}
if (!resolve_conflict())
return l_false;
if (reached_max_conflicts())
return l_undef;
if (should_rephase())
do_rephase();
if (at_base_lvl()) {
do_cleanup(false); // cleaner may propagate frozen clauses
if (inconsistent()) {
TRACE("sat", tout << "conflict at level 0\n";);
return l_false;
}
do_gc();
}
done = false;
return l_true;
}
lbool solver::final_check() {
if (m_ext) {
switch (m_ext->check()) {

View file

@ -459,29 +459,28 @@ namespace sat {
protected:
unsigned m_conflicts_since_init;
unsigned m_restarts;
unsigned m_restart_next_out;
unsigned m_conflicts_since_restart;
bool m_force_conflict_analysis;
unsigned m_simplifications;
unsigned m_restart_threshold;
unsigned m_luby_idx;
unsigned m_conflicts_since_gc;
unsigned m_gc_threshold;
unsigned m_defrag_threshold;
unsigned m_num_checkpoints;
double m_min_d_tk;
unsigned m_next_simplify;
unsigned m_conflicts_since_init { 0 };
unsigned m_restarts { 0 };
unsigned m_restart_next_out { 0 };
unsigned m_conflicts_since_restart { 0 };
bool m_force_conflict_analysis { false };
unsigned m_simplifications { 0 };
unsigned m_restart_threshold { 0 };
unsigned m_luby_idx { 0 };
unsigned m_conflicts_since_gc { 0 };
unsigned m_gc_threshold { 0 };
unsigned m_defrag_threshold { 0 };
unsigned m_num_checkpoints { 0 };
double m_min_d_tk { 0 } ;
unsigned m_next_simplify { 0 };
bool decide();
bool_var next_var();
lbool bounded_search();
lbool final_check();
lbool propagate_and_backjump_step(bool& done);
void init_search();
literal_vector m_min_core;
bool m_min_core_valid;
bool m_min_core_valid { false };
void init_reason_unknown() { m_reason_unknown = "no reason given"; }
void init_assumptions(unsigned num_lits, literal const* lits);
void reassert_min_core();

View file

@ -190,6 +190,8 @@ namespace euf {
if (s().value(lit) == l_true)
continue;
s().assign(literal(v, false), sat::justification::mk_ext_justification(lvl, eq_constraint().to_index()));
if (s().inconsistent())
return;
}
for (euf::enode* p : m_egraph.new_lits()) {
expr* e = p->get_owner();
@ -203,6 +205,11 @@ namespace euf {
if (s().value(lit) == l_false && m_ackerman)
m_ackerman->cg_conflict_eh(p->get_owner(), p->get_root()->get_owner());
s().assign(lit, sat::justification::mk_ext_justification(lvl, lit_constraint().to_index()));
if (s().inconsistent())
return;
}
for (euf::th_eq const& eq : m_egraph.new_th_eqs()) {
// m_id2solver[eq.m_id]->new_eq_eh(eq);
}
}

View file

@ -18,7 +18,7 @@ Author:
#include "util/top_sort.h"
#include "sat/smt/sat_smt.h"
#include "ast/euf/euf_enode.h"
#include "ast/euf/euf_egraph.h"
namespace sat {
@ -63,6 +63,8 @@ namespace sat {
virtual ~th_solver() {}
virtual th_solver* fresh(solver* s, ast_manager& m, sat_internalizer& si) = 0;
virtual void new_eq_eh(euf::th_eq const& eq) {}
};