mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 09:20:22 +00:00
new hashtable invariants
This commit is contained in:
parent
3b43f27580
commit
f38527124b
1 changed files with 13 additions and 0 deletions
|
@ -639,6 +639,19 @@ public:
|
||||||
|
|
||||||
#ifdef Z3DEBUG
|
#ifdef Z3DEBUG
|
||||||
bool check_invariant() {
|
bool check_invariant() {
|
||||||
|
// The capacity must always be a power of two.
|
||||||
|
if (!is_power_of_two(m_capacity))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// The number of deleted plus the size must not exceed the capacity.
|
||||||
|
if (m_num_deleted + m_size > m_capacity)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Checking that m_num_deleted is less than or equal to m_size.
|
||||||
|
if (m_num_deleted > m_size) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
entry * curr = m_table;
|
entry * curr = m_table;
|
||||||
entry * end = m_table + m_capacity;
|
entry * end = m_table + m_capacity;
|
||||||
unsigned num_deleted = 0;
|
unsigned num_deleted = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue