3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

fix bug found by Ethan: fresh values for bit-vectors loops if the domain of bit-vectors is truly small

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-09-13 15:30:56 -07:00
parent 10e203da43
commit 419f99c329
4 changed files with 18 additions and 5 deletions

View file

@ -84,7 +84,8 @@ class datatype_decl {
ptr_vector<constructor_decl> m_constructors;
public:
datatype_decl(const symbol & n, unsigned num_constructors, constructor_decl * const * constructors):
m_name(n), m_constructors(num_constructors, constructors) {}
m_name(n), m_constructors(num_constructors, constructors) {
}
~datatype_decl() {
std::for_each(m_constructors.begin(), m_constructors.end(), delete_proc<constructor_decl>());
}

View file

@ -212,8 +212,6 @@ namespace pdr {
// partition inequalities into variable disjoint sets.
void partition_ineqs() {
m_roots.reset();
m_size.reset();
m_reps.reset();
m_his.reset();
++m_time;

View file

@ -180,10 +180,24 @@ public:
value_set * set = get_value_set(s);
bool is_new = false;
expr * result = 0;
sort_info* s_info = s->get_info();
sort_size const* sz = s_info?&s_info->get_num_elements():0;
bool has_max = false;
Number max_size;
if (sz && sz->is_finite()) {
if (sz->size() < UINT_MAX) {
unsigned usz = static_cast<unsigned>(sz->size());
max_size = Number(usz);
has_max = true;
}
}
Number & next = set->m_next;
while (!is_new) {
result = mk_value(next, s, is_new);
next++;
if (has_max && next >= max_size) {
return 0;
}
}
SASSERT(result != 0);
return result;

View file

@ -105,8 +105,8 @@ static void test2(char const *ex) {
names.push_back(vars[i]->get_decl()->get_name());
sorts.push_back(m.get_sort(vars[i].get()));
}
expr_abstract(m, 0, 3, bound.c_ptr(), fml, fml2);
fml2 = m.mk_exists(3, sorts.c_ptr(), names.c_ptr(), fml2);
expr_abstract(m, 0, bound.size(), bound.c_ptr(), fml, fml2);
fml2 = m.mk_exists(boud.size(), sorts.c_ptr(), names.c_ptr(), fml2);
qe::expr_quant_elim qe(m, params);
expr_ref pr1 = qe::arith_project(*md, vars, lits);
qe(m.mk_true(), fml2, pr2);