mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
consistent
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
26631ce38d
commit
846a9fc25f
|
@ -42,6 +42,7 @@ void emonics::push() {
|
|||
m_region.push_scope();
|
||||
m_ve.push();
|
||||
SASSERT(monics_are_canonized());
|
||||
SASSERT(consistent());
|
||||
}
|
||||
|
||||
void emonics::pop(unsigned n) {
|
||||
|
@ -63,6 +64,7 @@ void emonics::pop(unsigned n) {
|
|||
m_monics.shrink(old_sz);
|
||||
m_region.pop_scope(n);
|
||||
m_lim.shrink(m_lim.size() - n);
|
||||
SASSERT(consistent());
|
||||
SASSERT(monics_are_canonized());
|
||||
m_u_f_stack.pop_scope(n);
|
||||
}
|
||||
|
@ -288,7 +290,6 @@ void emonics::add(lpvar v, unsigned sz, lpvar const* vs) {
|
|||
lpvar last_var = UINT_MAX;
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
lpvar w = vs[i];
|
||||
SASSERT(m_ve.is_root(w));
|
||||
if (w != last_var) {
|
||||
m_use_lists.reserve(w + 1);
|
||||
insert_cell(m_use_lists[w], idx);
|
||||
|
|
|
@ -107,7 +107,6 @@ class emonics {
|
|||
void insert_cg_mon(monic & m);
|
||||
void remove_cg_mon(const monic & m);
|
||||
void rehash_cg(lpvar v) { remove_cg(v); insert_cg(v); }
|
||||
|
||||
void do_canonize(monic& m) const;
|
||||
cell* head(lpvar v) const;
|
||||
void set_visited(monic& m) const;
|
||||
|
@ -328,6 +327,16 @@ public:
|
|||
bool is_used_in_monic(lpvar v) const { return v < m_use_lists.size() && m_use_lists[v].m_head != nullptr; }
|
||||
|
||||
bool elists_are_consistent(std::unordered_map<unsigned_vector, std::unordered_set<lpvar>, hash_svector> &lists) const;
|
||||
|
||||
bool consistent() const {
|
||||
unsigned mons = 0;
|
||||
for (lpvar v = 0; v < m_var2index.size(); v++) {
|
||||
if (is_monic_var(v)) {
|
||||
mons ++;
|
||||
}
|
||||
}
|
||||
return m_monics.size() == mons;
|
||||
}
|
||||
|
||||
}; // end of emonics
|
||||
|
||||
|
|
|
@ -960,6 +960,7 @@ void core::clear() {
|
|||
void core::init_search() {
|
||||
clear();
|
||||
init_vars_equivalence();
|
||||
SASSERT(m_emons.consistent());
|
||||
SASSERT(elists_are_consistent(false));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue