3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

added Karr test

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-02-27 17:32:27 -08:00
parent 5598f334d4
commit 75eca46d93
6 changed files with 238 additions and 9 deletions

View file

@ -518,7 +518,7 @@ private:
SASSERT(m_keys.size() == num_keys());
iterator it = begin();
trie* new_root = mk_trie();
IF_VERBOSE(1, verbose_stream() << "before reshuffle: " << m_root->num_nodes() << " nodes\n";);
IF_VERBOSE(2, verbose_stream() << "before reshuffle: " << m_root->num_nodes() << " nodes\n";);
for (; it != end(); ++it) {
IF_VERBOSE(2,
for (unsigned i = 0; i < num_keys(); ++i) {
@ -539,7 +539,7 @@ private:
m_keys[i] = new_keys[i];
}
IF_VERBOSE(1, verbose_stream() << "after reshuffle: " << new_root->num_nodes() << " nodes\n";);
IF_VERBOSE(2, verbose_stream() << "after reshuffle: " << new_root->num_nodes() << " nodes\n";);
IF_VERBOSE(2,
it = begin();
for (; it != end(); ++it) {
@ -559,7 +559,7 @@ private:
if (index == num_keys()) {
SASSERT(n->ref_count() > 0);
bool r = check(to_leaf(n)->get_value());
IF_VERBOSE(1,
IF_VERBOSE(2,
for (unsigned j = 0; j < index; ++j) {
verbose_stream() << " ";
}
@ -572,7 +572,7 @@ private:
for (unsigned i = 0; i < nodes.size(); ++i) {
++m_stats.m_num_find_le_nodes;
node* m = nodes[i].second;
IF_VERBOSE(1,
IF_VERBOSE(2,
for (unsigned j = 0; j < index; ++j) {
verbose_stream() << " ";
}

View file

@ -21,9 +21,8 @@ Revision History:
#include "heap.h"
#include "map.h"
#include "heap_trie.h"
#include "stopwatch.h"
template<typename Value>
class rational_map : public map<rational, Value, rational::hash_proc, rational::eq_proc> {};
typedef int_hashtable<int_hash, default_eq<int> > int_table;
@ -263,7 +262,10 @@ class hilbert_basis::index {
void reset() { memset(this, 0, sizeof(*this)); }
};
typedef rational_map<value_index*> value_map;
template<typename Value>
class numeral_map : public map<numeral, Value, numeral::hash_proc, numeral::eq_proc> {};
typedef numeral_map<value_index*> value_map;
hilbert_basis& hb;
value_map m_neg;
value_index m_pos;
@ -793,9 +795,18 @@ lbool hilbert_basis::saturate() {
init_basis();
m_current_ineq = 0;
while (!m_cancel && m_current_ineq < m_ineqs.size()) {
IF_VERBOSE(1, { statistics st; collect_statistics(st); st.display(verbose_stream()); });
select_inequality();
stopwatch sw;
sw.start();
lbool r = saturate(m_ineqs[m_current_ineq], m_iseq[m_current_ineq]);
IF_VERBOSE(1,
{ statistics st;
collect_statistics(st);
st.display(verbose_stream());
sw.stop();
verbose_stream() << "time: " << sw.get_seconds() << "\n";
});
++m_stats.m_num_saturations;
if (r != l_true) {
return r;