mirror of
https://github.com/Z3Prover/z3
synced 2025-10-06 16:01:55 +00:00
Adding bv preprocessing techniques.
This commit is contained in:
parent
5290cd1ff5
commit
ec47a1df50
11 changed files with 1545 additions and 3 deletions
|
@ -36,11 +36,14 @@ struct bv_trailing::imp {
|
|||
: m_mk_extract(mk_extract)
|
||||
, m_util(mk_extract.bvutil())
|
||||
, m(mk_extract.m()) {
|
||||
TRACE("bv-trailing", tout << "ctor\n";);
|
||||
|
||||
for (unsigned i = 0; i <= TRAILING_DEPTH; ++i)
|
||||
m_count_cache[i] = NULL;
|
||||
}
|
||||
|
||||
virtual ~imp() {
|
||||
TRACE("bv-trailing", tout << "dtor\n";);
|
||||
reset_cache(0);
|
||||
}
|
||||
|
||||
|
@ -337,6 +340,7 @@ struct bv_trailing::imp {
|
|||
if (depth == 0) return;
|
||||
if (m_count_cache[depth] == NULL)
|
||||
m_count_cache[depth] = alloc(map);
|
||||
SASSERT(!m_count_cache[depth]->contains(e));
|
||||
m.inc_ref(e);
|
||||
m_count_cache[depth]->insert(e, std::make_pair(min, max));
|
||||
TRACE("bv-trailing", tout << "caching@" << depth <<": " << mk_ismt2_pp(e, m) << '[' << m_util.get_bv_size(e) << "]\n: " << min << '-' << max << "\n";);
|
||||
|
@ -359,11 +363,13 @@ struct bv_trailing::imp {
|
|||
return true;
|
||||
}
|
||||
|
||||
void reset_cache(unsigned condition) {
|
||||
void reset_cache(const unsigned condition) {
|
||||
SASSERT(m_count_cache[0] == NULL);
|
||||
for (unsigned i = 1; i <= TRAILING_DEPTH; ++i) {
|
||||
if (m_count_cache[i] == NULL) continue;
|
||||
if (m_count_cache[i]->size() < condition) continue;
|
||||
TRACE("bv-trailing", tout << "may reset cache " << i << " " << condition << "\n";);
|
||||
if (condition && m_count_cache[i]->size() < condition) continue;
|
||||
TRACE("bv-trailing", tout << "reset cache " << i << "\n";);
|
||||
map::iterator it = m_count_cache[i]->begin();
|
||||
map::iterator end = m_count_cache[i]->end();
|
||||
for (; it != end; ++it) m.dec_ref(it->m_key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue