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:
parent
2d52367368
commit
549753845e
34 changed files with 1480 additions and 854 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue