mirror of
https://github.com/Z3Prover/z3
synced 2025-08-19 17:50:23 +00:00
cut fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c9be09b18c
commit
8b97e26fd7
5 changed files with 86 additions and 95 deletions
|
@ -117,6 +117,19 @@ namespace sat {
|
|||
uint64_t m_luts[6];
|
||||
literal m_lits[6];
|
||||
|
||||
class lut {
|
||||
aig_cuts& a;
|
||||
node const* n;
|
||||
cut const* c;
|
||||
public:
|
||||
lut(aig_cuts& a, node const& n) : a(a), n(&n), c(nullptr) {}
|
||||
lut(aig_cuts& a, cut const& c) : a(a), n(nullptr), c(&c) {}
|
||||
unsigned size() const { return n ? n->size() : c->size(); }
|
||||
literal child(unsigned idx) const { return n ? a.child(*n, idx) : a.child(*c, idx); }
|
||||
uint64_t table() const { return n ? n->lut() : c->table(); }
|
||||
std::ostream& display(std::ostream& out) const { return n ? a.display(out, *n) : out << *c; }
|
||||
};
|
||||
|
||||
bool is_touched(bool_var v, node const& n);
|
||||
bool is_touched(literal lit) const { return is_touched(lit.var()); }
|
||||
bool is_touched(bool_var v) const { return m_last_touched[v] + m_aig.size() >= m_num_cut_calls * m_aig.size(); }
|
||||
|
@ -136,8 +149,11 @@ namespace sat {
|
|||
void augment_aig2(unsigned v, node const& n, cut_set& cs);
|
||||
void augment_aigN(unsigned v, node const& n, cut_set& cs);
|
||||
|
||||
void augment_lut(unsigned v, node const& n, cut_set& cs);
|
||||
void augment_lut_rec(unsigned v, node const& n, cut& a, unsigned idx, cut_set& cs);
|
||||
|
||||
void augment_lut(unsigned v, lut const& n, cut_set& cs);
|
||||
void augment_lut_rec(unsigned v, lut const& n, cut& a, unsigned idx, cut_set& cs);
|
||||
|
||||
cut_set const& lit2cuts(literal lit) const { return m_cuts[lit.var()]; }
|
||||
|
||||
bool insert_cut(unsigned v, cut const& c, cut_set& cs);
|
||||
|
||||
|
@ -145,14 +161,13 @@ namespace sat {
|
|||
bool flush_roots(bool_var var, literal_vector const& to_root, node& n);
|
||||
void flush_roots(literal_vector const& to_root, cut_set& cs);
|
||||
|
||||
void flush_units(cut_set& cs);
|
||||
|
||||
cut_val eval(node const& n, cut_eval const& env) const;
|
||||
lbool get_value(bool_var v) const;
|
||||
|
||||
std::ostream& display(std::ostream& out, node const& n) const;
|
||||
|
||||
literal child(node const& n, unsigned idx) const { SASSERT(!n.is_var()); SASSERT(idx < n.size()); return m_literals[n.offset() + idx]; }
|
||||
literal child(cut const& n, unsigned idx) const { SASSERT(idx < n.size()); return literal(n[idx], false); }
|
||||
|
||||
void on_node_add(unsigned v, node const& n);
|
||||
void on_node_del(unsigned v, node const& n);
|
||||
|
@ -186,8 +201,6 @@ namespace sat {
|
|||
void inc_max_cutset_size(unsigned v) { m_max_cutset_size[v] += 10; touch(v); }
|
||||
unsigned max_cutset_size(unsigned v) const { return v == UINT_MAX ? m_config.m_max_cutset_size : m_max_cutset_size[v]; }
|
||||
|
||||
void flush_units();
|
||||
|
||||
vector<cut_set> const & operator()();
|
||||
unsigned num_cuts() const { return m_num_cuts; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue