3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-05 19:00:25 +00:00

bv and gc of literals (#4692)

* bv and gc of literals

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* overload

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* diseq

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* diseq

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-09-17 14:24:07 -07:00 committed by GitHub
parent 2d52367368
commit 549753845e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 1480 additions and 854 deletions

View file

@ -257,6 +257,22 @@ namespace sat {
}
}
void drat::gc_var(bool_var v) {
sat::literal l(v, false);
// TBD: we want to remove all clauses that mention v.
std::cout << "GC " << v << "\n";
m_watches[l.index()].reset();
m_watches[(~l).index()].reset();
if (m_assignment[l.var()] != l_undef) {
unsigned j = 0;
for (literal lit : m_units)
if (lit.var() != v)
m_units[j++] = lit;
m_units.shrink(j);
m_assignment[l.var()] = l_undef;
}
}
void drat::bool_def(bool_var v, unsigned n) {
if (m_out)
(*m_out) << "b " << v << " " << n << " 0\n";
@ -277,6 +293,11 @@ namespace sat {
(*m_out) << " 0\n";
}
void drat::log_gc_var(bool_var v) {
if (m_out)
(*m_out) << "g " << v << " 0\n";
}
void drat::log_adhoc(std::function<void(std::ostream&)>& fn) {
if (m_out)
fn(*m_out);