Skip to content

Commit

Permalink
fix bug found by Ethan: fresh values for bit-vectors loops if the dom…
Browse files Browse the repository at this point in the history
…ain of bit-vectors is truly small

Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
NikolajBjorner committed Sep 13, 2013
1 parent 10e203d commit 419f99c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/ast/datatype_decl_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>());
}
Expand Down
2 changes: 0 additions & 2 deletions src/muz/pdr/pdr_farkas_learner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions src/smt/proto_model/value_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,24 @@ class simple_factory : public value_factory {
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;
Expand Down
4 changes: 2 additions & 2 deletions src/test/qe_arith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 419f99c

Please sign in to comment.