3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

add array selects to basic ackerman reduction improves performance significantly for #2525 as it now uses the SAT solver core instead of SMT core

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-09-01 12:17:10 -07:00
parent 7823117776
commit 000e485794
25 changed files with 706 additions and 572 deletions

View file

@ -184,6 +184,13 @@ public:
return m_manager.mk_app(m_fid, OP_STORE, 0, nullptr, num_args, args);
}
app * mk_store(expr_ref_vector const& args) {
return mk_store(args.size(), args.c_ptr());
}
app * mk_store(ptr_vector<expr> const& args) {
return mk_store(args.size(), args.c_ptr());
}
app * mk_select(unsigned num_args, expr * const * args) {
return m_manager.mk_app(m_fid, OP_SELECT, 0, nullptr, num_args, args);
}

View file

@ -1940,6 +1940,14 @@ public:
return mk_const(mk_fresh_func_decl(prefix, 0, nullptr, s, skolem));
}
app * mk_fresh_const(std::string const& prefix, sort * s, bool skolem = true) {
return mk_fresh_const(prefix.c_str(), s, skolem);
}
app * mk_fresh_const(symbol const& prefix, sort * s, bool skolem = true) {
return mk_fresh_const(prefix.str().c_str(), s, skolem);
}
symbol mk_fresh_var_name(char const * prefix = nullptr);
var * mk_var(unsigned idx, sort * ty);

View file

@ -124,7 +124,7 @@ struct enum2bv_rewriter::imp {
// create a fresh variable, add bounds constraints for it.
unsigned nc = m_dt.get_datatype_num_constructors(s);
result = m.mk_fresh_const(f->get_name().str().c_str(), m_bv.mk_sort(bv_size));
result = m.mk_fresh_const(f->get_name(), m_bv.mk_sort(bv_size));
f_fresh = to_app(result)->get_decl();
if (!is_power_of_two(nc) || nc == 1) {
m_imp.m_bounds.push_back(m_bv.mk_ule(result, m_bv.mk_numeral(nc-1, bv_size)));