3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-28 19:01:29 +00:00

Polysat updates (#5444)

* Simplify adding lemmas

* Remove misleading constructor from tmp_assign.

The idea is that tmp_assign is only created on the stack and
short-lived.  Instead of having a convenience constructor that takes a
constraint_ref, it's clearer to have an explicit .get() at the call
site.

* Remove some log messages

* bugfix

* fix

* Add stub for conflict_core

* wip

* Add example by Clemens
This commit is contained in:
Jakob Rath 2021-07-30 20:14:19 +02:00 committed by GitHub
parent 2ef8ee25f1
commit 8a773d2bee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 302 additions and 116 deletions

View file

@ -126,7 +126,8 @@ namespace polysat {
void push_cjust(pvar v, constraint* c) {
if (m_cjust[v].contains(c)) // TODO: better check (flag on constraint?)
return;
LOG_V("cjust[v" << v << "] += " << *c);
LOG_V("cjust[v" << v << "] += " << show_deref(c));
SASSERT(c);
m_cjust[v].push_back(c);
m_trail.push_back(trail_instr_t::just_i);
m_cjust_trail.push_back(v);
@ -206,9 +207,6 @@ namespace polysat {
bool is_conflict() const { return !m_conflict.empty(); }
bool at_base_level() const;
unsigned base_level() const;
bool active_at_base_level(sat::bool_var bvar) const;
bool active_at_base_level(sat::literal lit) const { return active_at_base_level(lit.var()); }
bool active_at_base_level(constraint& c) const { return active_at_base_level(c.bvar()); }
void resolve_conflict();
void backtrack(unsigned i, clause_ref lemma);
@ -216,10 +214,8 @@ namespace polysat {
void revert_decision(pvar v, clause_ref reason);
void revert_bool_decision(sat::literal lit, clause_ref reason);
void learn_lemma(pvar v, clause_ref lemma);
void learn_lemma_clause(pvar v, clause_ref lemma);
void backjump(unsigned new_level);
void add_lemma_unit(constraint_ref lemma);
void add_lemma_clause(clause_ref lemma);
void add_lemma(clause_ref lemma);
constraint_literal mk_eq(pdd const& p);
constraint_literal mk_diseq(pdd const& p);