3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

add facility to dispense with cancellation (not activated at this point). Address #961 by expanding recurisve function definitions that are not tautologies if the current model does not validate

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-04-07 21:22:38 -07:00
parent 0c4b792dac
commit ec29a03c8f
8 changed files with 62 additions and 28 deletions

View file

@ -154,6 +154,8 @@ namespace sat {
if (!m_subsumption && !m_elim_blocked_clauses && !m_resolution)
return;
// solver::scoped_disable_checkpoint _scoped_disable_checkpoint(s);
initialize();
CASSERT("sat_solver", s.check_invariant());
@ -167,7 +169,6 @@ namespace sat {
CASSERT("sat_solver", s.check_invariant());
m_need_cleanup = false;
m_use_list.init(s.num_vars());
init_visited();
m_learned_in_use_lists = false;
if (learned) {
register_clauses(s.m_learned);

View file

@ -33,6 +33,7 @@ namespace sat {
solver::solver(params_ref const & p, reslimit& l, extension * ext):
m_rlimit(l),
m_checkpoint_enabled(true),
m_config(p),
m_ext(ext),
m_par(0),

View file

@ -72,6 +72,7 @@ namespace sat {
struct abort_solver {};
protected:
reslimit& m_rlimit;
bool m_checkpoint_enabled;
config m_config;
stats m_stats;
extension * m_ext;
@ -214,6 +215,16 @@ namespace sat {
}
}
};
class scoped_disable_checkpoint {
solver& s;
public:
scoped_disable_checkpoint(solver& s): s(s) {
s.m_checkpoint_enabled = false;
}
~scoped_disable_checkpoint() {
s.m_checkpoint_enabled = true;
}
};
unsigned select_watch_lit(clause const & cls, unsigned starting_at) const;
unsigned select_learned_watch_lit(clause const & cls) const;
bool simplify_clause(unsigned & num_lits, literal * lits) const;
@ -257,6 +268,7 @@ namespace sat {
lbool status(clause const & c) const;
clause_offset get_offset(clause const & c) const { return m_cls_allocator.get_offset(&c); }
void checkpoint() {
if (!m_checkpoint_enabled) return;
if (!m_rlimit.inc()) {
m_mc.reset();
m_model_is_current = false;