mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 01:24:08 +00:00
call it data instead of c_ptr for approaching C++11 std::vector convention.
This commit is contained in:
parent
524dcd35f9
commit
4a6083836a
|
@ -27,7 +27,7 @@ public:
|
||||||
m_names.push_back(symbol(name));
|
m_names.push_back(symbol(name));
|
||||||
}
|
}
|
||||||
unsigned size() const { return m_fmls.size(); }
|
unsigned size() const { return m_fmls.size(); }
|
||||||
expr*const* c_ptr() const { return m_fmls.c_ptr(); }
|
expr*const* data() const { return m_fmls.data(); }
|
||||||
expr* operator[](unsigned i) { return m_fmls[i].get(); }
|
expr* operator[](unsigned i) { return m_fmls[i].get(); }
|
||||||
symbol const& name(unsigned i) { return m_names[i]; }
|
symbol const& name(unsigned i) { return m_names[i]; }
|
||||||
void set_has_conjecture() {
|
void set_has_conjecture() {
|
||||||
|
|
|
@ -150,7 +150,7 @@ void ackr_model_converter::add_entry(model_evaluator & evaluator,
|
||||||
args.push_back(evaluator(info->abstract(arg)));
|
args.push_back(evaluator(info->abstract(arg)));
|
||||||
}
|
}
|
||||||
args.push_back(value);
|
args.push_back(value);
|
||||||
e = autil.mk_store(args.size(), args.c_ptr());
|
e = autil.mk_store(args.size(), args.data());
|
||||||
}
|
}
|
||||||
array_interpretations.insert(A, e);
|
array_interpretations.insert(A, e);
|
||||||
}
|
}
|
||||||
|
@ -175,14 +175,14 @@ void ackr_model_converter::add_entry(model_evaluator & evaluator,
|
||||||
for (expr* arg : *term) {
|
for (expr* arg : *term) {
|
||||||
args.push_back(evaluator(info->abstract(arg)));
|
args.push_back(evaluator(info->abstract(arg)));
|
||||||
}
|
}
|
||||||
if (fi->get_entry(args.c_ptr()) == nullptr) {
|
if (fi->get_entry(args.data()) == nullptr) {
|
||||||
TRACE("ackermannize",
|
TRACE("ackermannize",
|
||||||
tout << mk_ismt2_pp(declaration, m) << " args: " << std::endl;
|
tout << mk_ismt2_pp(declaration, m) << " args: " << std::endl;
|
||||||
for (expr* arg : args) {
|
for (expr* arg : args) {
|
||||||
tout << mk_ismt2_pp(arg, m) << std::endl;
|
tout << mk_ismt2_pp(arg, m) << std::endl;
|
||||||
}
|
}
|
||||||
tout << " -> " << mk_ismt2_pp(value, m) << "\n"; );
|
tout << " -> " << mk_ismt2_pp(value, m) << "\n"; );
|
||||||
fi->insert_new_entry(args.c_ptr(), value);
|
fi->insert_new_entry(args.data(), value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TRACE("ackermannize", tout << "entry already present\n";);
|
TRACE("ackermannize", tout << "entry already present\n";);
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
for (unsigned i = 0; i < m_abstr_model->get_num_uninterpreted_sorts(); i++) {
|
for (unsigned i = 0; i < m_abstr_model->get_num_uninterpreted_sorts(); i++) {
|
||||||
sort * const s = m_abstr_model->get_uninterpreted_sort(i);
|
sort * const s = m_abstr_model->get_uninterpreted_sort(i);
|
||||||
ptr_vector<expr> u = m_abstr_model->get_universe(s);
|
ptr_vector<expr> u = m_abstr_model->get_universe(s);
|
||||||
destination->register_usort(s, u.size(), u.c_ptr());
|
destination->register_usort(s, u.size(), u.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < m_abstr_model->get_num_functions(); i++) {
|
for (unsigned i = 0; i < m_abstr_model->get_num_functions(); i++) {
|
||||||
|
@ -213,7 +213,7 @@ private:
|
||||||
}
|
}
|
||||||
// handle functions
|
// handle functions
|
||||||
if (m_ackr_helper.is_uninterp_fn(a)) { // handle uninterpreted
|
if (m_ackr_helper.is_uninterp_fn(a)) { // handle uninterpreted
|
||||||
app_ref key(m.mk_app(a->get_decl(), values.c_ptr()), m);
|
app_ref key(m.mk_app(a->get_decl(), values.data()), m);
|
||||||
if (!make_value_uninterpreted_function(a, key.get(), result)) {
|
if (!make_value_uninterpreted_function(a, key.get(), result)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ private:
|
||||||
func_decl * const fd = a->get_decl();
|
func_decl * const fd = a->get_decl();
|
||||||
const family_id fid = fd->get_family_id();
|
const family_id fid = fd->get_family_id();
|
||||||
expr_ref term(m);
|
expr_ref term(m);
|
||||||
term = m.mk_app(a->get_decl(), num, values.c_ptr());
|
term = m.mk_app(a->get_decl(), num, values.data());
|
||||||
m_evaluator->operator() (term, result);
|
m_evaluator->operator() (term, result);
|
||||||
TRACE("model_constructor",
|
TRACE("model_constructor",
|
||||||
tout << "eval(\n" << mk_ismt2_pp(term.get(), m, 2) << "\n->"
|
tout << "eval(\n" << mk_ismt2_pp(term.get(), m, 2) << "\n->"
|
||||||
|
@ -329,11 +329,11 @@ private:
|
||||||
if (s_fid == m_bv_rw.get_fid())
|
if (s_fid == m_bv_rw.get_fid())
|
||||||
m_bv_rw.mk_eq_core(values.get(0), values.get(1), result);
|
m_bv_rw.mk_eq_core(values.get(0), values.get(1), result);
|
||||||
} else {
|
} else {
|
||||||
m_b_rw.mk_app_core(fd, num, values.c_ptr(), result);
|
m_b_rw.mk_app_core(fd, num, values.data(), result);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fid == m_bv_rw.get_fid()) {
|
if (fid == m_bv_rw.get_fid()) {
|
||||||
m_bv_rw.mk_app_core(fd, num, values.c_ptr(), result);
|
m_bv_rw.mk_app_core(fd, num, values.data(), result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern "C" {
|
||||||
vector<parameter> params;
|
vector<parameter> params;
|
||||||
for (unsigned i = 0; i < n; ++i) params.push_back(parameter(to_sort(domain[i])));
|
for (unsigned i = 0; i < n; ++i) params.push_back(parameter(to_sort(domain[i])));
|
||||||
params.push_back(parameter(to_sort(range)));
|
params.push_back(parameter(to_sort(range)));
|
||||||
sort * ty = mk_c(c)->m().mk_sort(mk_c(c)->get_array_fid(), ARRAY_SORT, params.size(), params.c_ptr());
|
sort * ty = mk_c(c)->m().mk_sort(mk_c(c)->get_array_fid(), ARRAY_SORT, params.size(), params.data());
|
||||||
mk_c(c)->save_ast_trail(ty);
|
mk_c(c)->save_ast_trail(ty);
|
||||||
RETURN_Z3(of_sort(ty));
|
RETURN_Z3(of_sort(ty));
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
|
@ -94,8 +94,8 @@ extern "C" {
|
||||||
args.push_back(to_expr(idxs[i]));
|
args.push_back(to_expr(idxs[i]));
|
||||||
domain.push_back(to_expr(idxs[i])->get_sort());
|
domain.push_back(to_expr(idxs[i])->get_sort());
|
||||||
}
|
}
|
||||||
func_decl * d = m.mk_func_decl(mk_c(c)->get_array_fid(), OP_SELECT, 2, a_ty->get_parameters(), domain.size(), domain.c_ptr());
|
func_decl * d = m.mk_func_decl(mk_c(c)->get_array_fid(), OP_SELECT, 2, a_ty->get_parameters(), domain.size(), domain.data());
|
||||||
app * r = m.mk_app(d, args.size(), args.c_ptr());
|
app * r = m.mk_app(d, args.size(), args.data());
|
||||||
mk_c(c)->save_ast_trail(r);
|
mk_c(c)->save_ast_trail(r);
|
||||||
check_sorts(c, r);
|
check_sorts(c, r);
|
||||||
RETURN_Z3(of_ast(r));
|
RETURN_Z3(of_ast(r));
|
||||||
|
@ -154,8 +154,8 @@ extern "C" {
|
||||||
}
|
}
|
||||||
args.push_back(_v);
|
args.push_back(_v);
|
||||||
domain.push_back(v_ty);
|
domain.push_back(v_ty);
|
||||||
func_decl * d = m.mk_func_decl(mk_c(c)->get_array_fid(), OP_STORE, 2, a_ty->get_parameters(), domain.size(), domain.c_ptr());
|
func_decl * d = m.mk_func_decl(mk_c(c)->get_array_fid(), OP_STORE, 2, a_ty->get_parameters(), domain.size(), domain.data());
|
||||||
app * r = m.mk_app(d, args.size(), args.c_ptr());
|
app * r = m.mk_app(d, args.size(), args.data());
|
||||||
mk_c(c)->save_ast_trail(r);
|
mk_c(c)->save_ast_trail(r);
|
||||||
check_sorts(c, r);
|
check_sorts(c, r);
|
||||||
RETURN_Z3(of_ast(r));
|
RETURN_Z3(of_ast(r));
|
||||||
|
@ -180,7 +180,7 @@ extern "C" {
|
||||||
domain.push_back(_args[i]->get_sort());
|
domain.push_back(_args[i]->get_sort());
|
||||||
}
|
}
|
||||||
parameter param(_f);
|
parameter param(_f);
|
||||||
func_decl * d = m.mk_func_decl(mk_c(c)->get_array_fid(), OP_ARRAY_MAP, 1, ¶m, n, domain.c_ptr());
|
func_decl * d = m.mk_func_decl(mk_c(c)->get_array_fid(), OP_ARRAY_MAP, 1, ¶m, n, domain.data());
|
||||||
app* r = m.mk_app(d, n, _args);
|
app* r = m.mk_app(d, n, _args);
|
||||||
mk_c(c)->save_ast_trail(r);
|
mk_c(c)->save_ast_trail(r);
|
||||||
check_sorts(c, r);
|
check_sorts(c, r);
|
||||||
|
|
|
@ -148,7 +148,7 @@ extern "C" {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expr_abstract(m, 0, n, _args.c_ptr(), to_expr(body), abs_body);
|
expr_abstract(m, 0, n, _args.data(), to_expr(body), abs_body);
|
||||||
recfun::promise_def pd = p.get_promise_def(d);
|
recfun::promise_def pd = p.get_promise_def(d);
|
||||||
if (!pd.get_def()) {
|
if (!pd.get_def()) {
|
||||||
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
|
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
|
||||||
|
@ -159,7 +159,7 @@ extern "C" {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
recfun_replace replace(m);
|
recfun_replace replace(m);
|
||||||
p.set_definition(replace, pd, n, _vars.c_ptr(), abs_body);
|
p.set_definition(replace, pd, n, _vars.data(), abs_body);
|
||||||
Z3_CATCH;
|
Z3_CATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ extern "C" {
|
||||||
arg_list.push_back(to_expr(args[i]));
|
arg_list.push_back(to_expr(args[i]));
|
||||||
}
|
}
|
||||||
func_decl* _d = reinterpret_cast<func_decl*>(d);
|
func_decl* _d = reinterpret_cast<func_decl*>(d);
|
||||||
app* a = mk_c(c)->m().mk_app(_d, num_args, arg_list.c_ptr());
|
app* a = mk_c(c)->m().mk_app(_d, num_args, arg_list.data());
|
||||||
mk_c(c)->save_ast_trail(a);
|
mk_c(c)->save_ast_trail(a);
|
||||||
check_sorts(c, a);
|
check_sorts(c, a);
|
||||||
RETURN_Z3(of_ast(a));
|
RETURN_Z3(of_ast(a));
|
||||||
|
|
|
@ -449,7 +449,7 @@ extern "C" {
|
||||||
for (unsigned i = 0; i < num_relations; ++i) {
|
for (unsigned i = 0; i < num_relations; ++i) {
|
||||||
kinds.push_back(to_symbol(relation_kinds[i]));
|
kinds.push_back(to_symbol(relation_kinds[i]));
|
||||||
}
|
}
|
||||||
to_fixedpoint_ref(d)->ctx().set_predicate_representation(to_func_decl(f), num_relations, kinds.c_ptr());
|
to_fixedpoint_ref(d)->ctx().set_predicate_representation(to_func_decl(f), num_relations, kinds.data());
|
||||||
Z3_CATCH;
|
Z3_CATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ extern "C" {
|
||||||
acc.push_back(mk_accessor_decl(m, to_symbol(field_names[i]), type_ref(to_sort(field_sorts[i]))));
|
acc.push_back(mk_accessor_decl(m, to_symbol(field_names[i]), type_ref(to_sort(field_sorts[i]))));
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor_decl* constrs[1] = { mk_constructor_decl(to_symbol(name), recognizer, acc.size(), acc.c_ptr()) };
|
constructor_decl* constrs[1] = { mk_constructor_decl(to_symbol(name), recognizer, acc.size(), acc.data()) };
|
||||||
|
|
||||||
{
|
{
|
||||||
datatype_decl * dt = mk_datatype_decl(dt_util, to_symbol(name), 0, nullptr, 1, constrs);
|
datatype_decl * dt = mk_datatype_decl(dt_util, to_symbol(name), 0, nullptr, 1, constrs);
|
||||||
|
@ -113,7 +113,7 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
datatype_decl * dt = mk_datatype_decl(dt_util, to_symbol(name), 0, nullptr, n, constrs.c_ptr());
|
datatype_decl * dt = mk_datatype_decl(dt_util, to_symbol(name), 0, nullptr, n, constrs.data());
|
||||||
bool is_ok = mk_c(c)->get_dt_plugin()->mk_datatypes(1, &dt, 0, nullptr, sorts);
|
bool is_ok = mk_c(c)->get_dt_plugin()->mk_datatypes(1, &dt, 0, nullptr, sorts);
|
||||||
del_datatype_decl(dt);
|
del_datatype_decl(dt);
|
||||||
|
|
||||||
|
@ -302,9 +302,9 @@ extern "C" {
|
||||||
acc.push_back(mk_accessor_decl(m, cn->m_field_names[j], type_ref(cn->m_sort_refs[j])));
|
acc.push_back(mk_accessor_decl(m, cn->m_field_names[j], type_ref(cn->m_sort_refs[j])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
constrs.push_back(mk_constructor_decl(cn->m_name, cn->m_tester, acc.size(), acc.c_ptr()));
|
constrs.push_back(mk_constructor_decl(cn->m_name, cn->m_tester, acc.size(), acc.data()));
|
||||||
}
|
}
|
||||||
return mk_datatype_decl(dt_util, to_symbol(name), 0, nullptr, num_constructors, constrs.c_ptr());
|
return mk_datatype_decl(dt_util, to_symbol(name), 0, nullptr, num_constructors, constrs.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_sort Z3_API Z3_mk_datatype(Z3_context c,
|
Z3_sort Z3_API Z3_mk_datatype(Z3_context c,
|
||||||
|
@ -380,11 +380,11 @@ extern "C" {
|
||||||
ptr_vector<datatype_decl> datas;
|
ptr_vector<datatype_decl> datas;
|
||||||
for (unsigned i = 0; i < num_sorts; ++i) {
|
for (unsigned i = 0; i < num_sorts; ++i) {
|
||||||
constructor_list* cl = reinterpret_cast<constructor_list*>(constructor_lists[i]);
|
constructor_list* cl = reinterpret_cast<constructor_list*>(constructor_lists[i]);
|
||||||
datas.push_back(mk_datatype_decl(c, sort_names[i], cl->size(), reinterpret_cast<Z3_constructor*>(cl->c_ptr())));
|
datas.push_back(mk_datatype_decl(c, sort_names[i], cl->size(), reinterpret_cast<Z3_constructor*>(cl->data())));
|
||||||
}
|
}
|
||||||
sort_ref_vector _sorts(m);
|
sort_ref_vector _sorts(m);
|
||||||
bool ok = mk_c(c)->get_dt_plugin()->mk_datatypes(datas.size(), datas.c_ptr(), 0, nullptr, _sorts);
|
bool ok = mk_c(c)->get_dt_plugin()->mk_datatypes(datas.size(), datas.data(), 0, nullptr, _sorts);
|
||||||
del_datatype_decls(datas.size(), datas.c_ptr());
|
del_datatype_decls(datas.size(), datas.data());
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
|
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
|
||||||
|
|
|
@ -367,7 +367,7 @@ extern "C" {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check sorts of value
|
// check sorts of value
|
||||||
expr* const* _args = (expr* const*) to_ast_vector_ref(args).c_ptr();
|
expr* const* _args = (expr* const*) to_ast_vector_ref(args).data();
|
||||||
_fi->insert_entry(_args, _value);
|
_fi->insert_entry(_args, _value);
|
||||||
Z3_CATCH;
|
Z3_CATCH;
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,7 +280,7 @@ extern "C" {
|
||||||
to_optimize_ptr(o)->get_lower(idx, es);
|
to_optimize_ptr(o)->get_lower(idx, es);
|
||||||
Z3_ast_vector_ref * v = alloc(Z3_ast_vector_ref, *mk_c(c), mk_c(c)->m());
|
Z3_ast_vector_ref * v = alloc(Z3_ast_vector_ref, *mk_c(c), mk_c(c)->m());
|
||||||
mk_c(c)->save_object(v);
|
mk_c(c)->save_object(v);
|
||||||
v->m_ast_vector.append(es.size(), (ast*const*)es.c_ptr());
|
v->m_ast_vector.append(es.size(), (ast*const*)es.data());
|
||||||
RETURN_Z3(of_ast_vector(v));
|
RETURN_Z3(of_ast_vector(v));
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,7 @@ extern "C" {
|
||||||
to_optimize_ptr(o)->get_upper(idx, es);
|
to_optimize_ptr(o)->get_upper(idx, es);
|
||||||
Z3_ast_vector_ref * v = alloc(Z3_ast_vector_ref, *mk_c(c), mk_c(c)->m());
|
Z3_ast_vector_ref * v = alloc(Z3_ast_vector_ref, *mk_c(c), mk_c(c)->m());
|
||||||
mk_c(c)->save_object(v);
|
mk_c(c)->save_object(v);
|
||||||
v->m_ast_vector.append(es.size(), (ast*const*)es.c_ptr());
|
v->m_ast_vector.append(es.size(), (ast*const*)es.data());
|
||||||
RETURN_Z3(of_ast_vector(v));
|
RETURN_Z3(of_ast_vector(v));
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ extern "C" {
|
||||||
for (unsigned i = 0; i < num_args; ++i) {
|
for (unsigned i = 0; i < num_args; ++i) {
|
||||||
coeffs.push_back(rational(_coeffs[i]));
|
coeffs.push_back(rational(_coeffs[i]));
|
||||||
}
|
}
|
||||||
ast* a = util.mk_le(num_args, coeffs.c_ptr(), to_exprs(num_args, args), rational(k));
|
ast* a = util.mk_le(num_args, coeffs.data(), to_exprs(num_args, args), rational(k));
|
||||||
mk_c(c)->save_ast_trail(a);
|
mk_c(c)->save_ast_trail(a);
|
||||||
check_sorts(c, a);
|
check_sorts(c, a);
|
||||||
RETURN_Z3(of_ast(a));
|
RETURN_Z3(of_ast(a));
|
||||||
|
@ -80,7 +80,7 @@ extern "C" {
|
||||||
for (unsigned i = 0; i < num_args; ++i) {
|
for (unsigned i = 0; i < num_args; ++i) {
|
||||||
coeffs.push_back(rational(_coeffs[i]));
|
coeffs.push_back(rational(_coeffs[i]));
|
||||||
}
|
}
|
||||||
ast* a = util.mk_ge(num_args, coeffs.c_ptr(), to_exprs(num_args, args), rational(k));
|
ast* a = util.mk_ge(num_args, coeffs.data(), to_exprs(num_args, args), rational(k));
|
||||||
mk_c(c)->save_ast_trail(a);
|
mk_c(c)->save_ast_trail(a);
|
||||||
check_sorts(c, a);
|
check_sorts(c, a);
|
||||||
RETURN_Z3(of_ast(a));
|
RETURN_Z3(of_ast(a));
|
||||||
|
@ -98,7 +98,7 @@ extern "C" {
|
||||||
for (unsigned i = 0; i < num_args; ++i) {
|
for (unsigned i = 0; i < num_args; ++i) {
|
||||||
coeffs.push_back(rational(_coeffs[i]));
|
coeffs.push_back(rational(_coeffs[i]));
|
||||||
}
|
}
|
||||||
ast* a = util.mk_eq(num_args, coeffs.c_ptr(), to_exprs(num_args, args), rational(k));
|
ast* a = util.mk_eq(num_args, coeffs.data(), to_exprs(num_args, args), rational(k));
|
||||||
mk_c(c)->save_ast_trail(a);
|
mk_c(c)->save_ast_trail(a);
|
||||||
check_sorts(c, a);
|
check_sorts(c, a);
|
||||||
RETURN_Z3(of_ast(a));
|
RETURN_Z3(of_ast(a));
|
||||||
|
|
|
@ -88,7 +88,7 @@ extern "C" {
|
||||||
if (num_decls > 0) {
|
if (num_decls > 0) {
|
||||||
result = mk_c(c)->m().mk_quantifier(
|
result = mk_c(c)->m().mk_quantifier(
|
||||||
is_forall ? forall_k : exists_k,
|
is_forall ? forall_k : exists_k,
|
||||||
names.size(), ts, names.c_ptr(), to_expr(body),
|
names.size(), ts, names.data(), to_expr(body),
|
||||||
weight,
|
weight,
|
||||||
qid,
|
qid,
|
||||||
to_symbol(skolem_id),
|
to_symbol(skolem_id),
|
||||||
|
@ -160,7 +160,7 @@ extern "C" {
|
||||||
for (unsigned i = 0; i < num_decls; ++i) {
|
for (unsigned i = 0; i < num_decls; ++i) {
|
||||||
names.push_back(to_symbol(decl_names[i]));
|
names.push_back(to_symbol(decl_names[i]));
|
||||||
}
|
}
|
||||||
result = mk_c(c)->m().mk_lambda(names.size(), ts, names.c_ptr(), to_expr(body));
|
result = mk_c(c)->m().mk_lambda(names.size(), ts, names.data(), to_expr(body));
|
||||||
mk_c(c)->save_ast_trail(result.get());
|
mk_c(c)->save_ast_trail(result.get());
|
||||||
return of_ast(result.get());
|
return of_ast(result.get());
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
|
@ -188,9 +188,9 @@ extern "C" {
|
||||||
_vars.push_back(a->get_sort());
|
_vars.push_back(a->get_sort());
|
||||||
}
|
}
|
||||||
expr_ref result(mk_c(c)->m());
|
expr_ref result(mk_c(c)->m());
|
||||||
expr_abstract(mk_c(c)->m(), 0, num_decls, _args.c_ptr(), to_expr(body), result);
|
expr_abstract(mk_c(c)->m(), 0, num_decls, _args.data(), to_expr(body), result);
|
||||||
|
|
||||||
result = mk_c(c)->m().mk_lambda(_vars.size(), _vars.c_ptr(), _names.c_ptr(), result);
|
result = mk_c(c)->m().mk_lambda(_vars.size(), _vars.data(), _names.data(), result);
|
||||||
mk_c(c)->save_ast_trail(result.get());
|
mk_c(c)->save_ast_trail(result.get());
|
||||||
return of_ast(result.get());
|
return of_ast(result.get());
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
|
@ -246,7 +246,7 @@ extern "C" {
|
||||||
expr_ref result(mk_c(c)->m());
|
expr_ref result(mk_c(c)->m());
|
||||||
app* pat = to_pattern(patterns[i]);
|
app* pat = to_pattern(patterns[i]);
|
||||||
SASSERT(mk_c(c)->m().is_pattern(pat));
|
SASSERT(mk_c(c)->m().is_pattern(pat));
|
||||||
expr_abstract(mk_c(c)->m(), 0, num_bound, bound_asts.c_ptr(), pat, result);
|
expr_abstract(mk_c(c)->m(), 0, num_bound, bound_asts.data(), pat, result);
|
||||||
SASSERT(result.get()->get_kind() == AST_APP);
|
SASSERT(result.get()->get_kind() == AST_APP);
|
||||||
pinned.push_back(result.get());
|
pinned.push_back(result.get());
|
||||||
SASSERT(mk_c(c)->m().is_pattern(result.get()));
|
SASSERT(mk_c(c)->m().is_pattern(result.get()));
|
||||||
|
@ -260,20 +260,20 @@ extern "C" {
|
||||||
RETURN_Z3(nullptr);
|
RETURN_Z3(nullptr);
|
||||||
}
|
}
|
||||||
app* pat = to_app(to_expr(no_patterns[i]));
|
app* pat = to_app(to_expr(no_patterns[i]));
|
||||||
expr_abstract(mk_c(c)->m(), 0, num_bound, bound_asts.c_ptr(), pat, result);
|
expr_abstract(mk_c(c)->m(), 0, num_bound, bound_asts.data(), pat, result);
|
||||||
SASSERT(result.get()->get_kind() == AST_APP);
|
SASSERT(result.get()->get_kind() == AST_APP);
|
||||||
pinned.push_back(result.get());
|
pinned.push_back(result.get());
|
||||||
_no_patterns.push_back(of_ast(result.get()));
|
_no_patterns.push_back(of_ast(result.get()));
|
||||||
}
|
}
|
||||||
expr_ref abs_body(mk_c(c)->m());
|
expr_ref abs_body(mk_c(c)->m());
|
||||||
expr_abstract(mk_c(c)->m(), 0, num_bound, bound_asts.c_ptr(), to_expr(body), abs_body);
|
expr_abstract(mk_c(c)->m(), 0, num_bound, bound_asts.data(), to_expr(body), abs_body);
|
||||||
|
|
||||||
Z3_ast result = mk_quantifier_ex_core(c, is_forall, weight,
|
Z3_ast result = mk_quantifier_ex_core(c, is_forall, weight,
|
||||||
quantifier_id,
|
quantifier_id,
|
||||||
skolem_id,
|
skolem_id,
|
||||||
num_patterns, _patterns.c_ptr(),
|
num_patterns, _patterns.data(),
|
||||||
num_no_patterns, _no_patterns.c_ptr(),
|
num_no_patterns, _no_patterns.data(),
|
||||||
names.size(), types.c_ptr(), names.c_ptr(),
|
names.size(), types.data(), names.data(),
|
||||||
of_ast(abs_body.get()));
|
of_ast(abs_body.get()));
|
||||||
RETURN_Z3(result);
|
RETURN_Z3(result);
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
|
|
|
@ -34,7 +34,7 @@ static void reset_rcf_cancel(Z3_context c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Z3_rcf_num from_rcnumeral(rcnumeral a) {
|
static Z3_rcf_num from_rcnumeral(rcnumeral a) {
|
||||||
return reinterpret_cast<Z3_rcf_num>(a.c_ptr());
|
return reinterpret_cast<Z3_rcf_num>(a.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
static rcnumeral to_rcnumeral(Z3_rcf_num a) {
|
static rcnumeral to_rcnumeral(Z3_rcf_num a) {
|
||||||
|
@ -128,7 +128,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
av.shrink(rz);
|
av.shrink(rz);
|
||||||
rcnumeral_vector rs;
|
rcnumeral_vector rs;
|
||||||
rcfm(c).isolate_roots(av.size(), av.c_ptr(), rs);
|
rcfm(c).isolate_roots(av.size(), av.data(), rs);
|
||||||
unsigned num_roots = rs.size();
|
unsigned num_roots = rs.size();
|
||||||
for (unsigned i = 0; i < num_roots; i++) {
|
for (unsigned i = 0; i < num_roots; i++) {
|
||||||
roots[i] = from_rcnumeral(rs[i]);
|
roots[i] = from_rcnumeral(rs[i]);
|
||||||
|
|
|
@ -62,7 +62,7 @@ extern "C" {
|
||||||
RESET_ERROR_CODE();
|
RESET_ERROR_CODE();
|
||||||
unsigned_vector chs;
|
unsigned_vector chs;
|
||||||
for (unsigned i = 0; i < sz; ++i) chs.push_back((unsigned char)str[i]);
|
for (unsigned i = 0; i < sz; ++i) chs.push_back((unsigned char)str[i]);
|
||||||
zstring s(sz, chs.c_ptr());
|
zstring s(sz, chs.data());
|
||||||
app* a = mk_c(c)->sutil().str.mk_string(s);
|
app* a = mk_c(c)->sutil().str.mk_string(s);
|
||||||
mk_c(c)->save_ast_trail(a);
|
mk_c(c)->save_ast_trail(a);
|
||||||
RETURN_Z3(of_ast(a));
|
RETURN_Z3(of_ast(a));
|
||||||
|
@ -188,7 +188,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*length = buffer.size();
|
*length = buffer.size();
|
||||||
return buffer.c_ptr();
|
return buffer.data();
|
||||||
Z3_CATCH_RETURN("");
|
Z3_CATCH_RETURN("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ extern "C" {
|
||||||
for (unsigned i = 0; i < num; i++) {
|
for (unsigned i = 0; i < num; i++) {
|
||||||
_ts.push_back(to_tactic_ref(ts[i]));
|
_ts.push_back(to_tactic_ref(ts[i]));
|
||||||
}
|
}
|
||||||
tactic * new_t = par(num, _ts.c_ptr());
|
tactic * new_t = par(num, _ts.data());
|
||||||
RETURN_TACTIC(new_t);
|
RETURN_TACTIC(new_t);
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -628,25 +628,25 @@ struct z3_replayer::imp {
|
||||||
unsigned * get_uint_array(unsigned pos) const {
|
unsigned * get_uint_array(unsigned pos) const {
|
||||||
check_arg(pos, UINT_ARRAY);
|
check_arg(pos, UINT_ARRAY);
|
||||||
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
||||||
return m_unsigned_arrays[idx].c_ptr();
|
return m_unsigned_arrays[idx].data();
|
||||||
}
|
}
|
||||||
|
|
||||||
int * get_int_array(unsigned pos) const {
|
int * get_int_array(unsigned pos) const {
|
||||||
check_arg(pos, INT_ARRAY);
|
check_arg(pos, INT_ARRAY);
|
||||||
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
||||||
return m_int_arrays[idx].c_ptr();
|
return m_int_arrays[idx].data();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool * get_bool_array(unsigned pos) const {
|
bool * get_bool_array(unsigned pos) const {
|
||||||
check_arg(pos, UINT_ARRAY);
|
check_arg(pos, UINT_ARRAY);
|
||||||
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
||||||
return reinterpret_cast<bool*>(m_unsigned_arrays[idx].c_ptr());
|
return reinterpret_cast<bool*>(m_unsigned_arrays[idx].data());
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_symbol * get_symbol_array(unsigned pos) const {
|
Z3_symbol * get_symbol_array(unsigned pos) const {
|
||||||
check_arg(pos, SYMBOL_ARRAY);
|
check_arg(pos, SYMBOL_ARRAY);
|
||||||
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
|
||||||
return m_sym_arrays[idx].c_ptr();
|
return m_sym_arrays[idx].data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ** get_obj_array(unsigned pos) const {
|
void ** get_obj_array(unsigned pos) const {
|
||||||
|
@ -655,7 +655,7 @@ struct z3_replayer::imp {
|
||||||
ptr_vector<void> const & v = m_obj_arrays[idx];
|
ptr_vector<void> const & v = m_obj_arrays[idx];
|
||||||
TRACE("z3_replayer_bug", tout << "pos: " << pos << ", idx: " << idx << " size(): " << v.size() << "\n";
|
TRACE("z3_replayer_bug", tout << "pos: " << pos << ", idx: " << idx << " size(): " << v.size() << "\n";
|
||||||
for (unsigned i = 0; i < v.size(); i++) tout << v[i] << " "; tout << "\n";);
|
for (unsigned i = 0; i < v.size(); i++) tout << v[i] << " "; tout << "\n";);
|
||||||
return v.c_ptr();
|
return v.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
int * get_int_addr(unsigned pos) {
|
int * get_int_addr(unsigned pos) {
|
||||||
|
|
|
@ -336,8 +336,8 @@ void arith_decl_plugin::finalize() {
|
||||||
DEC_REF(m_neg_root_decl);
|
DEC_REF(m_neg_root_decl);
|
||||||
DEC_REF(m_u_asin_decl);
|
DEC_REF(m_u_asin_decl);
|
||||||
DEC_REF(m_u_acos_decl);
|
DEC_REF(m_u_acos_decl);
|
||||||
m_manager->dec_array_ref(m_small_ints.size(), m_small_ints.c_ptr());
|
m_manager->dec_array_ref(m_small_ints.size(), m_small_ints.data());
|
||||||
m_manager->dec_array_ref(m_small_reals.size(), m_small_reals.c_ptr());
|
m_manager->dec_array_ref(m_small_reals.size(), m_small_reals.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
sort * arith_decl_plugin::mk_sort(decl_kind k, unsigned num_parameters, parameter const * parameters) {
|
sort * arith_decl_plugin::mk_sort(decl_kind k, unsigned num_parameters, parameter const * parameters) {
|
||||||
|
@ -762,7 +762,7 @@ algebraic_numbers::anum const & arith_util::to_irrational_algebraic_numeral(expr
|
||||||
}
|
}
|
||||||
|
|
||||||
expr_ref arith_util::mk_mul_simplify(expr_ref_vector const& args) {
|
expr_ref arith_util::mk_mul_simplify(expr_ref_vector const& args) {
|
||||||
return mk_mul_simplify(args.size(), args.c_ptr());
|
return mk_mul_simplify(args.size(), args.data());
|
||||||
|
|
||||||
}
|
}
|
||||||
expr_ref arith_util::mk_mul_simplify(unsigned sz, expr* const* args) {
|
expr_ref arith_util::mk_mul_simplify(unsigned sz, expr* const* args) {
|
||||||
|
@ -783,7 +783,7 @@ expr_ref arith_util::mk_mul_simplify(unsigned sz, expr* const* args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
expr_ref arith_util::mk_add_simplify(expr_ref_vector const& args) {
|
expr_ref arith_util::mk_add_simplify(expr_ref_vector const& args) {
|
||||||
return mk_add_simplify(args.size(), args.c_ptr());
|
return mk_add_simplify(args.size(), args.data());
|
||||||
|
|
||||||
}
|
}
|
||||||
expr_ref arith_util::mk_add_simplify(unsigned sz, expr* const* args) {
|
expr_ref arith_util::mk_add_simplify(unsigned sz, expr* const* args) {
|
||||||
|
|
|
@ -432,7 +432,7 @@ public:
|
||||||
app * mk_add(unsigned num_args, expr * const * args) const { return num_args == 1 && is_app(args[0]) ? to_app(args[0]) : m_manager.mk_app(arith_family_id, OP_ADD, num_args, args); }
|
app * mk_add(unsigned num_args, expr * const * args) const { return num_args == 1 && is_app(args[0]) ? to_app(args[0]) : m_manager.mk_app(arith_family_id, OP_ADD, num_args, args); }
|
||||||
app * mk_add(expr * arg1, expr * arg2) const { return m_manager.mk_app(arith_family_id, OP_ADD, arg1, arg2); }
|
app * mk_add(expr * arg1, expr * arg2) const { return m_manager.mk_app(arith_family_id, OP_ADD, arg1, arg2); }
|
||||||
app * mk_add(expr * arg1, expr * arg2, expr* arg3) const { return m_manager.mk_app(arith_family_id, OP_ADD, arg1, arg2, arg3); }
|
app * mk_add(expr * arg1, expr * arg2, expr* arg3) const { return m_manager.mk_app(arith_family_id, OP_ADD, arg1, arg2, arg3); }
|
||||||
app * mk_add(expr_ref_vector const& args) const { return mk_add(args.size(), args.c_ptr()); }
|
app * mk_add(expr_ref_vector const& args) const { return mk_add(args.size(), args.data()); }
|
||||||
|
|
||||||
app * mk_sub(expr * arg1, expr * arg2) const { return m_manager.mk_app(arith_family_id, OP_SUB, arg1, arg2); }
|
app * mk_sub(expr * arg1, expr * arg2) const { return m_manager.mk_app(arith_family_id, OP_SUB, arg1, arg2); }
|
||||||
app * mk_sub(unsigned num_args, expr * const * args) const { return m_manager.mk_app(arith_family_id, OP_SUB, num_args, args); }
|
app * mk_sub(unsigned num_args, expr * const * args) const { return m_manager.mk_app(arith_family_id, OP_SUB, num_args, args); }
|
||||||
|
|
|
@ -193,7 +193,7 @@ func_decl * array_decl_plugin::mk_map(func_decl* f, unsigned arity, sort* const*
|
||||||
parameters.push_back(domain[0]->get_parameter(i));
|
parameters.push_back(domain[0]->get_parameter(i));
|
||||||
}
|
}
|
||||||
parameters.push_back(parameter(f->get_range()));
|
parameters.push_back(parameter(f->get_range()));
|
||||||
sort* range = mk_sort(ARRAY_SORT, parameters.size(), parameters.c_ptr());
|
sort* range = mk_sort(ARRAY_SORT, parameters.size(), parameters.data());
|
||||||
parameter param(f);
|
parameter param(f);
|
||||||
func_decl_info info(m_family_id, OP_ARRAY_MAP, 1, ¶m);
|
func_decl_info info(m_family_id, OP_ARRAY_MAP, 1, ¶m);
|
||||||
//
|
//
|
||||||
|
@ -265,7 +265,7 @@ func_decl* array_decl_plugin::mk_select(unsigned arity, sort * const * domain) {
|
||||||
new_domain.push_back(to_sort(parameters[i].get_ast()));
|
new_domain.push_back(to_sort(parameters[i].get_ast()));
|
||||||
}
|
}
|
||||||
SASSERT(new_domain.size() == arity);
|
SASSERT(new_domain.size() == arity);
|
||||||
return m_manager->mk_func_decl(m_select_sym, arity, new_domain.c_ptr(), get_array_range(domain[0]),
|
return m_manager->mk_func_decl(m_select_sym, arity, new_domain.data(), get_array_range(domain[0]),
|
||||||
func_decl_info(m_family_id, OP_SELECT));
|
func_decl_info(m_family_id, OP_SELECT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ func_decl * array_decl_plugin::mk_store(unsigned arity, sort * const * domain) {
|
||||||
new_domain.push_back(to_sort(parameters[i].get_ast()));
|
new_domain.push_back(to_sort(parameters[i].get_ast()));
|
||||||
}
|
}
|
||||||
SASSERT(new_domain.size() == arity);
|
SASSERT(new_domain.size() == arity);
|
||||||
return m_manager->mk_func_decl(m_store_sym, arity, new_domain.c_ptr(), domain[0],
|
return m_manager->mk_func_decl(m_store_sym, arity, new_domain.data(), domain[0],
|
||||||
func_decl_info(m_family_id, OP_STORE));
|
func_decl_info(m_family_id, OP_STORE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ func_decl * array_decl_plugin::mk_as_array(func_decl * f) {
|
||||||
parameters.push_back(parameter(f->get_domain(i)));
|
parameters.push_back(parameter(f->get_domain(i)));
|
||||||
}
|
}
|
||||||
parameters.push_back(parameter(f->get_range()));
|
parameters.push_back(parameter(f->get_range()));
|
||||||
sort * s = mk_sort(ARRAY_SORT, parameters.size(), parameters.c_ptr());
|
sort * s = mk_sort(ARRAY_SORT, parameters.size(), parameters.data());
|
||||||
parameter param(f);
|
parameter param(f);
|
||||||
func_decl_info info(m_family_id, OP_AS_ARRAY, 1, ¶m);
|
func_decl_info info(m_family_id, OP_AS_ARRAY, 1, ¶m);
|
||||||
return m_manager->mk_const_decl(m_as_array_sym, s, info);
|
return m_manager->mk_const_decl(m_as_array_sym, s, info);
|
||||||
|
@ -679,7 +679,7 @@ sort * array_util::mk_array_sort(unsigned arity, sort* const* domain, sort* rang
|
||||||
params.push_back(parameter(domain[i]));
|
params.push_back(parameter(domain[i]));
|
||||||
}
|
}
|
||||||
params.push_back(parameter(range));
|
params.push_back(parameter(range));
|
||||||
return m_manager.mk_sort(m_fid, ARRAY_SORT, params.size(), params.c_ptr());
|
return m_manager.mk_sort(m_fid, ARRAY_SORT, params.size(), params.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
func_decl* array_util::mk_array_ext(sort *domain, unsigned i) {
|
func_decl* array_util::mk_array_ext(sort *domain, unsigned i) {
|
||||||
|
|
|
@ -187,11 +187,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_store(expr_ref_vector const& args) const {
|
app * mk_store(expr_ref_vector const& args) const {
|
||||||
return mk_store(args.size(), args.c_ptr());
|
return mk_store(args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_store(ptr_vector<expr> const& args) const {
|
app * mk_store(ptr_vector<expr> const& args) const {
|
||||||
return mk_store(args.size(), args.c_ptr());
|
return mk_store(args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_select(unsigned num_args, expr * const * args) const {
|
app * mk_select(unsigned num_args, expr * const * args) const {
|
||||||
|
@ -199,15 +199,15 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_select(ptr_vector<expr> const& args) const {
|
app * mk_select(ptr_vector<expr> const& args) const {
|
||||||
return mk_select(args.size(), args.c_ptr());
|
return mk_select(args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_select(ptr_buffer<expr> const& args) const {
|
app * mk_select(ptr_buffer<expr> const& args) const {
|
||||||
return mk_select(args.size(), args.c_ptr());
|
return mk_select(args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_select(expr_ref_vector const& args) const {
|
app * mk_select(expr_ref_vector const& args) const {
|
||||||
return mk_select(args.size(), args.c_ptr());
|
return mk_select(args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_map(func_decl * f, unsigned num_args, expr * const * args) {
|
app * mk_map(func_decl * f, unsigned num_args, expr * const * args) {
|
||||||
|
|
|
@ -187,7 +187,7 @@ decl_info::decl_info(family_id family_id, decl_kind k, unsigned num_parameters,
|
||||||
decl_info::decl_info(decl_info const& other) :
|
decl_info::decl_info(decl_info const& other) :
|
||||||
m_family_id(other.m_family_id),
|
m_family_id(other.m_family_id),
|
||||||
m_kind(other.m_kind),
|
m_kind(other.m_kind),
|
||||||
m_parameters(other.m_parameters.size(), other.m_parameters.c_ptr()),
|
m_parameters(other.m_parameters.size(), other.m_parameters.data()),
|
||||||
m_private_parameters(other.m_private_parameters) {
|
m_private_parameters(other.m_private_parameters) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -691,7 +691,7 @@ func_decl * decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, para
|
||||||
for (unsigned i = 0; i < num_args; i++) {
|
for (unsigned i = 0; i < num_args; i++) {
|
||||||
sorts.push_back(args[i]->get_sort());
|
sorts.push_back(args[i]->get_sort());
|
||||||
}
|
}
|
||||||
return mk_func_decl(k, num_parameters, parameters, num_args, sorts.c_ptr(), range);
|
return mk_func_decl(k, num_parameters, parameters, num_args, sorts.data(), range);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
@ -741,7 +741,7 @@ func_decl * basic_decl_plugin::mk_bool_op_decl(char const * name, basic_op_kind
|
||||||
info.set_commutative(comm);
|
info.set_commutative(comm);
|
||||||
info.set_idempotent(idempotent);
|
info.set_idempotent(idempotent);
|
||||||
info.set_chainable(chainable);
|
info.set_chainable(chainable);
|
||||||
func_decl * d = m_manager->mk_func_decl(symbol(name), num_args, domain.c_ptr(), m_bool_sort, info);
|
func_decl * d = m_manager->mk_func_decl(symbol(name), num_args, domain.data(), m_bool_sort, info);
|
||||||
m_manager->inc_ref(d);
|
m_manager->inc_ref(d);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
@ -763,7 +763,7 @@ func_decl * basic_decl_plugin::mk_proof_decl(
|
||||||
domain.push_back(m_proof_sort);
|
domain.push_back(m_proof_sort);
|
||||||
domain.push_back(m_bool_sort);
|
domain.push_back(m_bool_sort);
|
||||||
func_decl_info info(m_family_id, k, num_parameters, params);
|
func_decl_info info(m_family_id, k, num_parameters, params);
|
||||||
return m_manager->mk_func_decl(symbol(name), num_parents+1, domain.c_ptr(), m_proof_sort, info);
|
return m_manager->mk_func_decl(symbol(name), num_parents+1, domain.data(), m_proof_sort, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
func_decl * basic_decl_plugin::mk_proof_decl(char const * name, basic_op_kind k, unsigned num_parents, bool inc_ref) {
|
func_decl * basic_decl_plugin::mk_proof_decl(char const * name, basic_op_kind k, unsigned num_parents, bool inc_ref) {
|
||||||
|
@ -771,7 +771,7 @@ func_decl * basic_decl_plugin::mk_proof_decl(char const * name, basic_op_kind k,
|
||||||
for (unsigned i = 0; i < num_parents; i++)
|
for (unsigned i = 0; i < num_parents; i++)
|
||||||
domain.push_back(m_proof_sort);
|
domain.push_back(m_proof_sort);
|
||||||
domain.push_back(m_bool_sort);
|
domain.push_back(m_bool_sort);
|
||||||
func_decl * d = m_manager->mk_func_decl(symbol(name), num_parents+1, domain.c_ptr(), m_proof_sort, func_decl_info(m_family_id, k));
|
func_decl * d = m_manager->mk_func_decl(symbol(name), num_parents+1, domain.data(), m_proof_sort, func_decl_info(m_family_id, k));
|
||||||
if (inc_ref) m_manager->inc_ref(d);
|
if (inc_ref) m_manager->inc_ref(d);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
@ -780,7 +780,7 @@ func_decl * basic_decl_plugin::mk_compressed_proof_decl(char const * name, basic
|
||||||
ptr_buffer<sort> domain;
|
ptr_buffer<sort> domain;
|
||||||
for (unsigned i = 0; i < num_parents; i++)
|
for (unsigned i = 0; i < num_parents; i++)
|
||||||
domain.push_back(m_proof_sort);
|
domain.push_back(m_proof_sort);
|
||||||
func_decl * d = m_manager->mk_func_decl(symbol(name), num_parents, domain.c_ptr(), m_proof_sort, func_decl_info(m_family_id, k));
|
func_decl * d = m_manager->mk_func_decl(symbol(name), num_parents, domain.data(), m_proof_sort, func_decl_info(m_family_id, k));
|
||||||
m_manager->inc_ref(d);
|
m_manager->inc_ref(d);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
@ -1101,7 +1101,7 @@ func_decl * basic_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters
|
||||||
sort* srt = join(arity, domain);
|
sort* srt = join(arity, domain);
|
||||||
for (unsigned j = 0; j < arity; ++j)
|
for (unsigned j = 0; j < arity; ++j)
|
||||||
sorts.push_back(srt);
|
sorts.push_back(srt);
|
||||||
domain = sorts.c_ptr();
|
domain = sorts.data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m_manager->mk_func_decl(symbol("distinct"), arity, domain, m_bool_sort, info);
|
return m_manager->mk_func_decl(symbol("distinct"), arity, domain, m_bool_sort, info);
|
||||||
|
@ -1140,7 +1140,7 @@ func_decl * basic_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters
|
||||||
case PR_BIND: {
|
case PR_BIND: {
|
||||||
ptr_buffer<sort> sorts;
|
ptr_buffer<sort> sorts;
|
||||||
for (unsigned i = 0; i < num_args; ++i) sorts.push_back(args[i]->get_sort());
|
for (unsigned i = 0; i < num_args; ++i) sorts.push_back(args[i]->get_sort());
|
||||||
return mk_func_decl(k, num_parameters, parameters, num_args, sorts.c_ptr(), range);
|
return mk_func_decl(k, num_parameters, parameters, num_args, sorts.data(), range);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -2008,7 +2008,7 @@ sort * ast_manager::substitute(sort* s, unsigned n, sort * const * src, sort * c
|
||||||
if (!change) {
|
if (!change) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
decl_info dinfo(s->get_family_id(), s->get_decl_kind(), ps.size(), ps.c_ptr(), s->private_parameters());
|
decl_info dinfo(s->get_family_id(), s->get_decl_kind(), ps.size(), ps.data(), s->private_parameters());
|
||||||
sort_info sinfo(dinfo, s->get_num_elements());
|
sort_info sinfo(dinfo, s->get_num_elements());
|
||||||
return mk_sort(s->get_name(), &sinfo);
|
return mk_sort(s->get_name(), &sinfo);
|
||||||
}
|
}
|
||||||
|
@ -2172,9 +2172,9 @@ app * ast_manager::mk_app_core(func_decl * decl, unsigned num_args, expr * const
|
||||||
sort * d = decl->is_associative() ? decl->get_domain(0) : decl->get_domain(i);
|
sort * d = decl->is_associative() ? decl->get_domain(0) : decl->get_domain(i);
|
||||||
new_args.push_back(coerce_to(args[i], d));
|
new_args.push_back(coerce_to(args[i], d));
|
||||||
}
|
}
|
||||||
check_args(decl, num_args, new_args.c_ptr());
|
check_args(decl, num_args, new_args.data());
|
||||||
SASSERT(new_args.size() == num_args);
|
SASSERT(new_args.size() == num_args);
|
||||||
new_node = new (mem)app(decl, num_args, new_args.c_ptr());
|
new_node = new (mem)app(decl, num_args, new_args.data());
|
||||||
r = register_node(new_node);
|
r = register_node(new_node);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -2276,7 +2276,7 @@ app * ast_manager::mk_app(func_decl * decl, unsigned num_args, expr * const * ar
|
||||||
for (unsigned i = 1; i < num_args; i++) {
|
for (unsigned i = 1; i < num_args; i++) {
|
||||||
new_args.push_back(mk_app_core(decl, args[i-1], args[i]));
|
new_args.push_back(mk_app_core(decl, args[i-1], args[i]));
|
||||||
}
|
}
|
||||||
r = mk_and(new_args.size(), new_args.c_ptr());
|
r = mk_and(new_args.size(), new_args.data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (r == nullptr) {
|
if (r == nullptr) {
|
||||||
|
@ -2349,7 +2349,7 @@ app * ast_manager::mk_label(bool pos, unsigned num_names, symbol const * names,
|
||||||
p.push_back(parameter(static_cast<int>(pos)));
|
p.push_back(parameter(static_cast<int>(pos)));
|
||||||
for (unsigned i = 0; i < num_names; i++)
|
for (unsigned i = 0; i < num_names; i++)
|
||||||
p.push_back(parameter(names[i]));
|
p.push_back(parameter(names[i]));
|
||||||
return mk_app(label_family_id, OP_LABEL, p.size(), p.c_ptr(), 1, &n);
|
return mk_app(label_family_id, OP_LABEL, p.size(), p.data(), 1, &n);
|
||||||
}
|
}
|
||||||
|
|
||||||
app * ast_manager::mk_label(bool pos, symbol const & name, expr * n) {
|
app * ast_manager::mk_label(bool pos, symbol const & name, expr * n) {
|
||||||
|
@ -2372,7 +2372,7 @@ app * ast_manager::mk_label_lit(unsigned num_names, symbol const * names) {
|
||||||
buffer<parameter> p;
|
buffer<parameter> p;
|
||||||
for (unsigned i = 0; i < num_names; i++)
|
for (unsigned i = 0; i < num_names; i++)
|
||||||
p.push_back(parameter(names[i]));
|
p.push_back(parameter(names[i]));
|
||||||
return mk_app(label_family_id, OP_LABEL_LIT, p.size(), p.c_ptr(), 0, nullptr);
|
return mk_app(label_family_id, OP_LABEL_LIT, p.size(), p.data(), 0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
app * ast_manager::mk_label_lit(symbol const & name) {
|
app * ast_manager::mk_label_lit(symbol const & name) {
|
||||||
|
@ -2630,7 +2630,7 @@ app * ast_manager::mk_distinct_expanded(unsigned num_args, expr * const * args)
|
||||||
new_args.push_back(mk_not(mk_eq(a1, a2)));
|
new_args.push_back(mk_not(mk_eq(a1, a2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app * r = mk_and(new_args.size(), new_args.c_ptr());
|
app * r = mk_and(new_args.size(), new_args.data());
|
||||||
TRACE("distinct", tout << "expanded distinct:\n" << mk_pp(r, *this) << "\n";);
|
TRACE("distinct", tout << "expanded distinct:\n" << mk_pp(r, *this) << "\n";);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -2883,7 +2883,7 @@ proof * ast_manager::mk_transitivity(unsigned num_proofs, proof * const * proofs
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
args.append(num_proofs, (expr**) proofs);
|
args.append(num_proofs, (expr**) proofs);
|
||||||
args.push_back(mk_eq(n1,n2));
|
args.push_back(mk_eq(n1,n2));
|
||||||
return mk_app(basic_family_id, PR_TRANSITIVITY_STAR, args.size(), args.c_ptr());
|
return mk_app(basic_family_id, PR_TRANSITIVITY_STAR, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * ast_manager::mk_monotonicity(func_decl * R, app * f1, app * f2, unsigned num_proofs, proof * const * proofs) {
|
proof * ast_manager::mk_monotonicity(func_decl * R, app * f1, app * f2, unsigned num_proofs, proof * const * proofs) {
|
||||||
|
@ -2892,7 +2892,7 @@ proof * ast_manager::mk_monotonicity(func_decl * R, app * f1, app * f2, unsigned
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
args.append(num_proofs, (expr**) proofs);
|
args.append(num_proofs, (expr**) proofs);
|
||||||
args.push_back(mk_app(R, f1, f2));
|
args.push_back(mk_app(R, f1, f2));
|
||||||
proof* p = mk_app(basic_family_id, PR_MONOTONICITY, args.size(), args.c_ptr());
|
proof* p = mk_app(basic_family_id, PR_MONOTONICITY, args.size(), args.data());
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2954,7 +2954,7 @@ proof * ast_manager::mk_rewrite_star(expr * s, expr * t, unsigned num_proofs, pr
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
args.append(num_proofs, (expr**) proofs);
|
args.append(num_proofs, (expr**) proofs);
|
||||||
args.push_back(mk_eq(s, t));
|
args.push_back(mk_eq(s, t));
|
||||||
return mk_app(basic_family_id, PR_REWRITE_STAR, args.size(), args.c_ptr());
|
return mk_app(basic_family_id, PR_REWRITE_STAR, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * ast_manager::mk_pull_quant(expr * e, quantifier * q) {
|
proof * ast_manager::mk_pull_quant(expr * e, quantifier * q) {
|
||||||
|
@ -2989,7 +2989,7 @@ proof * ast_manager::mk_quant_inst(expr * not_q_or_i, unsigned num_bind, expr* c
|
||||||
params.push_back(parameter(binding[i]));
|
params.push_back(parameter(binding[i]));
|
||||||
SASSERT(params.back().is_ast());
|
SASSERT(params.back().is_ast());
|
||||||
}
|
}
|
||||||
return mk_app(basic_family_id, PR_QUANT_INST, num_bind, params.c_ptr(), 1, & not_q_or_i);
|
return mk_app(basic_family_id, PR_QUANT_INST, num_bind, params.data(), 1, & not_q_or_i);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ast_manager::is_quant_inst(expr const* e, expr*& not_q_or_i, ptr_vector<expr>& binding) const {
|
bool ast_manager::is_quant_inst(expr const* e, expr*& not_q_or_i, ptr_vector<expr>& binding) const {
|
||||||
|
@ -3082,13 +3082,13 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro
|
||||||
fact = new_lits[0];
|
fact = new_lits[0];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fact = mk_or(new_lits.size(), new_lits.c_ptr());
|
fact = mk_or(new_lits.size(), new_lits.data());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
args.push_back(fact);
|
args.push_back(fact);
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * pr = mk_app(basic_family_id, PR_UNIT_RESOLUTION, args.size(), args.c_ptr());
|
proof * pr = mk_app(basic_family_id, PR_UNIT_RESOLUTION, args.size(), args.data());
|
||||||
TRACE("unit_resolution", tout << "unit_resolution generating fact\n" << mk_ll_pp(pr, *this););
|
TRACE("unit_resolution", tout << "unit_resolution generating fact\n" << mk_ll_pp(pr, *this););
|
||||||
return pr;
|
return pr;
|
||||||
}
|
}
|
||||||
|
@ -3140,7 +3140,7 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro
|
||||||
SASSERT(num_matches != cls_sz || is_false(new_fact));
|
SASSERT(num_matches != cls_sz || is_false(new_fact));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
proof * pr = mk_app(basic_family_id, PR_UNIT_RESOLUTION, args.size(), args.c_ptr());
|
proof * pr = mk_app(basic_family_id, PR_UNIT_RESOLUTION, args.size(), args.data());
|
||||||
TRACE("unit_resolution", tout << "unit_resolution using fact\n" << mk_ll_pp(pr, *this););
|
TRACE("unit_resolution", tout << "unit_resolution using fact\n" << mk_ll_pp(pr, *this););
|
||||||
return pr;
|
return pr;
|
||||||
}
|
}
|
||||||
|
@ -3168,7 +3168,7 @@ proof * ast_manager::mk_apply_defs(expr * n, expr * def, unsigned num_proofs, pr
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
args.append(num_proofs, (expr**) proofs);
|
args.append(num_proofs, (expr**) proofs);
|
||||||
args.push_back(mk_oeq(n, def));
|
args.push_back(mk_oeq(n, def));
|
||||||
return mk_app(basic_family_id, PR_APPLY_DEF, args.size(), args.c_ptr());
|
return mk_app(basic_family_id, PR_APPLY_DEF, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * ast_manager::mk_iff_oeq(proof * p) {
|
proof * ast_manager::mk_iff_oeq(proof * p) {
|
||||||
|
@ -3202,7 +3202,7 @@ proof * ast_manager::mk_nnf_pos(expr * s, expr * t, unsigned num_proofs, proof *
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
args.append(num_proofs, (expr**) proofs);
|
args.append(num_proofs, (expr**) proofs);
|
||||||
args.push_back(mk_oeq(s, t));
|
args.push_back(mk_oeq(s, t));
|
||||||
return mk_app(basic_family_id, PR_NNF_POS, args.size(), args.c_ptr());
|
return mk_app(basic_family_id, PR_NNF_POS, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * ast_manager::mk_nnf_neg(expr * s, expr * t, unsigned num_proofs, proof * const * proofs) {
|
proof * ast_manager::mk_nnf_neg(expr * s, expr * t, unsigned num_proofs, proof * const * proofs) {
|
||||||
|
@ -3212,7 +3212,7 @@ proof * ast_manager::mk_nnf_neg(expr * s, expr * t, unsigned num_proofs, proof *
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
args.append(num_proofs, (expr**) proofs);
|
args.append(num_proofs, (expr**) proofs);
|
||||||
args.push_back(mk_oeq(mk_not(s), t));
|
args.push_back(mk_oeq(mk_not(s), t));
|
||||||
return mk_app(basic_family_id, PR_NNF_NEG, args.size(), args.c_ptr());
|
return mk_app(basic_family_id, PR_NNF_NEG, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * ast_manager::mk_skolemization(expr * q, expr * e) {
|
proof * ast_manager::mk_skolemization(expr * q, expr * e) {
|
||||||
|
@ -3255,7 +3255,7 @@ proof* ast_manager::mk_clause_trail_elem(proof *pr, expr* e, decl_kind k) {
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
if (pr) args.push_back(pr);
|
if (pr) args.push_back(pr);
|
||||||
args.push_back(e);
|
args.push_back(e);
|
||||||
return mk_app(basic_family_id, k, 0, nullptr, args.size(), args.c_ptr());
|
return mk_app(basic_family_id, k, 0, nullptr, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * ast_manager::mk_assumption_add(proof* pr, expr* e) {
|
proof * ast_manager::mk_assumption_add(proof* pr, expr* e) {
|
||||||
|
@ -3281,7 +3281,7 @@ proof * ast_manager::mk_redundant_del(expr* e) {
|
||||||
proof * ast_manager::mk_clause_trail(unsigned n, proof* const* ps) {
|
proof * ast_manager::mk_clause_trail(unsigned n, proof* const* ps) {
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
args.append(n, (expr**) ps);
|
args.append(n, (expr**) ps);
|
||||||
return mk_app(basic_family_id, PR_CLAUSE_TRAIL, 0, nullptr, args.size(), args.c_ptr());
|
return mk_app(basic_family_id, PR_CLAUSE_TRAIL, 0, nullptr, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof * ast_manager::mk_th_lemma(
|
proof * ast_manager::mk_th_lemma(
|
||||||
|
@ -3301,7 +3301,7 @@ proof * ast_manager::mk_th_lemma(
|
||||||
}
|
}
|
||||||
args.append(num_proofs, (expr**) proofs);
|
args.append(num_proofs, (expr**) proofs);
|
||||||
args.push_back(fact);
|
args.push_back(fact);
|
||||||
return mk_app(basic_family_id, PR_TH_LEMMA, num_params+1, parameters.c_ptr(), args.size(), args.c_ptr());
|
return mk_app(basic_family_id, PR_TH_LEMMA, num_params+1, parameters.data(), args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
proof* ast_manager::mk_hyper_resolve(unsigned num_premises, proof* const* premises, expr* concl,
|
proof* ast_manager::mk_hyper_resolve(unsigned num_premises, proof* const* premises, expr* concl,
|
||||||
|
@ -3337,7 +3337,7 @@ proof* ast_manager::mk_hyper_resolve(unsigned num_premises, proof* const* premis
|
||||||
}
|
}
|
||||||
sorts.push_back(mk_bool_sort());
|
sorts.push_back(mk_bool_sort());
|
||||||
args.push_back(concl);
|
args.push_back(concl);
|
||||||
app* result = mk_app(basic_family_id, PR_HYPER_RESOLVE, params.size(), params.c_ptr(), args.size(), args.c_ptr());
|
app* result = mk_app(basic_family_id, PR_HYPER_RESOLVE, params.size(), params.data(), args.size(), args.data());
|
||||||
SASSERT(result->get_family_id() == basic_family_id);
|
SASSERT(result->get_family_id() == basic_family_id);
|
||||||
SASSERT(result->get_decl_kind() == PR_HYPER_RESOLVE);
|
SASSERT(result->get_decl_kind() == PR_HYPER_RESOLVE);
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -1829,27 +1829,27 @@ public:
|
||||||
app * mk_app(func_decl * decl, unsigned num_args, expr * const * args);
|
app * mk_app(func_decl * decl, unsigned num_args, expr * const * args);
|
||||||
|
|
||||||
app* mk_app(func_decl* decl, ref_vector<expr, ast_manager> const& args) {
|
app* mk_app(func_decl* decl, ref_vector<expr, ast_manager> const& args) {
|
||||||
return mk_app(decl, args.size(), args.c_ptr());
|
return mk_app(decl, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app* mk_app(func_decl* decl, ref_buffer<expr, ast_manager> const& args) {
|
app* mk_app(func_decl* decl, ref_buffer<expr, ast_manager> const& args) {
|
||||||
return mk_app(decl, args.size(), args.c_ptr());
|
return mk_app(decl, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app* mk_app(func_decl* decl, ref_vector<app, ast_manager> const& args) {
|
app* mk_app(func_decl* decl, ref_vector<app, ast_manager> const& args) {
|
||||||
return mk_app(decl, args.size(), (expr*const*)args.c_ptr());
|
return mk_app(decl, args.size(), (expr*const*)args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_app(func_decl * decl, ptr_vector<expr> const& args) {
|
app * mk_app(func_decl * decl, ptr_vector<expr> const& args) {
|
||||||
return mk_app(decl, args.size(), args.c_ptr());
|
return mk_app(decl, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_app(func_decl * decl, ptr_buffer<expr> const& args) {
|
app * mk_app(func_decl * decl, ptr_buffer<expr> const& args) {
|
||||||
return mk_app(decl, args.size(), args.c_ptr());
|
return mk_app(decl, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_app(func_decl * decl, ptr_vector<app> const& args) {
|
app * mk_app(func_decl * decl, ptr_vector<app> const& args) {
|
||||||
return mk_app(decl, args.size(), (expr*const*)args.c_ptr());
|
return mk_app(decl, args.size(), (expr*const*)args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * mk_app(func_decl * decl, expr * const * args) {
|
app * mk_app(func_decl * decl, expr * const * args) {
|
||||||
|
@ -2138,9 +2138,9 @@ public:
|
||||||
app * mk_xor(expr * lhs, expr * rhs) { return mk_app(basic_family_id, OP_XOR, lhs, rhs); }
|
app * mk_xor(expr * lhs, expr * rhs) { return mk_app(basic_family_id, OP_XOR, lhs, rhs); }
|
||||||
app * mk_ite(expr * c, expr * t, expr * e) { return mk_app(basic_family_id, OP_ITE, c, t, e); }
|
app * mk_ite(expr * c, expr * t, expr * e) { return mk_app(basic_family_id, OP_ITE, c, t, e); }
|
||||||
app * mk_xor(unsigned num_args, expr * const * args) { return mk_app(basic_family_id, OP_XOR, num_args, args); }
|
app * mk_xor(unsigned num_args, expr * const * args) { return mk_app(basic_family_id, OP_XOR, num_args, args); }
|
||||||
app * mk_xor(ptr_buffer<expr> const& args) { return mk_xor(args.size(), args.c_ptr()); }
|
app * mk_xor(ptr_buffer<expr> const& args) { return mk_xor(args.size(), args.data()); }
|
||||||
app * mk_xor(ptr_vector<expr> const& args) { return mk_xor(args.size(), args.c_ptr()); }
|
app * mk_xor(ptr_vector<expr> const& args) { return mk_xor(args.size(), args.data()); }
|
||||||
app * mk_xor(ref_buffer<expr, ast_manager> const& args) { return mk_xor(args.size(), args.c_ptr()); }
|
app * mk_xor(ref_buffer<expr, ast_manager> const& args) { return mk_xor(args.size(), args.data()); }
|
||||||
app * mk_or(unsigned num_args, expr * const * args) { return mk_app(basic_family_id, OP_OR, num_args, args); }
|
app * mk_or(unsigned num_args, expr * const * args) { return mk_app(basic_family_id, OP_OR, num_args, args); }
|
||||||
app * mk_and(unsigned num_args, expr * const * args) { return mk_app(basic_family_id, OP_AND, num_args, args); }
|
app * mk_and(unsigned num_args, expr * const * args) { return mk_app(basic_family_id, OP_AND, num_args, args); }
|
||||||
app * mk_or(expr * arg1, expr * arg2) { return mk_app(basic_family_id, OP_OR, arg1, arg2); }
|
app * mk_or(expr * arg1, expr * arg2) { return mk_app(basic_family_id, OP_OR, arg1, arg2); }
|
||||||
|
@ -2149,14 +2149,14 @@ public:
|
||||||
app * mk_or(expr* a, expr* b, expr* c, expr* d) { expr* args[4] = { a, b, c, d }; return mk_app(basic_family_id, OP_OR, 4, args); }
|
app * mk_or(expr* a, expr* b, expr* c, expr* d) { expr* args[4] = { a, b, c, d }; return mk_app(basic_family_id, OP_OR, 4, args); }
|
||||||
app * mk_and(expr * arg1, expr * arg2, expr * arg3) { return mk_app(basic_family_id, OP_AND, arg1, arg2, arg3); }
|
app * mk_and(expr * arg1, expr * arg2, expr * arg3) { return mk_app(basic_family_id, OP_AND, arg1, arg2, arg3); }
|
||||||
|
|
||||||
app * mk_and(ref_vector<expr, ast_manager> const& args) { return mk_and(args.size(), args.c_ptr()); }
|
app * mk_and(ref_vector<expr, ast_manager> const& args) { return mk_and(args.size(), args.data()); }
|
||||||
app * mk_and(ptr_vector<expr> const& args) { return mk_and(args.size(), args.c_ptr()); }
|
app * mk_and(ptr_vector<expr> const& args) { return mk_and(args.size(), args.data()); }
|
||||||
app * mk_and(ref_buffer<expr, ast_manager> const& args) { return mk_and(args.size(), args.c_ptr()); }
|
app * mk_and(ref_buffer<expr, ast_manager> const& args) { return mk_and(args.size(), args.data()); }
|
||||||
app * mk_and(ptr_buffer<expr> const& args) { return mk_and(args.size(), args.c_ptr()); }
|
app * mk_and(ptr_buffer<expr> const& args) { return mk_and(args.size(), args.data()); }
|
||||||
app * mk_or(ref_vector<expr, ast_manager> const& args) { return mk_or(args.size(), args.c_ptr()); }
|
app * mk_or(ref_vector<expr, ast_manager> const& args) { return mk_or(args.size(), args.data()); }
|
||||||
app * mk_or(ptr_vector<expr> const& args) { return mk_or(args.size(), args.c_ptr()); }
|
app * mk_or(ptr_vector<expr> const& args) { return mk_or(args.size(), args.data()); }
|
||||||
app * mk_or(ref_buffer<expr, ast_manager> const& args) { return mk_or(args.size(), args.c_ptr()); }
|
app * mk_or(ref_buffer<expr, ast_manager> const& args) { return mk_or(args.size(), args.data()); }
|
||||||
app * mk_or(ptr_buffer<expr> const& args) { return mk_or(args.size(), args.c_ptr()); }
|
app * mk_or(ptr_buffer<expr> const& args) { return mk_or(args.size(), args.data()); }
|
||||||
app * mk_implies(expr * arg1, expr * arg2) { return mk_app(basic_family_id, OP_IMPLIES, arg1, arg2); }
|
app * mk_implies(expr * arg1, expr * arg2) { return mk_app(basic_family_id, OP_IMPLIES, arg1, arg2); }
|
||||||
app * mk_not(expr * n) { return mk_app(basic_family_id, OP_NOT, n); }
|
app * mk_not(expr * n) { return mk_app(basic_family_id, OP_NOT, n); }
|
||||||
app * mk_distinct(unsigned num_args, expr * const * args);
|
app * mk_distinct(unsigned num_args, expr * const * args);
|
||||||
|
|
|
@ -33,7 +33,7 @@ void ast_pp_util::collect(unsigned n, expr* const* es) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ast_pp_util::collect(expr_ref_vector const& es) {
|
void ast_pp_util::collect(expr_ref_vector const& es) {
|
||||||
collect(es.size(), es.c_ptr());
|
collect(es.size(), es.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ast_pp_util::display_decls(std::ostream& out) {
|
void ast_pp_util::display_decls(std::ostream& out) {
|
||||||
|
|
|
@ -747,8 +747,8 @@ class smt2_printer {
|
||||||
buffer<symbol> labels;
|
buffer<symbol> labels;
|
||||||
bool is_pos;
|
bool is_pos;
|
||||||
format * f = nullptr;
|
format * f = nullptr;
|
||||||
format ** it = m_format_stack.c_ptr() + fr.m_spos;
|
format ** it = m_format_stack.data() + fr.m_spos;
|
||||||
format ** end = m_format_stack.c_ptr() + m_format_stack.size();
|
format ** end = m_format_stack.data() + m_format_stack.size();
|
||||||
if (m().is_label(t, is_pos, labels)) {
|
if (m().is_label(t, is_pos, labels)) {
|
||||||
SASSERT(it + 1 == end);
|
SASSERT(it + 1 == end);
|
||||||
f = pp_labels(is_pos, labels, *it);
|
f = pp_labels(is_pos, labels, *it);
|
||||||
|
@ -829,7 +829,7 @@ class smt2_printer {
|
||||||
buf.push_back(mk_indent(m(), SMALL_INDENT, mk_compose(m(), mk_line_break(m()), f)));
|
buf.push_back(mk_indent(m(), SMALL_INDENT, mk_compose(m(), mk_line_break(m()), f)));
|
||||||
for (unsigned i = 0; i < num_op; i++)
|
for (unsigned i = 0; i < num_op; i++)
|
||||||
buf.push_back(mk_string(m(), ")"));
|
buf.push_back(mk_string(m(), ")"));
|
||||||
return mk_compose(m(), buf.size(), buf.c_ptr());
|
return mk_compose(m(), buf.size(), buf.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
format * pp_let(format * f) {
|
format * pp_let(format * f) {
|
||||||
|
@ -958,14 +958,14 @@ class smt2_printer {
|
||||||
ptr_buffer<format> buf;
|
ptr_buffer<format> buf;
|
||||||
buf.push_back(f_body);
|
buf.push_back(f_body);
|
||||||
if (q->get_num_patterns() > 0) {
|
if (q->get_num_patterns() > 0) {
|
||||||
format ** it = m_format_stack.c_ptr() + fr.m_spos;
|
format ** it = m_format_stack.data() + fr.m_spos;
|
||||||
format ** end = it + q->get_num_patterns();
|
format ** end = it + q->get_num_patterns();
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
buf.push_back(pp_attribute(":pattern ", *it));
|
buf.push_back(pp_attribute(":pattern ", *it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (q->get_num_no_patterns() > 0) {
|
if (q->get_num_no_patterns() > 0) {
|
||||||
format ** it = m_format_stack.c_ptr() + fr.m_spos + q->get_num_patterns();
|
format ** it = m_format_stack.data() + fr.m_spos + q->get_num_patterns();
|
||||||
format ** end = it + q->get_num_no_patterns();
|
format ** end = it + q->get_num_no_patterns();
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
buf.push_back(pp_attribute(":no-pattern ", *it));
|
buf.push_back(pp_attribute(":no-pattern ", *it));
|
||||||
|
@ -1223,7 +1223,7 @@ void mk_smt2_format(unsigned sz, expr * const* es, smt2_pp_environment & env, pa
|
||||||
pr(es[i], num_vars, var_prefix, fr, var_names);
|
pr(es[i], num_vars, var_prefix, fr, var_names);
|
||||||
fmts.push_back(std::move(fr));
|
fmts.push_back(std::move(fr));
|
||||||
}
|
}
|
||||||
r = mk_seq<format**, f2f>(m, fmts.c_ptr(), fmts.c_ptr() + fmts.size(), f2f());
|
r = mk_seq<format**, f2f>(m, fmts.data(), fmts.data() + fmts.size(), f2f());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream & ast_smt2_pp(std::ostream & out, expr * n, smt2_pp_environment & env, params_ref const & p, unsigned indent,
|
std::ostream & ast_smt2_pp(std::ostream & out, expr * n, smt2_pp_environment & env, params_ref const & p, unsigned indent,
|
||||||
|
@ -1375,19 +1375,19 @@ std::ostream& operator<<(std::ostream& out, sort_ref const& e) {
|
||||||
std::ostream& operator<<(std::ostream& out, expr_ref_vector const& e) {
|
std::ostream& operator<<(std::ostream& out, expr_ref_vector const& e) {
|
||||||
smt2_pp_environment_dbg env(e.get_manager());
|
smt2_pp_environment_dbg env(e.get_manager());
|
||||||
params_ref p;
|
params_ref p;
|
||||||
return ast_smt2_pp(out, e.size(), e.c_ptr(), env, p, 0, 0, nullptr);
|
return ast_smt2_pp(out, e.size(), e.data(), env, p, 0, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& out, var_ref_vector const& e) {
|
std::ostream& operator<<(std::ostream& out, var_ref_vector const& e) {
|
||||||
smt2_pp_environment_dbg env(e.get_manager());
|
smt2_pp_environment_dbg env(e.get_manager());
|
||||||
params_ref p;
|
params_ref p;
|
||||||
return ast_smt2_pp(out, e.size(), (expr*const*)e.c_ptr(), env, p, 0, 0, nullptr);
|
return ast_smt2_pp(out, e.size(), (expr*const*)e.data(), env, p, 0, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& out, app_ref_vector const& e) {
|
std::ostream& operator<<(std::ostream& out, app_ref_vector const& e) {
|
||||||
smt2_pp_environment_dbg env(e.get_manager());
|
smt2_pp_environment_dbg env(e.get_manager());
|
||||||
params_ref p;
|
params_ref p;
|
||||||
return ast_smt2_pp(out, e.size(), (expr*const*)e.c_ptr(), env, p, 0, 0, nullptr);
|
return ast_smt2_pp(out, e.size(), (expr*const*)e.data(), env, p, 0, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& out, func_decl_ref_vector const& e) {
|
std::ostream& operator<<(std::ostream& out, func_decl_ref_vector const& e) {
|
||||||
|
|
|
@ -130,7 +130,7 @@ void ast_translation::mk_sort(sort * s, frame & fr) {
|
||||||
si->get_decl_kind(),
|
si->get_decl_kind(),
|
||||||
si->get_num_elements(),
|
si->get_num_elements(),
|
||||||
si->get_num_parameters(),
|
si->get_num_parameters(),
|
||||||
ps.c_ptr(),
|
ps.data(),
|
||||||
s->private_parameters()));
|
s->private_parameters()));
|
||||||
}
|
}
|
||||||
m_result_stack.shrink(fr.m_rpos);
|
m_result_stack.shrink(fr.m_rpos);
|
||||||
|
@ -144,7 +144,7 @@ void ast_translation::mk_func_decl(func_decl * f, frame & fr) {
|
||||||
func_decl_info * fi = f->get_info();
|
func_decl_info * fi = f->get_info();
|
||||||
SASSERT(fr.m_cpos <= m_extra_children_stack.size());
|
SASSERT(fr.m_cpos <= m_extra_children_stack.size());
|
||||||
unsigned num_extra = m_extra_children_stack.size() - fr.m_cpos;
|
unsigned num_extra = m_extra_children_stack.size() - fr.m_cpos;
|
||||||
sort ** new_domain = reinterpret_cast<sort**>(m_result_stack.c_ptr() + fr.m_rpos + num_extra);
|
sort ** new_domain = reinterpret_cast<sort**>(m_result_stack.data() + fr.m_rpos + num_extra);
|
||||||
sort * new_range = static_cast<sort*>(m_result_stack.back());
|
sort * new_range = static_cast<sort*>(m_result_stack.back());
|
||||||
func_decl * new_f;
|
func_decl * new_f;
|
||||||
if (fi == nullptr) {
|
if (fi == nullptr) {
|
||||||
|
@ -159,7 +159,7 @@ void ast_translation::mk_func_decl(func_decl * f, frame & fr) {
|
||||||
func_decl_info new_fi(fi->get_family_id(),
|
func_decl_info new_fi(fi->get_family_id(),
|
||||||
fi->get_decl_kind(),
|
fi->get_decl_kind(),
|
||||||
fi->get_num_parameters(),
|
fi->get_num_parameters(),
|
||||||
ps.c_ptr());
|
ps.data());
|
||||||
|
|
||||||
new_fi.set_left_associative(fi->is_left_associative());
|
new_fi.set_left_associative(fi->is_left_associative());
|
||||||
new_fi.set_right_associative(fi->is_right_associative());
|
new_fi.set_right_associative(fi->is_right_associative());
|
||||||
|
@ -251,7 +251,7 @@ ast * ast_translation::process(ast const * _n) {
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
func_decl * new_f = to_func_decl(m_result_stack[fr.m_rpos]);
|
func_decl * new_f = to_func_decl(m_result_stack[fr.m_rpos]);
|
||||||
expr ** new_args = reinterpret_cast<expr **>(m_result_stack.c_ptr() + fr.m_rpos + 1);
|
expr ** new_args = reinterpret_cast<expr **>(m_result_stack.data() + fr.m_rpos + 1);
|
||||||
expr * new_app = m_to_manager.mk_app(new_f, num, new_args);
|
expr * new_app = m_to_manager.mk_app(new_f, num, new_args);
|
||||||
m_result_stack.shrink(fr.m_rpos);
|
m_result_stack.shrink(fr.m_rpos);
|
||||||
m_result_stack.push_back(new_app);
|
m_result_stack.push_back(new_app);
|
||||||
|
@ -273,10 +273,10 @@ ast * ast_translation::process(ast const * _n) {
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
symbol const * dnames = to_quantifier(n)->get_decl_names();
|
symbol const * dnames = to_quantifier(n)->get_decl_names();
|
||||||
sort ** dsorts = reinterpret_cast<sort**>(m_result_stack.c_ptr() + fr.m_rpos);
|
sort ** dsorts = reinterpret_cast<sort**>(m_result_stack.data() + fr.m_rpos);
|
||||||
expr * body = static_cast<expr*>(m_result_stack[fr.m_rpos + num_decls]);
|
expr * body = static_cast<expr*>(m_result_stack[fr.m_rpos + num_decls]);
|
||||||
unsigned num_pats = to_quantifier(n)->get_num_patterns();
|
unsigned num_pats = to_quantifier(n)->get_num_patterns();
|
||||||
expr ** pats = reinterpret_cast<expr**>(m_result_stack.c_ptr() + fr.m_rpos + num_decls + 1);
|
expr ** pats = reinterpret_cast<expr**>(m_result_stack.data() + fr.m_rpos + num_decls + 1);
|
||||||
unsigned num_no_pats = to_quantifier(n)->get_num_no_patterns();
|
unsigned num_no_pats = to_quantifier(n)->get_num_no_patterns();
|
||||||
expr ** no_pats = pats + num_pats;
|
expr ** no_pats = pats + num_pats;
|
||||||
quantifier * new_q = m_to_manager.mk_quantifier(to_quantifier(n)->get_kind(),
|
quantifier * new_q = m_to_manager.mk_quantifier(to_quantifier(n)->get_kind(),
|
||||||
|
@ -349,5 +349,5 @@ expr_dependency * expr_dependency_translation::operator()(expr_dependency * d) {
|
||||||
for (unsigned i = 0; i < sz; i++) {
|
for (unsigned i = 0; i < sz; i++) {
|
||||||
m_buffer[i] = m_translation(m_buffer[i]);
|
m_buffer[i] = m_translation(m_buffer[i]);
|
||||||
}
|
}
|
||||||
return m_translation.to().mk_join(sz, m_buffer.c_ptr());
|
return m_translation.to().mk_join(sz, m_buffer.data());
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,7 @@ expr * expand_distinct(ast_manager & m, unsigned num_args, expr * const * args)
|
||||||
for (unsigned j = i + 1; j < num_args; j++)
|
for (unsigned j = i + 1; j < num_args; j++)
|
||||||
new_diseqs.push_back(m.mk_not(m.mk_eq(args[i], args[j])));
|
new_diseqs.push_back(m.mk_not(m.mk_eq(args[i], args[j])));
|
||||||
}
|
}
|
||||||
return mk_and(m, new_diseqs.size(), new_diseqs.c_ptr());
|
return mk_and(m, new_diseqs.size(), new_diseqs.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
expr* mk_distinct(ast_manager& m, unsigned num_args, expr * const * args) {
|
expr* mk_distinct(ast_manager& m, unsigned num_args, expr * const * args) {
|
||||||
|
@ -253,7 +253,7 @@ expr* mk_distinct(ast_manager& m, unsigned num_args, expr * const * args) {
|
||||||
|
|
||||||
expr_ref mk_distinct(expr_ref_vector const& args) {
|
expr_ref mk_distinct(expr_ref_vector const& args) {
|
||||||
ast_manager& m = args.get_manager();
|
ast_manager& m = args.get_manager();
|
||||||
return expr_ref(mk_distinct(m, args.size(), args.c_ptr()), m);
|
return expr_ref(mk_distinct(m, args.size(), args.data()), m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ void remove_duplicates(C & v) {
|
||||||
unsigned sz = v.size();
|
unsigned sz = v.size();
|
||||||
unsigned j = 0;
|
unsigned j = 0;
|
||||||
for (unsigned i = 0; i < sz; i++) {
|
for (unsigned i = 0; i < sz; i++) {
|
||||||
typename C::data curr = v.get(i);
|
auto curr = v.get(i);
|
||||||
if (!visited.is_marked(curr)) {
|
if (!visited.is_marked(curr)) {
|
||||||
visited.mark(curr);
|
visited.mark(curr);
|
||||||
if (i != j)
|
if (i != j)
|
||||||
|
@ -102,8 +102,8 @@ expr * get_clause_literal(ast_manager & m, expr * cls, unsigned idx);
|
||||||
expr * mk_and(ast_manager & m, unsigned num_args, expr * const * args);
|
expr * mk_and(ast_manager & m, unsigned num_args, expr * const * args);
|
||||||
app * mk_and(ast_manager & m, unsigned num_args, app * const * args);
|
app * mk_and(ast_manager & m, unsigned num_args, app * const * args);
|
||||||
inline expr * mk_and(ast_manager & m, expr* a, expr* b) { expr* args[2] = { a, b }; return mk_and(m, 2, args); }
|
inline expr * mk_and(ast_manager & m, expr* a, expr* b) { expr* args[2] = { a, b }; return mk_and(m, 2, args); }
|
||||||
inline app_ref mk_and(app_ref_vector const& args) { return app_ref(mk_and(args.get_manager(), args.size(), args.c_ptr()), args.get_manager()); }
|
inline app_ref mk_and(app_ref_vector const& args) { return app_ref(mk_and(args.get_manager(), args.size(), args.data()), args.get_manager()); }
|
||||||
inline expr_ref mk_and(expr_ref_vector const& args) { return expr_ref(mk_and(args.get_manager(), args.size(), args.c_ptr()), args.get_manager()); }
|
inline expr_ref mk_and(expr_ref_vector const& args) { return expr_ref(mk_and(args.get_manager(), args.size(), args.data()), args.get_manager()); }
|
||||||
|
|
||||||
inline app_ref operator&(expr_ref& a, expr* b) { return app_ref(a.m().mk_and(a, b), a.m()); }
|
inline app_ref operator&(expr_ref& a, expr* b) { return app_ref(a.m().mk_and(a, b), a.m()); }
|
||||||
inline app_ref operator&(app_ref& a, expr* b) { return app_ref(a.m().mk_and(a, b), a.m()); }
|
inline app_ref operator&(app_ref& a, expr* b) { return app_ref(a.m().mk_and(a, b), a.m()); }
|
||||||
|
@ -124,8 +124,8 @@ app_ref operator+(expr_ref& a, expr_ref& b);
|
||||||
expr * mk_or(ast_manager & m, unsigned num_args, expr * const * args);
|
expr * mk_or(ast_manager & m, unsigned num_args, expr * const * args);
|
||||||
app * mk_or(ast_manager & m, unsigned num_args, app * const * args);
|
app * mk_or(ast_manager & m, unsigned num_args, app * const * args);
|
||||||
inline expr * mk_or(ast_manager & m, expr* a, expr* b) { expr* args[2] = { a, b }; return mk_or(m, 2, args); }
|
inline expr * mk_or(ast_manager & m, expr* a, expr* b) { expr* args[2] = { a, b }; return mk_or(m, 2, args); }
|
||||||
inline app_ref mk_or(app_ref_vector const& args) { return app_ref(mk_or(args.get_manager(), args.size(), args.c_ptr()), args.get_manager()); }
|
inline app_ref mk_or(app_ref_vector const& args) { return app_ref(mk_or(args.get_manager(), args.size(), args.data()), args.get_manager()); }
|
||||||
inline expr_ref mk_or(expr_ref_vector const& args) { return expr_ref(mk_or(args.get_manager(), args.size(), args.c_ptr()), args.get_manager()); }
|
inline expr_ref mk_or(expr_ref_vector const& args) { return expr_ref(mk_or(args.get_manager(), args.size(), args.data()), args.get_manager()); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return a if arg = (not a)
|
Return a if arg = (not a)
|
||||||
|
|
|
@ -410,7 +410,7 @@ public:
|
||||||
return m_manager.mk_app(get_fid(), OP_EXTRACT, 2, params, 1, &n);
|
return m_manager.mk_app(get_fid(), OP_EXTRACT, 2, params, 1, &n);
|
||||||
}
|
}
|
||||||
app * mk_concat(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_CONCAT, num, args); }
|
app * mk_concat(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_CONCAT, num, args); }
|
||||||
app * mk_concat(expr_ref_vector const& es) { return m_manager.mk_app(get_fid(), OP_CONCAT, es.size(), es.c_ptr()); }
|
app * mk_concat(expr_ref_vector const& es) { return m_manager.mk_app(get_fid(), OP_CONCAT, es.size(), es.data()); }
|
||||||
app * mk_bv_or(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_BOR, num, args); }
|
app * mk_bv_or(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_BOR, num, args); }
|
||||||
app * mk_bv_and(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_BAND, num, args); }
|
app * mk_bv_and(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_BAND, num, args); }
|
||||||
app * mk_bv_xor(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_BXOR, num, args); }
|
app * mk_bv_xor(unsigned num, expr * const * args) { return m_manager.mk_app(get_fid(), OP_BXOR, num, args); }
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace datatype {
|
||||||
unsigned n = ps.size();
|
unsigned n = ps.size();
|
||||||
SASSERT(m_range);
|
SASSERT(m_range);
|
||||||
SASSERT(n == get_def().params().size());
|
SASSERT(n == get_def().params().size());
|
||||||
sort_ref range(m.substitute(m_range, n, get_def().params().c_ptr(), ps.c_ptr()), m);
|
sort_ref range(m.substitute(m_range, n, get_def().params().data(), ps.data()), m);
|
||||||
sort_ref src(get_def().instantiate(ps));
|
sort_ref src(get_def().instantiate(ps));
|
||||||
sort* srcs[1] = { src.get() };
|
sort* srcs[1] = { src.get() };
|
||||||
parameter pas[2] = { parameter(name()), parameter(get_constructor().name()) };
|
parameter pas[2] = { parameter(name()), parameter(get_constructor().name()) };
|
||||||
|
@ -70,7 +70,7 @@ namespace datatype {
|
||||||
}
|
}
|
||||||
sort_ref range = get_def().instantiate(ps);
|
sort_ref range = get_def().instantiate(ps);
|
||||||
parameter pas[1] = { parameter(name()) };
|
parameter pas[1] = { parameter(name()) };
|
||||||
return func_decl_ref(m.mk_func_decl(u().get_family_id(), OP_DT_CONSTRUCTOR, 1, pas, domain.size(), domain.c_ptr(), range), m);
|
return func_decl_ref(m.mk_func_decl(u().get_family_id(), OP_DT_CONSTRUCTOR, 1, pas, domain.size(), domain.data(), range), m);
|
||||||
}
|
}
|
||||||
|
|
||||||
func_decl_ref constructor::instantiate(sort* dt) const {
|
func_decl_ref constructor::instantiate(sort* dt) const {
|
||||||
|
@ -94,12 +94,12 @@ namespace datatype {
|
||||||
vector<parameter> ps;
|
vector<parameter> ps;
|
||||||
ps.push_back(parameter(m_name));
|
ps.push_back(parameter(m_name));
|
||||||
for (sort * s : m_params) ps.push_back(parameter(s));
|
for (sort * s : m_params) ps.push_back(parameter(s));
|
||||||
m_sort = m.mk_sort(u().get_family_id(), DATATYPE_SORT, ps.size(), ps.c_ptr());
|
m_sort = m.mk_sort(u().get_family_id(), DATATYPE_SORT, ps.size(), ps.data());
|
||||||
}
|
}
|
||||||
if (sorts.empty()) {
|
if (sorts.empty()) {
|
||||||
return m_sort;
|
return m_sort;
|
||||||
}
|
}
|
||||||
return sort_ref(m.substitute(m_sort, sorts.size(), m_params.c_ptr(), sorts.c_ptr()), m);
|
return sort_ref(m.substitute(m_sort, sorts.size(), m_params.data(), sorts.data()), m);
|
||||||
}
|
}
|
||||||
|
|
||||||
def* def::translate(ast_translation& tr, util& u) {
|
def* def::translate(ast_translation& tr, util& u) {
|
||||||
|
@ -108,7 +108,7 @@ namespace datatype {
|
||||||
for (sort* p : m_params) {
|
for (sort* p : m_params) {
|
||||||
ps.push_back(to_sort(tr(p)));
|
ps.push_back(to_sort(tr(p)));
|
||||||
}
|
}
|
||||||
def* result = alloc(def, tr.to(), u, m_name, m_class_id, ps.size(), ps.c_ptr());
|
def* result = alloc(def, tr.to(), u, m_name, m_class_id, ps.size(), ps.data());
|
||||||
for (constructor* c : *this) {
|
for (constructor* c : *this) {
|
||||||
result->add(c->translate(tr));
|
result->add(c->translate(tr));
|
||||||
}
|
}
|
||||||
|
@ -449,10 +449,10 @@ namespace datatype {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!u().is_well_founded(sorts.size(), sorts.c_ptr())) {
|
if (!u().is_well_founded(sorts.size(), sorts.data())) {
|
||||||
m_manager->raise_exception("datatype is not well-founded");
|
m_manager->raise_exception("datatype is not well-founded");
|
||||||
}
|
}
|
||||||
if (!u().is_covariant(sorts.size(), sorts.c_ptr())) {
|
if (!u().is_covariant(sorts.size(), sorts.data())) {
|
||||||
m_manager->raise_exception("datatype is not co-variant");
|
m_manager->raise_exception("datatype is not co-variant");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1372,7 +1372,7 @@ namespace datatype {
|
||||||
type_ref t(e.second);
|
type_ref t(e.second);
|
||||||
accd.push_back(mk_accessor_decl(m, e.first, t));
|
accd.push_back(mk_accessor_decl(m, e.first, t));
|
||||||
}
|
}
|
||||||
auto* tuple = mk_constructor_decl(name, test, accd.size(), accd.c_ptr());
|
auto* tuple = mk_constructor_decl(name, test, accd.size(), accd.data());
|
||||||
auto* dt = mk_datatype_decl(*this, name, 0, nullptr, 1, &tuple);
|
auto* dt = mk_datatype_decl(*this, name, 0, nullptr, 1, &tuple);
|
||||||
sort_ref_vector sorts(m);
|
sort_ref_vector sorts(m);
|
||||||
VERIFY(plugin().mk_datatypes(1, &dt, 0, nullptr, sorts));
|
VERIFY(plugin().mk_datatypes(1, &dt, 0, nullptr, sorts));
|
||||||
|
|
|
@ -244,7 +244,7 @@ namespace datalog {
|
||||||
ps.push_back(parameter(sorts[j]));
|
ps.push_back(parameter(sorts[j]));
|
||||||
}
|
}
|
||||||
SASSERT(ps.size() + num_params == sorts.size());
|
SASSERT(ps.size() + num_params == sorts.size());
|
||||||
sort* r2 = m.mk_sort(m_family_id, DL_RELATION_SORT, ps.size(), ps.c_ptr());
|
sort* r2 = m.mk_sort(m_family_id, DL_RELATION_SORT, ps.size(), ps.data());
|
||||||
func_decl_info info(m_family_id, OP_RA_PROJECT, num_params, params);
|
func_decl_info info(m_family_id, OP_RA_PROJECT, num_params, params);
|
||||||
return m.mk_func_decl(m_project_sym, 1, &r, r2, info);
|
return m.mk_func_decl(m_project_sym, 1, &r, r2, info);
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ namespace datalog {
|
||||||
for (unsigned i = 0; i < sorts.size(); ++i) {
|
for (unsigned i = 0; i < sorts.size(); ++i) {
|
||||||
params2.push_back(parameter(sorts[i]));
|
params2.push_back(parameter(sorts[i]));
|
||||||
}
|
}
|
||||||
sort* rng = m_manager->mk_sort(m_family_id, DL_RELATION_SORT, params2.size(), params2.c_ptr());
|
sort* rng = m_manager->mk_sort(m_family_id, DL_RELATION_SORT, params2.size(), params2.data());
|
||||||
func_decl_info info(m_family_id, OP_RA_RENAME, num_params, params);
|
func_decl_info info(m_family_id, OP_RA_RENAME, num_params, params);
|
||||||
return m_manager->mk_func_decl(m_rename_sym, 1, &r, rng, info);
|
return m_manager->mk_func_decl(m_rename_sym, 1, &r, rng, info);
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ namespace datalog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort* args[2] = { r1, r2 };
|
sort* args[2] = { r1, r2 };
|
||||||
sort* rng = m_manager->mk_sort(m_family_id, DL_RELATION_SORT, params2.size(), params2.c_ptr());
|
sort* rng = m_manager->mk_sort(m_family_id, DL_RELATION_SORT, params2.size(), params2.data());
|
||||||
func_decl_info info(m_family_id, OP_RA_JOIN, num_params, params);
|
func_decl_info info(m_family_id, OP_RA_JOIN, num_params, params);
|
||||||
return m_manager->mk_func_decl(m_join_sym, 2, args, rng, info);
|
return m_manager->mk_func_decl(m_join_sym, 2, args, rng, info);
|
||||||
}
|
}
|
||||||
|
@ -768,7 +768,7 @@ namespace datalog {
|
||||||
for (unsigned i = 0; i < num_args; ++i) {
|
for (unsigned i = 0; i < num_args; ++i) {
|
||||||
sorts.push_back(args[i]->get_sort());
|
sorts.push_back(args[i]->get_sort());
|
||||||
}
|
}
|
||||||
func_decl* f = m.mk_func_decl(name, num_args, sorts.c_ptr(), mk_rule_sort());
|
func_decl* f = m.mk_func_decl(name, num_args, sorts.data(), mk_rule_sort());
|
||||||
return m.mk_app(f, num_args, args);
|
return m.mk_app(f, num_args, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -776,7 +776,7 @@ namespace euf {
|
||||||
for (unsigned j = 0; j < n1->num_args(); ++j)
|
for (unsigned j = 0; j < n1->num_args(); ++j)
|
||||||
args.push_back(old_expr2new_enode[n1->get_arg(j)->get_expr_id()]);
|
args.push_back(old_expr2new_enode[n1->get_arg(j)->get_expr_id()]);
|
||||||
expr* e2 = tr(e1);
|
expr* e2 = tr(e1);
|
||||||
enode* n2 = mk(e2, n1->generation(), args.size(), args.c_ptr());
|
enode* n2 = mk(e2, n1->generation(), args.size(), args.data());
|
||||||
old_expr2new_enode.setx(e1->get_id(), n2, nullptr);
|
old_expr2new_enode.setx(e1->get_id(), n2, nullptr);
|
||||||
n2->set_value(n2->value());
|
n2->set_value(n2->value());
|
||||||
n2->m_bool_var = n1->m_bool_var;
|
n2->m_bool_var = n1->m_bool_var;
|
||||||
|
|
|
@ -236,12 +236,12 @@ struct expr2polynomial::imp {
|
||||||
|
|
||||||
polynomial::polynomial * const * polynomial_args(unsigned num_args) {
|
polynomial::polynomial * const * polynomial_args(unsigned num_args) {
|
||||||
SASSERT(m_presult_stack.size() >= num_args);
|
SASSERT(m_presult_stack.size() >= num_args);
|
||||||
return m_presult_stack.c_ptr() + m_presult_stack.size() - num_args;
|
return m_presult_stack.data() + m_presult_stack.size() - num_args;
|
||||||
}
|
}
|
||||||
|
|
||||||
polynomial::numeral const * denominator_args(unsigned num_args) {
|
polynomial::numeral const * denominator_args(unsigned num_args) {
|
||||||
SASSERT(m_dresult_stack.size() >= num_args);
|
SASSERT(m_dresult_stack.size() >= num_args);
|
||||||
return m_dresult_stack.c_ptr() + m_dresult_stack.size() - num_args;
|
return m_dresult_stack.data() + m_dresult_stack.size() - num_args;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool is_add>
|
template<bool is_add>
|
||||||
|
@ -442,7 +442,7 @@ struct expr2polynomial::imp {
|
||||||
args.push_back(margs[0]);
|
args.push_back(margs[0]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
args.push_back(m_autil.mk_mul(margs.size(), margs.c_ptr()));
|
args.push_back(m_autil.mk_mul(margs.size(), margs.data()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ struct expr2polynomial::imp {
|
||||||
r = args[0];
|
r = args[0];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
r = m_autil.mk_add(args.size(), args.c_ptr());
|
r = m_autil.mk_add(args.size(), args.data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ void expr_abstractor::operator()(unsigned base, unsigned num_bound, expr* const*
|
||||||
}
|
}
|
||||||
if (all_visited) {
|
if (all_visited) {
|
||||||
if (changed) {
|
if (changed) {
|
||||||
b = m.mk_app(a->get_decl(), m_args.size(), m_args.c_ptr());
|
b = m.mk_app(a->get_decl(), m_args.size(), m_args.data());
|
||||||
m_pinned.push_back(b);
|
m_pinned.push_back(b);
|
||||||
} else {
|
} else {
|
||||||
b = curr;
|
b = curr;
|
||||||
|
@ -89,7 +89,7 @@ void expr_abstractor::operator()(unsigned base, unsigned num_bound, expr* const*
|
||||||
patterns.push_back(result1.get());
|
patterns.push_back(result1.get());
|
||||||
}
|
}
|
||||||
result1 = expr_abstract(m, new_base, num_bound, bound, q->get_expr());
|
result1 = expr_abstract(m, new_base, num_bound, bound, q->get_expr());
|
||||||
b = m.update_quantifier(q, patterns.size(), patterns.c_ptr(), result1.get());
|
b = m.update_quantifier(q, patterns.size(), patterns.data(), result1.get());
|
||||||
m_pinned.push_back(b);
|
m_pinned.push_back(b);
|
||||||
m_map.insert(curr, b);
|
m_map.insert(curr, b);
|
||||||
m_stack.pop_back();
|
m_stack.pop_back();
|
||||||
|
@ -125,7 +125,7 @@ expr_ref mk_quantifier(quantifier_kind k, ast_manager& m, unsigned num_bound, ap
|
||||||
sorts.push_back(bound[i]->get_sort());
|
sorts.push_back(bound[i]->get_sort());
|
||||||
names.push_back(bound[i]->get_decl()->get_name());
|
names.push_back(bound[i]->get_decl()->get_name());
|
||||||
}
|
}
|
||||||
result = m.mk_quantifier(k, num_bound, sorts.c_ptr(), names.c_ptr(), result);
|
result = m.mk_quantifier(k, num_bound, sorts.data(), names.data(), result);
|
||||||
}
|
}
|
||||||
TRACE("expr_abstract",
|
TRACE("expr_abstract",
|
||||||
tout << expr_ref(n, m) << "\n";
|
tout << expr_ref(n, m) << "\n";
|
||||||
|
|
|
@ -33,8 +33,8 @@ public:
|
||||||
|
|
||||||
void expr_abstract(ast_manager& m, unsigned base, unsigned num_bound, expr* const* bound, expr* n, expr_ref& result);
|
void expr_abstract(ast_manager& m, unsigned base, unsigned num_bound, expr* const* bound, expr* n, expr_ref& result);
|
||||||
inline expr_ref expr_abstract(ast_manager& m, unsigned base, unsigned num_bound, expr* const* bound, expr* n) { expr_ref r(m); expr_abstract(m, base, num_bound, bound, n, r); return r; }
|
inline expr_ref expr_abstract(ast_manager& m, unsigned base, unsigned num_bound, expr* const* bound, expr* n) { expr_ref r(m); expr_abstract(m, base, num_bound, bound, n, r); return r; }
|
||||||
inline expr_ref expr_abstract(expr_ref_vector const& bound, expr* n) { return expr_abstract(bound.m(), 0, bound.size(), bound.c_ptr(), n); }
|
inline expr_ref expr_abstract(expr_ref_vector const& bound, expr* n) { return expr_abstract(bound.m(), 0, bound.size(), bound.data(), n); }
|
||||||
inline expr_ref expr_abstract(app_ref_vector const& bound, expr* n) { return expr_abstract(bound.m(), 0, bound.size(), (expr*const*)bound.c_ptr(), n); }
|
inline expr_ref expr_abstract(app_ref_vector const& bound, expr* n) { return expr_abstract(bound.m(), 0, bound.size(), (expr*const*)bound.data(), n); }
|
||||||
expr_ref mk_forall(ast_manager& m, unsigned num_bound, app* const* bound, expr* n);
|
expr_ref mk_forall(ast_manager& m, unsigned num_bound, app* const* bound, expr* n);
|
||||||
expr_ref mk_exists(ast_manager& m, unsigned num_bound, app* const* bound, expr* n);
|
expr_ref mk_exists(ast_manager& m, unsigned num_bound, app* const* bound, expr* n);
|
||||||
inline expr_ref mk_forall(ast_manager& m, app* b, expr* n) { return mk_forall(m, 1, &b, n); }
|
inline expr_ref mk_forall(ast_manager& m, app* b, expr* n) { return mk_forall(m, 1, &b, n); }
|
||||||
|
|
|
@ -124,7 +124,7 @@ void map_proc::reconstruct(app* a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_new) {
|
if (is_new) {
|
||||||
expr* b = m.mk_app(a->get_decl(), m_args.size(), m_args.c_ptr());
|
expr* b = m.mk_app(a->get_decl(), m_args.size(), m_args.data());
|
||||||
m_map.insert(a, b, nullptr);
|
m_map.insert(a, b, nullptr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator()(expr_ref_vector const& v) {
|
bool operator()(expr_ref_vector const& v) {
|
||||||
return (*this)(v.size(), v.c_ptr());
|
return (*this)(v.size(), v.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator()(unsigned size, expr* const* es);
|
bool operator()(unsigned size, expr* const* es);
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace format_ns {
|
||||||
children.push_back(curr);
|
children.push_back(curr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mk_compose(m, children.size(), children.c_ptr());
|
return mk_compose(m, children.size(), children.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -219,7 +219,7 @@ expr_ref bv2fpa_converter::rebuild_floats(model_core * mc, sort * s, expr * e) {
|
||||||
for (expr* arg : *a) {
|
for (expr* arg : *a) {
|
||||||
new_args.push_back(rebuild_floats(mc, arg->get_sort(), arg));
|
new_args.push_back(rebuild_floats(mc, arg->get_sort(), arg));
|
||||||
}
|
}
|
||||||
result = m.mk_app(a->get_decl(), new_args.size(), new_args.c_ptr());
|
result = m.mk_app(a->get_decl(), new_args.size(), new_args.data());
|
||||||
}
|
}
|
||||||
else if (is_var(e)) {
|
else if (is_var(e)) {
|
||||||
result = e;
|
result = e;
|
||||||
|
@ -247,7 +247,7 @@ bv2fpa_converter::array_model bv2fpa_converter::convert_array_func_interp(model_
|
||||||
|
|
||||||
bv_f = arr_util.get_as_array_func_decl(to_app(as_arr_mdl));
|
bv_f = arr_util.get_as_array_func_decl(to_app(as_arr_mdl));
|
||||||
|
|
||||||
am.new_float_fd = m.mk_fresh_func_decl(arity, array_domain.c_ptr(), rng);
|
am.new_float_fd = m.mk_fresh_func_decl(arity, array_domain.data(), rng);
|
||||||
am.new_float_fi = convert_func_interp(mc, am.new_float_fd, bv_f);
|
am.new_float_fi = convert_func_interp(mc, am.new_float_fd, bv_f);
|
||||||
am.bv_fd = bv_f;
|
am.bv_fd = bv_f;
|
||||||
am.result = arr_util.mk_as_array(am.new_float_fd);
|
am.result = arr_util.mk_as_array(am.new_float_fd);
|
||||||
|
@ -295,12 +295,12 @@ func_interp * bv2fpa_converter::convert_func_interp(model_core * mc, func_decl *
|
||||||
for (unsigned i = 0; i < new_args.size(); i++)
|
for (unsigned i = 0; i < new_args.size(); i++)
|
||||||
tout << " " << mk_ismt2_pp(new_args[i], m);
|
tout << " " << mk_ismt2_pp(new_args[i], m);
|
||||||
tout << ") = " << mk_ismt2_pp(ft_fres, m) << std::endl;);
|
tout << ") = " << mk_ismt2_pp(ft_fres, m) << std::endl;);
|
||||||
func_entry * fe = result->get_entry(new_args.c_ptr());
|
func_entry * fe = result->get_entry(new_args.data());
|
||||||
if (fe == nullptr) {
|
if (fe == nullptr) {
|
||||||
// Avoid over-specification of a partially interpreted theory function
|
// Avoid over-specification of a partially interpreted theory function
|
||||||
if (f->get_family_id() != m_fpa_util.get_family_id() ||
|
if (f->get_family_id() != m_fpa_util.get_family_id() ||
|
||||||
m_fpa_util.is_considered_uninterpreted(f, new_args.size(), new_args.c_ptr()))
|
m_fpa_util.is_considered_uninterpreted(f, new_args.size(), new_args.data()))
|
||||||
result->insert_new_entry(new_args.c_ptr(), ft_fres);
|
result->insert_new_entry(new_args.data(), ft_fres);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// The BV model may have multiple equivalent entries using different
|
// The BV model may have multiple equivalent entries using different
|
||||||
|
|
|
@ -264,9 +264,9 @@ expr_ref fpa2bv_converter::extra_quantify(expr * e)
|
||||||
|
|
||||||
expr_ref res(m);
|
expr_ref res(m);
|
||||||
var_subst vsubst(m);
|
var_subst vsubst(m);
|
||||||
res = vsubst.operator()(e, nv, subst_map.c_ptr());
|
res = vsubst.operator()(e, nv, subst_map.data());
|
||||||
TRACE("fpa2bv", tout << "subst'd = " << mk_ismt2_pp(res, m) << std::endl; );
|
TRACE("fpa2bv", tout << "subst'd = " << mk_ismt2_pp(res, m) << std::endl; );
|
||||||
res = m.mk_forall(nv, new_decl_sorts.c_ptr(), new_decl_names.c_ptr(), res);
|
res = m.mk_forall(nv, new_decl_sorts.data(), new_decl_names.data(), res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ bool fpa2bv_rewriter_cfg::reduce_quantifier(
|
||||||
new_decl_names.push_back(n);
|
new_decl_names.push_back(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = m().mk_quantifier(old_q->get_kind(), new_decl_sorts.size(), new_decl_sorts.c_ptr(), new_decl_names.c_ptr(),
|
result = m().mk_quantifier(old_q->get_kind(), new_decl_sorts.size(), new_decl_sorts.data(), new_decl_names.data(),
|
||||||
new_body, old_q->get_weight(), old_q->get_qid(), old_q->get_skid(),
|
new_body, old_q->get_weight(), old_q->get_qid(), old_q->get_skid(),
|
||||||
old_q->get_num_patterns(), new_patterns, old_q->get_num_no_patterns(), new_no_patterns);
|
old_q->get_num_patterns(), new_patterns, old_q->get_num_no_patterns(), new_no_patterns);
|
||||||
result_pr = nullptr;
|
result_pr = nullptr;
|
||||||
|
|
|
@ -384,7 +384,7 @@ void macro_finder::operator()(unsigned n, justified_expr const* fmls, vector<jus
|
||||||
vector<justified_expr> old_fmls;
|
vector<justified_expr> old_fmls;
|
||||||
_new_fmls.swap(old_fmls);
|
_new_fmls.swap(old_fmls);
|
||||||
SASSERT(_new_fmls.empty());
|
SASSERT(_new_fmls.empty());
|
||||||
if (!expand_macros(old_fmls.size(), old_fmls.c_ptr(), _new_fmls))
|
if (!expand_macros(old_fmls.size(), old_fmls.data(), _new_fmls))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,12 +315,12 @@ struct macro_manager::macro_expander_cfg : public default_rewriter_cfg {
|
||||||
subst_args[nidx] = n->get_arg(i);
|
subst_args[nidx] = n->get_arg(i);
|
||||||
}
|
}
|
||||||
var_subst s(m);
|
var_subst s(m);
|
||||||
expr_ref rr = s(def, num, subst_args.c_ptr());
|
expr_ref rr = s(def, num, subst_args.data());
|
||||||
m_trail.push_back(rr);
|
m_trail.push_back(rr);
|
||||||
r = rr;
|
r = rr;
|
||||||
if (m.proofs_enabled()) {
|
if (m.proofs_enabled()) {
|
||||||
expr_ref instance = s(q->get_expr(), num, subst_args.c_ptr());
|
expr_ref instance = s(q->get_expr(), num, subst_args.data());
|
||||||
proof * qi_pr = m.mk_quant_inst(m.mk_or(m.mk_not(q), instance), num, subst_args.c_ptr());
|
proof * qi_pr = m.mk_quant_inst(m.mk_or(m.mk_not(q), instance), num, subst_args.data());
|
||||||
proof * q_pr = mm.m_decl2macro_pr.find(d);
|
proof * q_pr = mm.m_decl2macro_pr.find(d);
|
||||||
proof * prs[2] = { qi_pr, q_pr };
|
proof * prs[2] = { qi_pr, q_pr };
|
||||||
p = m.mk_unit_resolution(2, prs);
|
p = m.mk_unit_resolution(2, prs);
|
||||||
|
|
|
@ -289,7 +289,7 @@ bool macro_util::is_arith_macro(expr * n, unsigned num_decls, app_ref & head, ex
|
||||||
return false;
|
return false;
|
||||||
head = to_app(h);
|
head = to_app(h);
|
||||||
expr_ref tmp(m_manager);
|
expr_ref tmp(m_manager);
|
||||||
tmp = m_arith.mk_add(args.size(), args.c_ptr());
|
tmp = m_arith.mk_add(args.size(), args.data());
|
||||||
if (inv)
|
if (inv)
|
||||||
mk_sub(tmp, rhs, def);
|
mk_sub(tmp, rhs, def);
|
||||||
else
|
else
|
||||||
|
@ -454,8 +454,8 @@ void macro_util::quasi_macro_head_to_macro_head(app * qhead, unsigned & num_decl
|
||||||
new_args.push_back(new_var);
|
new_args.push_back(new_var);
|
||||||
new_conds.push_back(new_cond);
|
new_conds.push_back(new_cond);
|
||||||
}
|
}
|
||||||
bool_rewriter(m_manager).mk_and(new_conds.size(), new_conds.c_ptr(), cond);
|
bool_rewriter(m_manager).mk_and(new_conds.size(), new_conds.data(), cond);
|
||||||
head = m_manager.mk_app(qhead->get_decl(), new_args.size(), new_args.c_ptr());
|
head = m_manager.mk_app(qhead->get_decl(), new_args.size(), new_args.data());
|
||||||
num_decls = next_var_idx;
|
num_decls = next_var_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,7 +515,7 @@ void macro_util::normalize_expr(app * head, unsigned num_decls, expr * t, expr_r
|
||||||
if (var_mapping[i] != 0)
|
if (var_mapping[i] != 0)
|
||||||
tout << "#" << i << " -> " << mk_ll_pp(var_mapping[i], m_manager);
|
tout << "#" << i << " -> " << mk_ll_pp(var_mapping[i], m_manager);
|
||||||
});
|
});
|
||||||
norm_t = subst(t, var_mapping.size(), var_mapping.c_ptr());
|
norm_t = subst(t, var_mapping.size(), var_mapping.data());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
norm_t = t;
|
norm_t = t;
|
||||||
|
@ -613,7 +613,7 @@ void hint_to_macro_head(ast_manager & m, app * head, unsigned & num_decls, app_r
|
||||||
next_var_idx++;
|
next_var_idx++;
|
||||||
new_args.push_back(new_var);
|
new_args.push_back(new_var);
|
||||||
}
|
}
|
||||||
new_head = m.mk_app(head->get_decl(), new_args.size(), new_args.c_ptr());
|
new_head = m.mk_app(head->get_decl(), new_args.size(), new_args.data());
|
||||||
num_decls = next_var_idx;
|
num_decls = next_var_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,7 +759,7 @@ void macro_util::get_rest_clause_as_cond(expr * except_lit, expr_ref & extra_con
|
||||||
}
|
}
|
||||||
if (neg_other_lits.empty())
|
if (neg_other_lits.empty())
|
||||||
return;
|
return;
|
||||||
bool_rewriter(m_manager).mk_and(neg_other_lits.size(), neg_other_lits.c_ptr(), extra_cond);
|
bool_rewriter(m_manager).mk_and(neg_other_lits.size(), neg_other_lits.data(), extra_cond);
|
||||||
}
|
}
|
||||||
|
|
||||||
void macro_util::collect_poly_args(expr * n, expr * exception, ptr_buffer<expr> & args) {
|
void macro_util::collect_poly_args(expr * n, expr * exception, ptr_buffer<expr> & args) {
|
||||||
|
@ -820,7 +820,7 @@ void macro_util::collect_arith_macro_candidates(expr * lhs, expr * rhs, expr * a
|
||||||
if (_is_arith_macro || _is_poly_hint) {
|
if (_is_arith_macro || _is_poly_hint) {
|
||||||
collect_poly_args(lhs, arg, args);
|
collect_poly_args(lhs, arg, args);
|
||||||
expr_ref rest(m_manager);
|
expr_ref rest(m_manager);
|
||||||
mk_add(args.size(), args.c_ptr(), arg->get_sort(), rest);
|
mk_add(args.size(), args.data(), arg->get_sort(), rest);
|
||||||
expr_ref def(m_manager);
|
expr_ref def(m_manager);
|
||||||
mk_sub(rhs, rest, def);
|
mk_sub(rhs, rest, def);
|
||||||
// If is_poly_hint, rhs may contain variables that do not occur in to_app(arg).
|
// If is_poly_hint, rhs may contain variables that do not occur in to_app(arg).
|
||||||
|
@ -841,7 +841,7 @@ void macro_util::collect_arith_macro_candidates(expr * lhs, expr * rhs, expr * a
|
||||||
if (_is_arith_macro || _is_poly_hint) {
|
if (_is_arith_macro || _is_poly_hint) {
|
||||||
collect_poly_args(lhs, arg, args);
|
collect_poly_args(lhs, arg, args);
|
||||||
expr_ref rest(m_manager);
|
expr_ref rest(m_manager);
|
||||||
mk_add(args.size(), args.c_ptr(), arg->get_sort(), rest);
|
mk_add(args.size(), args.data(), arg->get_sort(), rest);
|
||||||
expr_ref def(m_manager);
|
expr_ref def(m_manager);
|
||||||
mk_sub(rest, rhs, def);
|
mk_sub(rest, rhs, def);
|
||||||
// If is_poly_hint, rhs may contain variables that do not occur in to_app(neg_arg).
|
// If is_poly_hint, rhs may contain variables that do not occur in to_app(neg_arg).
|
||||||
|
|
|
@ -236,18 +236,18 @@ bool quasi_macros::quasi_macro_to_macro(quantifier * q, app * a, expr * t, quant
|
||||||
|
|
||||||
// Macro := Forall m_new_vars . appl = ITE( m_new_eqs, t, f_else)
|
// Macro := Forall m_new_vars . appl = ITE( m_new_eqs, t, f_else)
|
||||||
|
|
||||||
app_ref appl(m.mk_app(f, m_new_vars.size(), m_new_vars.c_ptr()), m);
|
app_ref appl(m.mk_app(f, m_new_vars.size(), m_new_vars.data()), m);
|
||||||
|
|
||||||
func_decl * fd = m.mk_fresh_func_decl(f->get_name(), symbol("else"),
|
func_decl * fd = m.mk_fresh_func_decl(f->get_name(), symbol("else"),
|
||||||
f->get_arity(), f->get_domain(),
|
f->get_arity(), f->get_domain(),
|
||||||
f->get_range());
|
f->get_range());
|
||||||
expr_ref f_else(m.mk_app(fd, m_new_vars.size(), m_new_vars.c_ptr()), m);
|
expr_ref f_else(m.mk_app(fd, m_new_vars.size(), m_new_vars.data()), m);
|
||||||
expr_ref ite(m.mk_ite(m.mk_and(m_new_eqs.size(), m_new_eqs.c_ptr()), t, f_else), m);
|
expr_ref ite(m.mk_ite(m.mk_and(m_new_eqs.size(), m_new_eqs.data()), t, f_else), m);
|
||||||
|
|
||||||
expr_ref eq(m.mk_eq(appl, ite), m);
|
expr_ref eq(m.mk_eq(appl, ite), m);
|
||||||
|
|
||||||
macro = m.mk_quantifier(forall_k, new_var_names_rev.size(),
|
macro = m.mk_quantifier(forall_k, new_var_names_rev.size(),
|
||||||
new_qsorts_rev.c_ptr(), new_var_names_rev.c_ptr(), eq);
|
new_qsorts_rev.data(), new_var_names_rev.data(), eq);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ void quasi_macros::apply_macros(expr_ref_vector & exprs, proof_ref_vector & prs,
|
||||||
|
|
||||||
bool quasi_macros::operator()(expr_ref_vector & exprs, proof_ref_vector & prs, expr_dependency_ref_vector & deps) {
|
bool quasi_macros::operator()(expr_ref_vector & exprs, proof_ref_vector & prs, expr_dependency_ref_vector & deps) {
|
||||||
unsigned n = exprs.size();
|
unsigned n = exprs.size();
|
||||||
if (find_macros(n, exprs.c_ptr())) {
|
if (find_macros(n, exprs.data())) {
|
||||||
apply_macros(exprs, prs, deps);
|
apply_macros(exprs, prs, deps);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,8 +120,8 @@ app * defined_names::impl::gen_name(expr * e, sort_ref_buffer & var_sorts, buffe
|
||||||
}
|
}
|
||||||
|
|
||||||
sort * range = e->get_sort();
|
sort * range = e->get_sort();
|
||||||
func_decl * new_skolem_decl = m.mk_fresh_func_decl(m_z3name, symbol::null, domain.size(), domain.c_ptr(), range);
|
func_decl * new_skolem_decl = m.mk_fresh_func_decl(m_z3name, symbol::null, domain.size(), domain.data(), range);
|
||||||
app * n = m.mk_app(new_skolem_decl, new_args.size(), new_args.c_ptr());
|
app * n = m.mk_app(new_skolem_decl, new_args.size(), new_args.data());
|
||||||
if (is_lambda(e)) {
|
if (is_lambda(e)) {
|
||||||
m.add_lambda_def(new_skolem_decl, to_quantifier(e));
|
m.add_lambda_def(new_skolem_decl, to_quantifier(e));
|
||||||
}
|
}
|
||||||
|
@ -159,8 +159,8 @@ void defined_names::impl::bound_vars(sort_ref_buffer const & sorts, buffer<symbo
|
||||||
expr * patterns[1] = { m.mk_pattern(name) };
|
expr * patterns[1] = { m.mk_pattern(name) };
|
||||||
quantifier_ref q(m);
|
quantifier_ref q(m);
|
||||||
q = m.mk_forall(sorts.size(),
|
q = m.mk_forall(sorts.size(),
|
||||||
sorts.c_ptr(),
|
sorts.data(),
|
||||||
names.c_ptr(),
|
names.data(),
|
||||||
def_conjunct,
|
def_conjunct,
|
||||||
1, qid, symbol::null,
|
1, qid, symbol::null,
|
||||||
1, patterns);
|
1, patterns);
|
||||||
|
@ -223,10 +223,10 @@ void defined_names::impl::mk_definition(expr * e, app * n, sort_ref_buffer & var
|
||||||
array_util autil(m);
|
array_util autil(m);
|
||||||
func_decl * f = nullptr;
|
func_decl * f = nullptr;
|
||||||
if (autil.is_as_array(n2, f)) {
|
if (autil.is_as_array(n2, f)) {
|
||||||
n3 = m.mk_app(f, args.size()-1, args.c_ptr() + 1);
|
n3 = m.mk_app(f, args.size()-1, args.data() + 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
n3 = autil.mk_select(args.size(), args.c_ptr());
|
n3 = autil.mk_select(args.size(), args.data());
|
||||||
}
|
}
|
||||||
bound_vars(var_sorts, var_names, MK_EQ(q->get_expr(), n3), to_app(n3), defs, m.lambda_def_qid());
|
bound_vars(var_sorts, var_names, MK_EQ(q->get_expr(), n3), to_app(n3), defs, m.lambda_def_qid());
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ void defined_names::impl::mk_definition(expr * e, app * n, sort_ref_buffer & var
|
||||||
else {
|
else {
|
||||||
bound_vars(var_sorts, var_names, MK_EQ(e, n), n, defs);
|
bound_vars(var_sorts, var_names, MK_EQ(e, n), n, defs);
|
||||||
}
|
}
|
||||||
new_def = mk_and(m, defs.size(), defs.c_ptr());
|
new_def = mk_and(m, defs.size(), defs.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -266,8 +266,8 @@ bool defined_names::impl::mk_name(expr * e, expr_ref & new_def, proof_ref & new_
|
||||||
|
|
||||||
TRACE("mk_definition_bug", tout << "name: " << mk_ismt2_pp(n, m) << "\n";);
|
TRACE("mk_definition_bug", tout << "name: " << mk_ismt2_pp(n, m) << "\n";);
|
||||||
// variables are in reverse order in quantifiers
|
// variables are in reverse order in quantifiers
|
||||||
std::reverse(var_sorts.c_ptr(), var_sorts.c_ptr() + var_sorts.size());
|
std::reverse(var_sorts.data(), var_sorts.data() + var_sorts.size());
|
||||||
std::reverse(var_names.c_ptr(), var_names.c_ptr() + var_names.size());
|
std::reverse(var_names.data(), var_names.data() + var_names.size());
|
||||||
|
|
||||||
mk_definition(e, n, var_sorts, var_names, new_def);
|
mk_definition(e, n, var_sorts, var_names, new_def);
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,8 @@ class skolemizer {
|
||||||
for (unsigned i = num_decls; i > 0; ) {
|
for (unsigned i = num_decls; i > 0; ) {
|
||||||
--i;
|
--i;
|
||||||
sort * r = q->get_decl_sort(i);
|
sort * r = q->get_decl_sort(i);
|
||||||
func_decl * sk_decl = m.mk_fresh_func_decl(q->get_decl_name(i), q->get_skid(), sorts.size(), sorts.c_ptr(), r);
|
func_decl * sk_decl = m.mk_fresh_func_decl(q->get_decl_name(i), q->get_skid(), sorts.size(), sorts.data(), r);
|
||||||
app * sk = m.mk_app(sk_decl, args.size(), args.c_ptr());
|
app * sk = m.mk_app(sk_decl, args.size(), args.data());
|
||||||
substitution.push_back(sk);
|
substitution.push_back(sk);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -121,7 +121,7 @@ class skolemizer {
|
||||||
// (VAR num_decls) ... (VAR num_decls+sz-1)
|
// (VAR num_decls) ... (VAR num_decls+sz-1)
|
||||||
// are in positions num_decls .. num_decls+sz-1
|
// are in positions num_decls .. num_decls+sz-1
|
||||||
//
|
//
|
||||||
std::reverse(substitution.c_ptr(), substitution.c_ptr() + substitution.size());
|
std::reverse(substitution.data(), substitution.data() + substitution.size());
|
||||||
//
|
//
|
||||||
// (VAR 0) should be in the last position of substitution.
|
// (VAR 0) should be in the last position of substitution.
|
||||||
//
|
//
|
||||||
|
@ -464,14 +464,14 @@ struct nnf::imp {
|
||||||
}
|
}
|
||||||
app * r;
|
app * r;
|
||||||
if (m.is_and(t) == fr.m_pol)
|
if (m.is_and(t) == fr.m_pol)
|
||||||
r = m.mk_and(t->get_num_args(), m_result_stack.c_ptr() + fr.m_spos);
|
r = m.mk_and(t->get_num_args(), m_result_stack.data() + fr.m_spos);
|
||||||
else
|
else
|
||||||
r = m.mk_or(t->get_num_args(), m_result_stack.c_ptr() + fr.m_spos);
|
r = m.mk_or(t->get_num_args(), m_result_stack.data() + fr.m_spos);
|
||||||
|
|
||||||
m_result_stack.shrink(fr.m_spos);
|
m_result_stack.shrink(fr.m_spos);
|
||||||
m_result_stack.push_back(r);
|
m_result_stack.push_back(r);
|
||||||
if (proofs_enabled()) {
|
if (proofs_enabled()) {
|
||||||
proof * pr = mk_proof(fr.m_pol, t->get_num_args(), m_result_pr_stack.c_ptr() + fr.m_spos, t, r);
|
proof * pr = mk_proof(fr.m_pol, t->get_num_args(), m_result_pr_stack.data() + fr.m_spos, t, r);
|
||||||
m_result_pr_stack.shrink(fr.m_spos);
|
m_result_pr_stack.shrink(fr.m_spos);
|
||||||
m_result_pr_stack.push_back(pr);
|
m_result_pr_stack.push_back(pr);
|
||||||
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
||||||
|
@ -516,14 +516,14 @@ struct nnf::imp {
|
||||||
|
|
||||||
app * r;
|
app * r;
|
||||||
if (fr.m_pol)
|
if (fr.m_pol)
|
||||||
r = m.mk_or(2, m_result_stack.c_ptr() + fr.m_spos);
|
r = m.mk_or(2, m_result_stack.data() + fr.m_spos);
|
||||||
else
|
else
|
||||||
r = m.mk_and(2, m_result_stack.c_ptr() + fr.m_spos);
|
r = m.mk_and(2, m_result_stack.data() + fr.m_spos);
|
||||||
|
|
||||||
m_result_stack.shrink(fr.m_spos);
|
m_result_stack.shrink(fr.m_spos);
|
||||||
m_result_stack.push_back(r);
|
m_result_stack.push_back(r);
|
||||||
if (proofs_enabled()) {
|
if (proofs_enabled()) {
|
||||||
proof * pr = mk_proof(fr.m_pol, 2, m_result_pr_stack.c_ptr() + fr.m_spos, t, r);
|
proof * pr = mk_proof(fr.m_pol, 2, m_result_pr_stack.data() + fr.m_spos, t, r);
|
||||||
m_result_pr_stack.shrink(fr.m_spos);
|
m_result_pr_stack.shrink(fr.m_spos);
|
||||||
m_result_pr_stack.push_back(pr);
|
m_result_pr_stack.push_back(pr);
|
||||||
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
||||||
|
@ -554,7 +554,7 @@ struct nnf::imp {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
expr * const * rs = m_result_stack.c_ptr() + fr.m_spos;
|
expr * const * rs = m_result_stack.data() + fr.m_spos;
|
||||||
expr * _cond = rs[0];
|
expr * _cond = rs[0];
|
||||||
expr * _not_cond = rs[1];
|
expr * _not_cond = rs[1];
|
||||||
expr * _then = rs[2];
|
expr * _then = rs[2];
|
||||||
|
@ -564,7 +564,7 @@ struct nnf::imp {
|
||||||
m_result_stack.shrink(fr.m_spos);
|
m_result_stack.shrink(fr.m_spos);
|
||||||
m_result_stack.push_back(r);
|
m_result_stack.push_back(r);
|
||||||
if (proofs_enabled()) {
|
if (proofs_enabled()) {
|
||||||
proof * pr = mk_proof(fr.m_pol, 4, m_result_pr_stack.c_ptr() + fr.m_spos, t, r);
|
proof * pr = mk_proof(fr.m_pol, 4, m_result_pr_stack.data() + fr.m_spos, t, r);
|
||||||
m_result_pr_stack.shrink(fr.m_spos);
|
m_result_pr_stack.shrink(fr.m_spos);
|
||||||
m_result_pr_stack.push_back(pr);
|
m_result_pr_stack.push_back(pr);
|
||||||
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
||||||
|
@ -598,7 +598,7 @@ struct nnf::imp {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
expr * const * rs = m_result_stack.c_ptr() + fr.m_spos;
|
expr * const * rs = m_result_stack.data() + fr.m_spos;
|
||||||
expr * lhs = rs[0];
|
expr * lhs = rs[0];
|
||||||
expr * not_lhs = rs[1];
|
expr * not_lhs = rs[1];
|
||||||
expr * rhs = rs[2];
|
expr * rhs = rs[2];
|
||||||
|
@ -612,7 +612,7 @@ struct nnf::imp {
|
||||||
m_result_stack.shrink(fr.m_spos);
|
m_result_stack.shrink(fr.m_spos);
|
||||||
m_result_stack.push_back(r);
|
m_result_stack.push_back(r);
|
||||||
if (proofs_enabled()) {
|
if (proofs_enabled()) {
|
||||||
proof * pr = mk_proof(fr.m_pol, 4, m_result_pr_stack.c_ptr() + fr.m_spos, t, r);
|
proof * pr = mk_proof(fr.m_pol, 4, m_result_pr_stack.data() + fr.m_spos, t, r);
|
||||||
m_result_pr_stack.shrink(fr.m_spos);
|
m_result_pr_stack.shrink(fr.m_spos);
|
||||||
m_result_pr_stack.push_back(pr);
|
m_result_pr_stack.push_back(pr);
|
||||||
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
SASSERT(m_result_stack.size() == m_result_pr_stack.size());
|
||||||
|
@ -675,11 +675,11 @@ struct nnf::imp {
|
||||||
expr_ref r(m);
|
expr_ref r(m);
|
||||||
proof_ref pr(m);
|
proof_ref pr(m);
|
||||||
if (fr.m_pol == pos) {
|
if (fr.m_pol == pos) {
|
||||||
expr * lbl_lit = m.mk_label_lit(names.size(), names.c_ptr());
|
expr * lbl_lit = m.mk_label_lit(names.size(), names.data());
|
||||||
r = m.mk_and(arg, lbl_lit);
|
r = m.mk_and(arg, lbl_lit);
|
||||||
if (proofs_enabled()) {
|
if (proofs_enabled()) {
|
||||||
expr_ref aux(m);
|
expr_ref aux(m);
|
||||||
aux = m.mk_label(true, names.size(), names.c_ptr(), arg);
|
aux = m.mk_label(true, names.size(), names.data(), arg);
|
||||||
pr = m.mk_transitivity(mk_proof(fr.m_pol, 1, &arg_pr, t, to_app(aux)),
|
pr = m.mk_transitivity(mk_proof(fr.m_pol, 1, &arg_pr, t, to_app(aux)),
|
||||||
m.mk_iff_oeq(m.mk_rewrite(aux, r)));
|
m.mk_iff_oeq(m.mk_rewrite(aux, r)));
|
||||||
}
|
}
|
||||||
|
@ -786,7 +786,7 @@ struct nnf::imp {
|
||||||
quantifier * new_q = nullptr;
|
quantifier * new_q = nullptr;
|
||||||
proof * new_q_pr = nullptr;
|
proof * new_q_pr = nullptr;
|
||||||
if (fr.m_pol) {
|
if (fr.m_pol) {
|
||||||
new_q = m.update_quantifier(q, new_patterns.size(), new_patterns.c_ptr(), new_expr);
|
new_q = m.update_quantifier(q, new_patterns.size(), new_patterns.data(), new_expr);
|
||||||
if (proofs_enabled()) {
|
if (proofs_enabled()) {
|
||||||
new_expr_pr = m.mk_bind_proof(q, new_expr_pr);
|
new_expr_pr = m.mk_bind_proof(q, new_expr_pr);
|
||||||
new_q_pr = m.mk_nnf_pos(q, new_q, 1, &new_expr_pr);
|
new_q_pr = m.mk_nnf_pos(q, new_q, 1, &new_expr_pr);
|
||||||
|
@ -794,7 +794,7 @@ struct nnf::imp {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
quantifier_kind k = is_forall(q)? exists_k : forall_k;
|
quantifier_kind k = is_forall(q)? exists_k : forall_k;
|
||||||
new_q = m.update_quantifier(q, k, new_patterns.size(), new_patterns.c_ptr(), new_expr);
|
new_q = m.update_quantifier(q, k, new_patterns.size(), new_patterns.data(), new_expr);
|
||||||
if (proofs_enabled()) {
|
if (proofs_enabled()) {
|
||||||
new_expr_pr = m.mk_bind_proof(q, new_expr_pr);
|
new_expr_pr = m.mk_bind_proof(q, new_expr_pr);
|
||||||
new_q_pr = m.mk_nnf_neg(q, new_q, 1, &new_expr_pr);
|
new_q_pr = m.mk_nnf_neg(q, new_q, 1, &new_expr_pr);
|
||||||
|
@ -898,8 +898,8 @@ struct nnf::imp {
|
||||||
new_def_proofs.push_back(new_pr);
|
new_def_proofs.push_back(new_pr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::reverse(new_defs.c_ptr() + old_sz1, new_defs.c_ptr() + new_defs.size());
|
std::reverse(new_defs.data() + old_sz1, new_defs.data() + new_defs.size());
|
||||||
std::reverse(new_def_proofs.c_ptr() + old_sz2, new_def_proofs.c_ptr() + new_def_proofs.size());
|
std::reverse(new_def_proofs.data() + old_sz2, new_def_proofs.data() + new_def_proofs.size());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -150,9 +150,9 @@ struct pull_quant::imp {
|
||||||
std::reverse(var_names.begin(), var_names.end());
|
std::reverse(var_names.begin(), var_names.end());
|
||||||
result = m.mk_quantifier(forall_children ? forall_k : exists_k,
|
result = m.mk_quantifier(forall_children ? forall_k : exists_k,
|
||||||
var_sorts.size(),
|
var_sorts.size(),
|
||||||
var_sorts.c_ptr(),
|
var_sorts.data(),
|
||||||
var_names.c_ptr(),
|
var_names.data(),
|
||||||
m.mk_app(d, new_adjusted_children.size(), new_adjusted_children.c_ptr()),
|
m.mk_app(d, new_adjusted_children.size(), new_adjusted_children.data()),
|
||||||
w,
|
w,
|
||||||
qid);
|
qid);
|
||||||
return true;
|
return true;
|
||||||
|
@ -184,8 +184,8 @@ struct pull_quant::imp {
|
||||||
// Remark: patterns are ignored.
|
// Remark: patterns are ignored.
|
||||||
// See comment in reduce1_app
|
// See comment in reduce1_app
|
||||||
result = m.mk_forall(var_sorts.size(),
|
result = m.mk_forall(var_sorts.size(),
|
||||||
var_sorts.c_ptr(),
|
var_sorts.data(),
|
||||||
var_names.c_ptr(),
|
var_names.data(),
|
||||||
nested_q->get_expr(),
|
nested_q->get_expr(),
|
||||||
std::min(q->get_weight(), nested_q->get_weight()),
|
std::min(q->get_weight(), nested_q->get_weight()),
|
||||||
q->get_qid());
|
q->get_qid());
|
||||||
|
@ -225,10 +225,10 @@ struct pull_quant::imp {
|
||||||
if (new_arg != arg)
|
if (new_arg != arg)
|
||||||
proofs.push_back(m.mk_pull_quant(arg, to_quantifier(new_arg)));
|
proofs.push_back(m.mk_pull_quant(arg, to_quantifier(new_arg)));
|
||||||
}
|
}
|
||||||
pull_quant1(to_app(n)->get_decl(), new_args.size(), new_args.c_ptr(), r);
|
pull_quant1(to_app(n)->get_decl(), new_args.size(), new_args.data(), r);
|
||||||
if (m.proofs_enabled()) {
|
if (m.proofs_enabled()) {
|
||||||
app * r1 = m.mk_app(to_app(n)->get_decl(), new_args.size(), new_args.c_ptr());
|
app * r1 = m.mk_app(to_app(n)->get_decl(), new_args.size(), new_args.data());
|
||||||
proof * p1 = proofs.empty() ? nullptr : m.mk_congruence(to_app(n), r1, proofs.size(), proofs.c_ptr());
|
proof * p1 = proofs.empty() ? nullptr : m.mk_congruence(to_app(n), r1, proofs.size(), proofs.data());
|
||||||
proof * p2 = r1 == r ? nullptr : m.mk_pull_quant(r1, to_quantifier(r));
|
proof * p2 = r1 == r ? nullptr : m.mk_pull_quant(r1, to_quantifier(r));
|
||||||
pr = m.mk_transitivity(p1, p2);
|
pr = m.mk_transitivity(p1, p2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,10 +96,10 @@ class expr_pattern_match {
|
||||||
args.push_back(arg);
|
args.push_back(arg);
|
||||||
}
|
}
|
||||||
if (m_manager.is_pattern(n)) {
|
if (m_manager.is_pattern(n)) {
|
||||||
result = m_manager.mk_pattern(num_args, reinterpret_cast<app**>(args.c_ptr()));
|
result = m_manager.mk_pattern(num_args, reinterpret_cast<app**>(args.data()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = m_manager.mk_app(decl, num_args, args.c_ptr());
|
result = m_manager.mk_app(decl, num_args, args.data());
|
||||||
}
|
}
|
||||||
m_pinned.push_back(result);
|
m_pinned.push_back(result);
|
||||||
m_memoize.insert(n, result);
|
m_memoize.insert(n, result);
|
||||||
|
|
|
@ -232,7 +232,7 @@ void pattern_inference_cfg::collect::save_candidate(expr * n, unsigned delta) {
|
||||||
|
|
||||||
app * new_node = nullptr;
|
app * new_node = nullptr;
|
||||||
if (changed)
|
if (changed)
|
||||||
new_node = m.mk_app(decl, buffer.size(), buffer.c_ptr());
|
new_node = m.mk_app(decl, buffer.size(), buffer.data());
|
||||||
else
|
else
|
||||||
new_node = to_app(n);
|
new_node = to_app(n);
|
||||||
save(n, delta, alloc(info, m, new_node, free_vars, size));
|
save(n, delta, alloc(info, m, new_node, free_vars, size));
|
||||||
|
@ -442,7 +442,7 @@ void pattern_inference_cfg::candidates2multi_patterns(unsigned max_num_patterns,
|
||||||
for (unsigned j = 0; j < m_pre_patterns.size(); j++) {
|
for (unsigned j = 0; j < m_pre_patterns.size(); j++) {
|
||||||
pre_pattern * curr = m_pre_patterns[j];
|
pre_pattern * curr = m_pre_patterns[j];
|
||||||
if (curr->m_free_vars.num_elems() == m_num_bindings) {
|
if (curr->m_free_vars.num_elems() == m_num_bindings) {
|
||||||
app * new_pattern = m.mk_pattern(curr->m_exprs.size(), curr->m_exprs.c_ptr());
|
app * new_pattern = m.mk_pattern(curr->m_exprs.size(), curr->m_exprs.data());
|
||||||
result.push_back(new_pattern);
|
result.push_back(new_pattern);
|
||||||
if (result.size() >= max_num_patterns)
|
if (result.size() >= max_num_patterns)
|
||||||
return;
|
return;
|
||||||
|
@ -601,7 +601,7 @@ bool pattern_inference_cfg::reduce_quantifier(
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
quantifier_ref tmp(m);
|
quantifier_ref tmp(m);
|
||||||
tmp = m.update_quantifier(q, new_patterns.size(), (expr**) new_patterns.c_ptr(), q->get_expr());
|
tmp = m.update_quantifier(q, new_patterns.size(), (expr**) new_patterns.data(), q->get_expr());
|
||||||
result = m.update_quantifier_weight(tmp, new_weight);
|
result = m.update_quantifier_weight(tmp, new_weight);
|
||||||
TRACE("pattern_inference", tout << "found patterns in database, weight: " << new_weight << "\n" << mk_pp(result, m) << "\n";);
|
TRACE("pattern_inference", tout << "found patterns in database, weight: " << new_weight << "\n" << mk_pp(result, m) << "\n";);
|
||||||
}
|
}
|
||||||
|
@ -670,7 +670,7 @@ bool pattern_inference_cfg::reduce_quantifier(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quantifier_ref new_q(m.update_quantifier(q, new_patterns.size(), (expr**) new_patterns.c_ptr(), new_body), m);
|
quantifier_ref new_q(m.update_quantifier(q, new_patterns.size(), (expr**) new_patterns.data(), new_body), m);
|
||||||
if (weight != q->get_weight())
|
if (weight != q->get_weight())
|
||||||
new_q = m.update_quantifier_weight(new_q, weight);
|
new_q = m.update_quantifier_weight(new_q, weight);
|
||||||
if (m.proofs_enabled()) {
|
if (m.proofs_enabled()) {
|
||||||
|
@ -692,7 +692,7 @@ bool pattern_inference_cfg::reduce_quantifier(
|
||||||
auto str = q->get_qid().str();
|
auto str = q->get_qid().str();
|
||||||
warning_msg("pulled nested quantifier to be able to find an usable pattern (quantifier id: %s)", str.c_str());
|
warning_msg("pulled nested quantifier to be able to find an usable pattern (quantifier id: %s)", str.c_str());
|
||||||
}
|
}
|
||||||
new_q = m.update_quantifier(result2, new_patterns.size(), (expr**) new_patterns.c_ptr(), result2->get_expr());
|
new_q = m.update_quantifier(result2, new_patterns.size(), (expr**) new_patterns.data(), result2->get_expr());
|
||||||
if (m.proofs_enabled()) {
|
if (m.proofs_enabled()) {
|
||||||
result_pr = m.mk_transitivity(new_pr, m.mk_quant_intro(result2, new_q, m.mk_bind_proof(new_q, m.mk_reflexivity(new_q->get_expr()))));
|
result_pr = m.mk_transitivity(new_pr, m.mk_quant_intro(result2, new_q, m.mk_bind_proof(new_q, m.mk_reflexivity(new_q->get_expr()))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ func_decl * pb_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, p
|
||||||
m.raise_exception("functions 'pble/pbge/pbeq' expect arity+1 integer parameters");
|
m.raise_exception("functions 'pble/pbge/pbeq' expect arity+1 integer parameters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func_decl_info info(m_family_id, k, num_parameters, params.c_ptr());
|
func_decl_info info(m_family_id, k, num_parameters, params.data());
|
||||||
return m.mk_func_decl(sym, arity, domain, m.mk_bool_sort(), info);
|
return m.mk_func_decl(sym, arity, domain, m.mk_bool_sort(), info);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -136,9 +136,9 @@ app * pb_util::mk_le(unsigned num_args, rational const * coeffs, expr * const *
|
||||||
}
|
}
|
||||||
if (all_ones && k.is_unsigned() && floor(m_k).is_int32()) {
|
if (all_ones && k.is_unsigned() && floor(m_k).is_int32()) {
|
||||||
m_params[0] = parameter(floor(m_k).get_int32());
|
m_params[0] = parameter(floor(m_k).get_int32());
|
||||||
return m.mk_app(m_fid, OP_AT_MOST_K, 1, m_params.c_ptr(), num_args, args, m.mk_bool_sort());
|
return m.mk_app(m_fid, OP_AT_MOST_K, 1, m_params.data(), num_args, args, m.mk_bool_sort());
|
||||||
}
|
}
|
||||||
return m.mk_app(m_fid, OP_PB_LE, m_params.size(), m_params.c_ptr(), num_args, args, m.mk_bool_sort());
|
return m.mk_app(m_fid, OP_PB_LE, m_params.size(), m_params.data(), num_args, args, m.mk_bool_sort());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * pb_util::mk_ge(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k) {
|
app * pb_util::mk_ge(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k) {
|
||||||
|
@ -152,9 +152,9 @@ app * pb_util::mk_ge(unsigned num_args, rational const * coeffs, expr * const *
|
||||||
}
|
}
|
||||||
if (all_ones && k.is_unsigned()) {
|
if (all_ones && k.is_unsigned()) {
|
||||||
m_params[0] = parameter(ceil(m_k).get_unsigned());
|
m_params[0] = parameter(ceil(m_k).get_unsigned());
|
||||||
return m.mk_app(m_fid, OP_AT_LEAST_K, 1, m_params.c_ptr(), num_args, args, m.mk_bool_sort());
|
return m.mk_app(m_fid, OP_AT_LEAST_K, 1, m_params.data(), num_args, args, m.mk_bool_sort());
|
||||||
}
|
}
|
||||||
return m.mk_app(m_fid, OP_PB_GE, m_params.size(), m_params.c_ptr(), num_args, args, m.mk_bool_sort());
|
return m.mk_app(m_fid, OP_PB_GE, m_params.size(), m_params.data(), num_args, args, m.mk_bool_sort());
|
||||||
}
|
}
|
||||||
|
|
||||||
app * pb_util::mk_eq(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k) {
|
app * pb_util::mk_eq(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k) {
|
||||||
|
@ -170,7 +170,7 @@ app * pb_util::mk_eq(unsigned num_args, rational const * coeffs, expr * const *
|
||||||
for (unsigned i = 0; i < num_args; ++i) {
|
for (unsigned i = 0; i < num_args; ++i) {
|
||||||
m_params.push_back(parameter(m_coeffs[i]));
|
m_params.push_back(parameter(m_coeffs[i]));
|
||||||
}
|
}
|
||||||
return m.mk_app(m_fid, OP_PB_EQ, m_params.size(), m_params.c_ptr(), num_args, args, m.mk_bool_sort());
|
return m.mk_app(m_fid, OP_PB_EQ, m_params.size(), m_params.data(), num_args, args, m.mk_bool_sort());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ax + by < k
|
// ax + by < k
|
||||||
|
@ -190,7 +190,7 @@ app * pb_util::mk_lt(unsigned num_args, rational const * _coeffs, expr * const *
|
||||||
for (unsigned i = 0; i < num_args; ++i) {
|
for (unsigned i = 0; i < num_args; ++i) {
|
||||||
m_k += m_coeffs[i];
|
m_k += m_coeffs[i];
|
||||||
}
|
}
|
||||||
return mk_ge(num_args, m_coeffs.c_ptr(), args.c_ptr(), m_k);
|
return mk_ge(num_args, m_coeffs.data(), args.data(), m_k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,8 @@ public:
|
||||||
family_id get_family_id() const { return m_fid; }
|
family_id get_family_id() const { return m_fid; }
|
||||||
app * mk_at_most_k(unsigned num_args, expr * const * args, unsigned k);
|
app * mk_at_most_k(unsigned num_args, expr * const * args, unsigned k);
|
||||||
app * mk_at_least_k(unsigned num_args, expr * const * args, unsigned k);
|
app * mk_at_least_k(unsigned num_args, expr * const * args, unsigned k);
|
||||||
app * mk_at_most_k(expr_ref_vector const& args, unsigned k) { return mk_at_most_k(args.size(), args.c_ptr(), k); }
|
app * mk_at_most_k(expr_ref_vector const& args, unsigned k) { return mk_at_most_k(args.size(), args.data(), k); }
|
||||||
app * mk_at_least_k(expr_ref_vector const& args, unsigned k) { return mk_at_least_k(args.size(), args.c_ptr(), k); }
|
app * mk_at_least_k(expr_ref_vector const& args, unsigned k) { return mk_at_least_k(args.size(), args.data(), k); }
|
||||||
app * mk_le(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k);
|
app * mk_le(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k);
|
||||||
app * mk_ge(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k);
|
app * mk_ge(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k);
|
||||||
app * mk_eq(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k);
|
app * mk_eq(unsigned num_args, rational const * coeffs, expr * const * args, rational const& k);
|
||||||
|
|
|
@ -431,7 +431,7 @@ bool proof_checker::check1_basic(proof* p, expr_ref_vector& side_conditions) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expr_ref rewrite_cond(m);
|
expr_ref rewrite_cond(m);
|
||||||
rewrite_cond = m.mk_or(rewrite_eq.size(), rewrite_eq.c_ptr());
|
rewrite_cond = m.mk_or(rewrite_eq.size(), rewrite_eq.data());
|
||||||
side_conditions.push_back(rewrite_cond.get());
|
side_conditions.push_back(rewrite_cond.get());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -788,7 +788,7 @@ bool proof_checker::check1_basic(proof* p, expr_ref_vector& side_conditions) {
|
||||||
// SASSERT(to_quantifier(premise)->get_num_decls() == sub.size());
|
// SASSERT(to_quantifier(premise)->get_num_decls() == sub.size());
|
||||||
premise = to_quantifier(premise)->get_expr();
|
premise = to_quantifier(premise)->get_expr();
|
||||||
}
|
}
|
||||||
premise = vs(premise, sub.size(), sub.c_ptr());
|
premise = vs(premise, sub.size(), sub.data());
|
||||||
}
|
}
|
||||||
fmls.push_back(premise.get());
|
fmls.push_back(premise.get());
|
||||||
TRACE("proof_checker",
|
TRACE("proof_checker",
|
||||||
|
@ -819,7 +819,7 @@ bool proof_checker::check1_basic(proof* p, expr_ref_vector& side_conditions) {
|
||||||
fmls[i] = premise1;
|
fmls[i] = premise1;
|
||||||
}
|
}
|
||||||
fmls[0] = premise0;
|
fmls[0] = premise0;
|
||||||
premise0 = m.mk_or(fmls.size(), fmls.c_ptr());
|
premise0 = m.mk_or(fmls.size(), fmls.data());
|
||||||
if (is_forall(conclusion)) {
|
if (is_forall(conclusion)) {
|
||||||
quantifier* q = to_quantifier(conclusion);
|
quantifier* q = to_quantifier(conclusion);
|
||||||
premise0 = m.mk_iff(premise0, q->get_expr());
|
premise0 = m.mk_iff(premise0, q->get_expr());
|
||||||
|
@ -861,7 +861,7 @@ void proof_checker::set_false(expr_ref& e, unsigned position, expr_ref& lit) {
|
||||||
args.append(a->get_num_args(), a->get_args());
|
args.append(a->get_num_args(), a->get_args());
|
||||||
lit = args[position].get();
|
lit = args[position].get();
|
||||||
args[position] = m.mk_false();
|
args[position] = m.mk_false();
|
||||||
e = m.mk_or(args.size(), args.c_ptr());
|
e = m.mk_or(args.size(), args.data());
|
||||||
}
|
}
|
||||||
else if (m.is_implies(e, body, head)) {
|
else if (m.is_implies(e, body, head)) {
|
||||||
expr* const* heads = &head;
|
expr* const* heads = &head;
|
||||||
|
@ -880,14 +880,14 @@ void proof_checker::set_false(expr_ref& e, unsigned position, expr_ref& lit) {
|
||||||
args.append(num_heads, heads);
|
args.append(num_heads, heads);
|
||||||
lit = args[position].get();
|
lit = args[position].get();
|
||||||
args[position] = m.mk_false();
|
args[position] = m.mk_false();
|
||||||
e = m.mk_implies(body, m.mk_or(args.size(), args.c_ptr()));
|
e = m.mk_implies(body, m.mk_or(args.size(), args.data()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
position -= num_heads;
|
position -= num_heads;
|
||||||
args.append(num_bodies, bodies);
|
args.append(num_bodies, bodies);
|
||||||
lit = m.mk_not(args[position].get());
|
lit = m.mk_not(args[position].get());
|
||||||
args[position] = m.mk_true();
|
args[position] = m.mk_true();
|
||||||
e = m.mk_implies(m.mk_and(args.size(), args.c_ptr()), head);
|
e = m.mk_implies(m.mk_and(args.size(), args.data()), head);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (position == 0) {
|
else if (position == 0) {
|
||||||
|
@ -1112,7 +1112,7 @@ void proof_checker::get_hypotheses(proof* p, expr_ref_vector& ante) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (all_found) {
|
if (all_found) {
|
||||||
h = mk_hyp(hyps.size(), hyps.c_ptr());
|
h = mk_hyp(hyps.size(), hyps.data());
|
||||||
m_pinned.push_back(h);
|
m_pinned.push_back(h);
|
||||||
m_hypotheses.insert(p, h);
|
m_hypotheses.insert(p, h);
|
||||||
stack.pop_back();
|
stack.pop_back();
|
||||||
|
@ -1241,7 +1241,7 @@ void proof_checker::dump_proof(proof const* pr) {
|
||||||
SASSERT(m.has_fact(a));
|
SASSERT(m.has_fact(a));
|
||||||
antecedents.push_back(m.get_fact(a));
|
antecedents.push_back(m.get_fact(a));
|
||||||
}
|
}
|
||||||
dump_proof(antecedents.size(), antecedents.c_ptr(), consequent);
|
dump_proof(antecedents.size(), antecedents.data(), consequent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void proof_checker::dump_proof(unsigned num_antecedents, expr * const * antecedents, expr * consequent) {
|
void proof_checker::dump_proof(unsigned num_antecedents, expr * const * antecedents, expr * consequent) {
|
||||||
|
|
|
@ -192,13 +192,13 @@ class reduce_hypotheses {
|
||||||
compute_mark1(res);
|
compute_mark1(res);
|
||||||
} else if (m.is_unit_resolution(p)) {
|
} else if (m.is_unit_resolution(p)) {
|
||||||
// unit: reduce units; reduce the first premise; rebuild unit resolution
|
// unit: reduce units; reduce the first premise; rebuild unit resolution
|
||||||
res = mk_unit_resolution_core(args.size(), args.c_ptr());
|
res = mk_unit_resolution_core(args.size(), args.data());
|
||||||
compute_mark1(res);
|
compute_mark1(res);
|
||||||
} else {
|
} else {
|
||||||
// other: reduce all premises; reapply
|
// other: reduce all premises; reapply
|
||||||
if (m.has_fact(p)) { args.push_back(to_app(m.get_fact(p))); }
|
if (m.has_fact(p)) { args.push_back(to_app(m.get_fact(p))); }
|
||||||
SASSERT(p->get_decl()->get_arity() == args.size());
|
SASSERT(p->get_decl()->get_arity() == args.size());
|
||||||
res = m.mk_app(p->get_decl(), args.size(), (expr * const*)args.c_ptr());
|
res = m.mk_app(p->get_decl(), args.size(), (expr * const*)args.data());
|
||||||
compute_mark1(res);
|
compute_mark1(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ class reduce_hypotheses {
|
||||||
if (args.empty()) {
|
if (args.empty()) {
|
||||||
return pf;
|
return pf;
|
||||||
}
|
}
|
||||||
lemma = mk_or(m, args.size(), args.c_ptr());
|
lemma = mk_or(m, args.size(), args.data());
|
||||||
proof* res = m.mk_lemma(pf, lemma);
|
proof* res = m.mk_lemma(pf, lemma);
|
||||||
m_pinned.push_back(res);
|
m_pinned.push_back(res);
|
||||||
|
|
||||||
|
@ -280,10 +280,10 @@ class reduce_hypotheses {
|
||||||
|
|
||||||
SASSERT(new_fact_cls.size() + pf_args.size() - 1 == cls.size());
|
SASSERT(new_fact_cls.size() + pf_args.size() - 1 == cls.size());
|
||||||
expr_ref new_fact(m);
|
expr_ref new_fact(m);
|
||||||
new_fact = mk_or(m, new_fact_cls.size(), new_fact_cls.c_ptr());
|
new_fact = mk_or(m, new_fact_cls.size(), new_fact_cls.data());
|
||||||
|
|
||||||
// create new proof step
|
// create new proof step
|
||||||
proof *res = m.mk_unit_resolution(pf_args.size(), pf_args.c_ptr(), new_fact);
|
proof *res = m.mk_unit_resolution(pf_args.size(), pf_args.data(), new_fact);
|
||||||
m_pinned.push_back(res);
|
m_pinned.push_back(res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -556,7 +556,7 @@ public:
|
||||||
clause = m_literals[0];
|
clause = m_literals[0];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
clause = m.mk_or(m_literals.size(), m_literals.c_ptr());
|
clause = m.mk_or(m_literals.size(), m_literals.data());
|
||||||
}
|
}
|
||||||
tmp = m.mk_lemma(tmp, clause);
|
tmp = m.mk_lemma(tmp, clause);
|
||||||
m_refs.push_back(tmp);
|
m_refs.push_back(tmp);
|
||||||
|
@ -642,7 +642,7 @@ public:
|
||||||
if (m.is_complement(clause, m.get_fact(parents[i].get()))) {
|
if (m.is_complement(clause, m.get_fact(parents[i].get()))) {
|
||||||
parents[1] = parents[i].get();
|
parents[1] = parents[i].get();
|
||||||
parents.resize(2);
|
parents.resize(2);
|
||||||
result = m.mk_unit_resolution(parents.size(), parents.c_ptr());
|
result = m.mk_unit_resolution(parents.size(), parents.data());
|
||||||
m_refs.push_back(result);
|
m_refs.push_back(result);
|
||||||
add_hypotheses(result);
|
add_hypotheses(result);
|
||||||
found = true;
|
found = true;
|
||||||
|
@ -679,7 +679,7 @@ public:
|
||||||
result = parents[0].get();
|
result = parents[0].get();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = m.mk_unit_resolution(parents.size(), parents.c_ptr());
|
result = m.mk_unit_resolution(parents.size(), parents.data());
|
||||||
m_refs.push_back(result);
|
m_refs.push_back(result);
|
||||||
add_hypotheses(result);
|
add_hypotheses(result);
|
||||||
}
|
}
|
||||||
|
@ -709,7 +709,7 @@ public:
|
||||||
args.push_back(m.get_fact(p));
|
args.push_back(m.get_fact(p));
|
||||||
}
|
}
|
||||||
if (change) {
|
if (change) {
|
||||||
tmp = m.mk_app(p->get_decl(), args.size(), args.c_ptr());
|
tmp = m.mk_app(p->get_decl(), args.size(), args.data());
|
||||||
m_refs.push_back(tmp);
|
m_refs.push_back(tmp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -886,7 +886,7 @@ static void permute_unit_resolution(expr_ref_vector& refs, obj_map<proof,proof*>
|
||||||
// AG: This can lead to merging of the units with other terms in interpolation,
|
// AG: This can lead to merging of the units with other terms in interpolation,
|
||||||
// AG: but without farkas coefficients this does not make sense
|
// AG: but without farkas coefficients this does not make sense
|
||||||
prNew = m.mk_th_lemma(tid, m.get_fact(pr),
|
prNew = m.mk_th_lemma(tid, m.get_fact(pr),
|
||||||
premises.size(), premises.c_ptr(), num_params-1, params+1);
|
premises.size(), premises.data(), num_params-1, params+1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ptr_vector<expr> args;
|
ptr_vector<expr> args;
|
||||||
|
@ -896,7 +896,7 @@ static void permute_unit_resolution(expr_ref_vector& refs, obj_map<proof,proof*>
|
||||||
if (m.has_fact(pr)) {
|
if (m.has_fact(pr)) {
|
||||||
args.push_back(m.get_fact(pr));
|
args.push_back(m.get_fact(pr));
|
||||||
}
|
}
|
||||||
prNew = m.mk_app(pr->get_decl(), args.size(), args.c_ptr());
|
prNew = m.mk_app(pr->get_decl(), args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
cache.insert(pr, prNew);
|
cache.insert(pr, prNew);
|
||||||
|
@ -938,7 +938,7 @@ private:
|
||||||
}
|
}
|
||||||
instantiate(sub, conclusion);
|
instantiate(sub, conclusion);
|
||||||
return
|
return
|
||||||
m.mk_hyper_resolve(premises.size(), premises.c_ptr(), conclusion,
|
m.mk_hyper_resolve(premises.size(), premises.data(), conclusion,
|
||||||
positions,
|
positions,
|
||||||
substs);
|
substs);
|
||||||
}
|
}
|
||||||
|
@ -967,12 +967,12 @@ private:
|
||||||
substs.push_back(sub);
|
substs.push_back(sub);
|
||||||
conclusion = m.get_fact(p);
|
conclusion = m.get_fact(p);
|
||||||
instantiate(sub, conclusion);
|
instantiate(sub, conclusion);
|
||||||
return m.mk_hyper_resolve(premises.size(), premises.c_ptr(), conclusion, positions, substs);
|
return m.mk_hyper_resolve(premises.size(), premises.data(), conclusion, positions, substs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void compose(expr_ref_vector& sub, expr_ref_vector const& s0) {
|
void compose(expr_ref_vector& sub, expr_ref_vector const& s0) {
|
||||||
for (unsigned i = 0; i < sub.size(); ++i) {
|
for (unsigned i = 0; i < sub.size(); ++i) {
|
||||||
sub[i] = var_subst(m, false)(sub[i].get(), s0.size(), s0.c_ptr());
|
sub[i] = var_subst(m, false)(sub[i].get(), s0.size(), s0.data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -990,7 +990,7 @@ private:
|
||||||
tout << sub.size() << "\n";);
|
tout << sub.size() << "\n";);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fml = var_subst(m, false)(q->get_expr(), sub.size(), sub.c_ptr());
|
fml = var_subst(m, false)(q->get_expr(), sub.size(), sub.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -99,7 +99,7 @@ public:
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
SASSERT(j >= 1);
|
SASSERT(j >= 1);
|
||||||
res = j > 1 ? m.mk_or(j, args.c_ptr()) : args.get(0);
|
res = j > 1 ? m.mk_or(j, args.data()) : args.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mk_app(func_decl *decl, expr_ref_vector &args, expr_ref &res)
|
void mk_app(func_decl *decl, expr_ref_vector &args, expr_ref &res)
|
||||||
|
@ -115,7 +115,7 @@ public:
|
||||||
// we don't want (= (not a) (not b)) to be reduced to (= a b)
|
// we don't want (= (not a) (not b)) to be reduced to (= a b)
|
||||||
{ res = m.mk_eq(args.get(0), args.get(1)); }
|
{ res = m.mk_eq(args.get(0), args.get(1)); }
|
||||||
else
|
else
|
||||||
{ brwr.mk_app(decl, args.size(), args.c_ptr(), res); }
|
{ brwr.mk_app(decl, args.size(), args.data(), res); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(ast_manager &m, proof *pr, proof_ref &res)
|
void operator()(ast_manager &m, proof *pr, proof_ref &res)
|
||||||
|
@ -202,7 +202,7 @@ public:
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// rebuild unit resolution
|
// rebuild unit resolution
|
||||||
newp = m.mk_unit_resolution(parents.size(), parents.c_ptr());
|
newp = m.mk_unit_resolution(parents.size(), parents.data());
|
||||||
// XXX the old and new facts should be
|
// XXX the old and new facts should be
|
||||||
// equivalent. The test here is much
|
// equivalent. The test here is much
|
||||||
// stronger. It might need to be relaxed.
|
// stronger. It might need to be relaxed.
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace recfun {
|
||||||
m_def(d) {
|
m_def(d) {
|
||||||
parameter p(case_index);
|
parameter p(case_index);
|
||||||
func_decl_info info(fid, OP_FUN_CASE_PRED, 1, &p);
|
func_decl_info info(fid, OP_FUN_CASE_PRED, 1, &p);
|
||||||
m_pred = m.mk_func_decl(symbol(name.c_str()), arg_sorts.size(), arg_sorts.c_ptr(), m.mk_bool_sort(), info);
|
m_pred = m.mk_func_decl(symbol(name.c_str()), arg_sorts.size(), arg_sorts.data(), m.mk_bool_sort(), info);
|
||||||
}
|
}
|
||||||
|
|
||||||
def::def(ast_manager &m, family_id fid, symbol const & s,
|
def::def(ast_manager &m, family_id fid, symbol const & s,
|
||||||
|
@ -505,9 +505,9 @@ namespace recfun {
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol fresh_name("fold-rec-" + std::to_string(m().mk_fresh_id()));
|
symbol fresh_name("fold-rec-" + std::to_string(m().mk_fresh_id()));
|
||||||
auto pd = mk_def(fresh_name, n, domain.c_ptr(), max_expr->get_sort());
|
auto pd = mk_def(fresh_name, n, domain.data(), max_expr->get_sort());
|
||||||
func_decl* f = pd.get_def()->get_decl();
|
func_decl* f = pd.get_def()->get_decl();
|
||||||
expr_ref new_body(m().mk_app(f, n, args.c_ptr()), m());
|
expr_ref new_body(m().mk_app(f, n, args.data()), m());
|
||||||
set_definition(subst, pd, n, vars, max_expr);
|
set_definition(subst, pd, n, vars, max_expr);
|
||||||
subst.reset();
|
subst.reset();
|
||||||
subst.insert(max_expr, new_body);
|
subst.insert(max_expr, new_body);
|
||||||
|
|
|
@ -77,12 +77,12 @@ namespace recfun {
|
||||||
|
|
||||||
app_ref apply_case_predicate(expr_ref_vector const & args) const {
|
app_ref apply_case_predicate(expr_ref_vector const & args) const {
|
||||||
ast_manager& m = m_pred.get_manager();
|
ast_manager& m = m_pred.get_manager();
|
||||||
return app_ref(m.mk_app(m_pred, args.size(), args.c_ptr()), m);
|
return app_ref(m.mk_app(m_pred, args.size(), args.data()), m);
|
||||||
}
|
}
|
||||||
|
|
||||||
def * get_def() const { return m_def; }
|
def * get_def() const { return m_def; }
|
||||||
expr_ref_vector const & get_guards() const { return m_guards; }
|
expr_ref_vector const & get_guards() const { return m_guards; }
|
||||||
expr * get_guards_c_ptr() const { return *m_guards.c_ptr(); }
|
expr * get_guards_c_ptr() const { return *m_guards.data(); }
|
||||||
expr * get_guard(unsigned i) const { return m_guards[i]; }
|
expr * get_guard(unsigned i) const { return m_guards[i]; }
|
||||||
expr * get_rhs() const { return m_rhs; }
|
expr * get_rhs() const { return m_rhs; }
|
||||||
unsigned num_guards() const { return m_guards.size(); }
|
unsigned num_guards() const { return m_guards.size(); }
|
||||||
|
@ -256,11 +256,11 @@ namespace recfun {
|
||||||
}
|
}
|
||||||
|
|
||||||
app* mk_fun_defined(def const & d, ptr_vector<expr> const & args) {
|
app* mk_fun_defined(def const & d, ptr_vector<expr> const & args) {
|
||||||
return mk_fun_defined(d, args.size(), args.c_ptr());
|
return mk_fun_defined(d, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
app* mk_fun_defined(def const & d, expr_ref_vector const & args) {
|
app* mk_fun_defined(def const & d, expr_ref_vector const & args) {
|
||||||
return mk_fun_defined(d, args.size(), args.c_ptr());
|
return mk_fun_defined(d, args.size(), args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
func_decl_ref_vector get_rec_funs() {
|
func_decl_ref_vector get_rec_funs() {
|
||||||
|
|
|
@ -64,7 +64,7 @@ void recurse_expr<T, Visitor, IgnorePatterns, CallDestructors>::process(expr * n
|
||||||
num = to_app(n)->get_num_args();
|
num = to_app(n)->get_num_args();
|
||||||
for (unsigned j = 0; j < num; j++)
|
for (unsigned j = 0; j < num; j++)
|
||||||
m_results1.push_back(get_cached(to_app(n)->get_arg(j)));
|
m_results1.push_back(get_cached(to_app(n)->get_arg(j)));
|
||||||
cache_result(n, this->Visitor::visit(to_app(n), m_results1.c_ptr()));
|
cache_result(n, this->Visitor::visit(to_app(n), m_results1.data()));
|
||||||
break;
|
break;
|
||||||
case AST_VAR:
|
case AST_VAR:
|
||||||
cache_result(n, this->Visitor::visit(to_var(n)));
|
cache_result(n, this->Visitor::visit(to_var(n)));
|
||||||
|
@ -82,7 +82,7 @@ void recurse_expr<T, Visitor, IgnorePatterns, CallDestructors>::process(expr * n
|
||||||
num = to_quantifier(n)->get_num_no_patterns();
|
num = to_quantifier(n)->get_num_no_patterns();
|
||||||
for (unsigned j = 0; j < num; j++)
|
for (unsigned j = 0; j < num; j++)
|
||||||
m_results2.push_back(get_cached(to_quantifier(n)->get_no_pattern(j)));
|
m_results2.push_back(get_cached(to_quantifier(n)->get_no_pattern(j)));
|
||||||
cache_result(n, this->Visitor::visit(to_quantifier(n), get_cached(to_quantifier(n)->get_expr()), m_results1.c_ptr(), m_results2.c_ptr()));
|
cache_result(n, this->Visitor::visit(to_quantifier(n), get_cached(to_quantifier(n)->get_expr()), m_results1.data(), m_results2.data()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -168,7 +168,7 @@ bool arith_rewriter::div_polynomial(expr * t, numeral const & g, const_treatment
|
||||||
switch (new_args.size()) {
|
switch (new_args.size()) {
|
||||||
case 0: result = m_util.mk_numeral(numeral(0), true); return true;
|
case 0: result = m_util.mk_numeral(numeral(0), true); return true;
|
||||||
case 1: result = new_args[0]; return true;
|
case 1: result = new_args[0]; return true;
|
||||||
default: result = m_util.mk_add(new_args.size(), new_args.c_ptr()); return true;
|
default: result = m_util.mk_add(new_args.size(), new_args.data()); return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ bool arith_rewriter::elim_to_real_mon(expr * monomial, expr_ref & new_monomial)
|
||||||
return false;
|
return false;
|
||||||
new_vars.push_back(new_var);
|
new_vars.push_back(new_var);
|
||||||
}
|
}
|
||||||
new_monomial = m_util.mk_mul(new_vars.size(), new_vars.c_ptr());
|
new_monomial = m_util.mk_mul(new_vars.size(), new_vars.data());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -422,7 +422,7 @@ bool arith_rewriter::elim_to_real_pol(expr * p, expr_ref & new_p) {
|
||||||
return false;
|
return false;
|
||||||
new_monomials.push_back(new_monomial);
|
new_monomials.push_back(new_monomial);
|
||||||
}
|
}
|
||||||
new_p = m_util.mk_add(new_monomials.size(), new_monomials.c_ptr());
|
new_p = m_util.mk_add(new_monomials.size(), new_monomials.data());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -496,7 +496,7 @@ expr * arith_rewriter::reduce_power(expr * arg, bool is_eq) {
|
||||||
if (new_args.size() == 1)
|
if (new_args.size() == 1)
|
||||||
return new_args[0];
|
return new_args[0];
|
||||||
else
|
else
|
||||||
return m_util.mk_mul(new_args.size(), new_args.c_ptr());
|
return m_util.mk_mul(new_args.size(), new_args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
br_status arith_rewriter::reduce_power(expr * arg1, expr * arg2, op_kind kind, expr_ref & result) {
|
br_status arith_rewriter::reduce_power(expr * arg1, expr * arg2, op_kind kind, expr_ref & result) {
|
||||||
|
@ -724,7 +724,7 @@ expr_ref arith_rewriter::neg_monomial(expr* e) const {
|
||||||
return expr_ref(args.back(), m());
|
return expr_ref(args.back(), m());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return expr_ref(m_util.mk_mul(args.size(), args.c_ptr()), m());
|
return expr_ref(m_util.mk_mul(args.size(), args.data()), m());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ bool arith_rewriter::is_neg_poly(expr* t, expr_ref& neg) const {
|
||||||
for (expr* e1 : *to_app(t)) {
|
for (expr* e1 : *to_app(t)) {
|
||||||
args1.push_back(neg_monomial(e1));
|
args1.push_back(neg_monomial(e1));
|
||||||
}
|
}
|
||||||
neg = m_util.mk_add(args1.size(), args1.c_ptr());
|
neg = m_util.mk_add(args1.size(), args1.data());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -810,9 +810,9 @@ br_status arith_rewriter::mk_add_core(unsigned num_args, expr * const * args, ex
|
||||||
}
|
}
|
||||||
|
|
||||||
new_args.push_back(m_util.mk_numeral(am, r, false));
|
new_args.push_back(m_util.mk_numeral(am, r, false));
|
||||||
br_status st = poly_rewriter<arith_rewriter_core>::mk_add_core(new_args.size(), new_args.c_ptr(), result);
|
br_status st = poly_rewriter<arith_rewriter_core>::mk_add_core(new_args.size(), new_args.data(), result);
|
||||||
if (st == BR_FAILED) {
|
if (st == BR_FAILED) {
|
||||||
result = m().mk_app(get_fid(), OP_ADD, new_args.size(), new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_ADD, new_args.size(), new_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
return st;
|
return st;
|
||||||
|
@ -859,9 +859,9 @@ br_status arith_rewriter::mk_mul_core(unsigned num_args, expr * const * args, ex
|
||||||
}
|
}
|
||||||
new_args.push_back(m_util.mk_numeral(am, r, false));
|
new_args.push_back(m_util.mk_numeral(am, r, false));
|
||||||
|
|
||||||
br_status st = poly_rewriter<arith_rewriter_core>::mk_mul_core(new_args.size(), new_args.c_ptr(), result);
|
br_status st = poly_rewriter<arith_rewriter_core>::mk_mul_core(new_args.size(), new_args.data(), result);
|
||||||
if (st == BR_FAILED) {
|
if (st == BR_FAILED) {
|
||||||
result = m().mk_app(get_fid(), OP_MUL, new_args.size(), new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_MUL, new_args.size(), new_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
return st;
|
return st;
|
||||||
|
@ -1031,7 +1031,7 @@ br_status arith_rewriter::mk_idiv_core(expr * arg1, expr * arg2, expr_ref & resu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (change) {
|
if (change) {
|
||||||
result = m_util.mk_idiv(m().mk_app(to_app(arg1)->get_decl(), args.size(), args.c_ptr()), arg2);
|
result = m_util.mk_idiv(m().mk_app(to_app(arg1)->get_decl(), args.size(), args.data()), arg2);
|
||||||
result = m_util.mk_add(m_util.mk_numeral(add, true), result);
|
result = m_util.mk_add(m_util.mk_numeral(add, true), result);
|
||||||
TRACE("div_bug", tout << "mk_div result: " << result << "\n";);
|
TRACE("div_bug", tout << "mk_div result: " << result << "\n";);
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
|
@ -1083,8 +1083,8 @@ bool arith_rewriter::divides(expr* num, expr* den, expr_ref& result) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
num = m_util.mk_mul(args1.size(), args1.c_ptr());
|
num = m_util.mk_mul(args1.size(), args1.data());
|
||||||
den = m_util.mk_mul(args2.size(), args2.c_ptr());
|
den = m_util.mk_mul(args2.size(), args2.data());
|
||||||
result = m_util.mk_idiv(num, den);
|
result = m_util.mk_idiv(num, den);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1099,8 +1099,8 @@ expr_ref arith_rewriter::remove_divisor(expr* arg, expr* num, expr* den) {
|
||||||
remove_divisor(arg, args1);
|
remove_divisor(arg, args1);
|
||||||
remove_divisor(arg, args2);
|
remove_divisor(arg, args2);
|
||||||
expr_ref zero(m_util.mk_int(0), m());
|
expr_ref zero(m_util.mk_int(0), m());
|
||||||
num = args1.empty() ? m_util.mk_int(1) : m_util.mk_mul(args1.size(), args1.c_ptr());
|
num = args1.empty() ? m_util.mk_int(1) : m_util.mk_mul(args1.size(), args1.data());
|
||||||
den = args2.empty() ? m_util.mk_int(1) : m_util.mk_mul(args2.size(), args2.c_ptr());
|
den = args2.empty() ? m_util.mk_int(1) : m_util.mk_mul(args2.size(), args2.data());
|
||||||
expr_ref d(m_util.mk_idiv(num, den), m());
|
expr_ref d(m_util.mk_idiv(num, den), m());
|
||||||
expr_ref nd(m_util.mk_idiv(m_util.mk_uminus(num), m_util.mk_uminus(den)), m());
|
expr_ref nd(m_util.mk_idiv(m_util.mk_uminus(num), m_util.mk_uminus(den)), m());
|
||||||
return expr_ref(m().mk_ite(m().mk_eq(zero, arg),
|
return expr_ref(m().mk_ite(m().mk_eq(zero, arg),
|
||||||
|
@ -1194,7 +1194,7 @@ br_status arith_rewriter::mk_mod_core(expr * arg1, expr * arg2, expr_ref & resul
|
||||||
if (!change) {
|
if (!change) {
|
||||||
return BR_FAILED; // did not find any target for applying simplification
|
return BR_FAILED; // did not find any target for applying simplification
|
||||||
}
|
}
|
||||||
result = m_util.mk_mod(m().mk_app(to_app(arg1)->get_decl(), args.size(), args.c_ptr()), arg2);
|
result = m_util.mk_mod(m().mk_app(to_app(arg1)->get_decl(), args.size(), args.data()), arg2);
|
||||||
TRACE("mod_bug", tout << "mk_mod result: " << mk_ismt2_pp(result, m()) << "\n";);
|
TRACE("mod_bug", tout << "mk_mod result: " << mk_ismt2_pp(result, m()) << "\n";);
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
|
@ -1355,7 +1355,7 @@ br_status arith_rewriter::mk_power_core(expr * arg1, expr * arg2, expr_ref & res
|
||||||
for (unsigned i = 0; i < k; i++) {
|
for (unsigned i = 0; i < k; i++) {
|
||||||
args.push_back(arg1);
|
args.push_back(arg1);
|
||||||
}
|
}
|
||||||
result = ensure_real(m_util.mk_mul(args.size(), args.c_ptr()));
|
result = ensure_real(m_util.mk_mul(args.size(), args.data()));
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1468,17 +1468,17 @@ br_status arith_rewriter::mk_to_int_core(expr * arg, expr_ref & result) {
|
||||||
return BR_FAILED;
|
return BR_FAILED;
|
||||||
|
|
||||||
if (real_args.empty()) {
|
if (real_args.empty()) {
|
||||||
result = m().mk_app(get_fid(), to_app(arg)->get_decl()->get_decl_kind(), int_args.size(), int_args.c_ptr());
|
result = m().mk_app(get_fid(), to_app(arg)->get_decl()->get_decl_kind(), int_args.size(), int_args.data());
|
||||||
return BR_REWRITE1;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
if (!int_args.empty() && m_util.is_add(arg)) {
|
if (!int_args.empty() && m_util.is_add(arg)) {
|
||||||
decl_kind k = to_app(arg)->get_decl()->get_decl_kind();
|
decl_kind k = to_app(arg)->get_decl()->get_decl_kind();
|
||||||
expr_ref t1(m().mk_app(get_fid(), k, int_args.size(), int_args.c_ptr()), m());
|
expr_ref t1(m().mk_app(get_fid(), k, int_args.size(), int_args.data()), m());
|
||||||
expr_ref t2(m().mk_app(get_fid(), k, real_args.size(), real_args.c_ptr()), m());
|
expr_ref t2(m().mk_app(get_fid(), k, real_args.size(), real_args.data()), m());
|
||||||
int_args.reset();
|
int_args.reset();
|
||||||
int_args.push_back(t1);
|
int_args.push_back(t1);
|
||||||
int_args.push_back(m_util.mk_to_int(t2));
|
int_args.push_back(m_util.mk_to_int(t2));
|
||||||
result = m().mk_app(get_fid(), k, int_args.size(), int_args.c_ptr());
|
result = m().mk_app(get_fid(), k, int_args.size(), int_args.data());
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1498,9 +1498,9 @@ br_status arith_rewriter::mk_to_real_core(expr * arg, expr_ref & result) {
|
||||||
for (expr* e : *to_app(arg))
|
for (expr* e : *to_app(arg))
|
||||||
new_args.push_back(m_util.mk_to_real(e));
|
new_args.push_back(m_util.mk_to_real(e));
|
||||||
if (m_util.is_add(arg))
|
if (m_util.is_add(arg))
|
||||||
result = m().mk_app(get_fid(), OP_ADD, new_args.size(), new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_ADD, new_args.size(), new_args.data());
|
||||||
else
|
else
|
||||||
result = m().mk_app(get_fid(), OP_MUL, new_args.size(), new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_MUL, new_args.size(), new_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ br_status array_rewriter::mk_store_core(unsigned num_args, expr * const * args,
|
||||||
new_args.push_back(to_app(args[0])->get_arg(0));
|
new_args.push_back(to_app(args[0])->get_arg(0));
|
||||||
new_args.append(num_args-1, args+1);
|
new_args.append(num_args-1, args+1);
|
||||||
SASSERT(new_args.size() == num_args);
|
SASSERT(new_args.size() == num_args);
|
||||||
result = m().mk_app(get_fid(), OP_STORE, num_args, new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_STORE, num_args, new_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
case l_false:
|
case l_false:
|
||||||
|
@ -126,11 +126,11 @@ br_status array_rewriter::mk_store_core(unsigned num_args, expr * const * args,
|
||||||
ptr_buffer<expr> new_args;
|
ptr_buffer<expr> new_args;
|
||||||
new_args.push_back(to_app(args[0])->get_arg(0));
|
new_args.push_back(to_app(args[0])->get_arg(0));
|
||||||
new_args.append(num_args-1, args+1);
|
new_args.append(num_args-1, args+1);
|
||||||
expr * nested_store = m().mk_app(get_fid(), OP_STORE, num_args, new_args.c_ptr());
|
expr * nested_store = m().mk_app(get_fid(), OP_STORE, num_args, new_args.data());
|
||||||
new_args.reset();
|
new_args.reset();
|
||||||
new_args.push_back(nested_store);
|
new_args.push_back(nested_store);
|
||||||
new_args.append(num_args - 1, to_app(args[0])->get_args() + 1);
|
new_args.append(num_args - 1, to_app(args[0])->get_args() + 1);
|
||||||
result = m().mk_app(get_fid(), OP_STORE, num_args, new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_STORE, num_args, new_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -176,7 +176,7 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
|
||||||
ptr_buffer<expr> new_args;
|
ptr_buffer<expr> new_args;
|
||||||
new_args.push_back(to_app(args[0])->get_arg(0));
|
new_args.push_back(to_app(args[0])->get_arg(0));
|
||||||
new_args.append(num_args-1, args+1);
|
new_args.append(num_args-1, args+1);
|
||||||
result = m().mk_app(get_fid(), OP_SELECT, num_args, new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_SELECT, num_args, new_args.data());
|
||||||
return BR_REWRITE1;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -185,7 +185,7 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
|
||||||
ptr_buffer<expr> new_args;
|
ptr_buffer<expr> new_args;
|
||||||
new_args.push_back(to_app(args[0])->get_arg(0));
|
new_args.push_back(to_app(args[0])->get_arg(0));
|
||||||
new_args.append(num_args-1, args+1);
|
new_args.append(num_args-1, args+1);
|
||||||
expr * sel_a_j = m().mk_app(get_fid(), OP_SELECT, num_args, new_args.c_ptr());
|
expr * sel_a_j = m().mk_app(get_fid(), OP_SELECT, num_args, new_args.data());
|
||||||
expr * v = to_app(args[0])->get_arg(num_args);
|
expr * v = to_app(args[0])->get_arg(num_args);
|
||||||
ptr_buffer<expr> eqs;
|
ptr_buffer<expr> eqs;
|
||||||
unsigned num_indices = num_args-1;
|
unsigned num_indices = num_args-1;
|
||||||
|
@ -223,7 +223,7 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
|
||||||
sh(args[i], num_args-1, result);
|
sh(args[i], num_args-1, result);
|
||||||
_args.push_back(result);
|
_args.push_back(result);
|
||||||
}
|
}
|
||||||
result = subst(q->get_expr(), _args.size(), _args.c_ptr());
|
result = subst(q->get_expr(), _args.size(), _args.data());
|
||||||
inv_var_shifter invsh(m());
|
inv_var_shifter invsh(m());
|
||||||
invsh(result, _args.size(), result);
|
invsh(result, _args.size(), result);
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
|
@ -238,9 +238,9 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
|
||||||
ptr_vector<expr> args1;
|
ptr_vector<expr> args1;
|
||||||
args1.push_back(arg);
|
args1.push_back(arg);
|
||||||
args1.append(num_args-1, args + 1);
|
args1.append(num_args-1, args + 1);
|
||||||
args0.push_back(m_util.mk_select(args1.size(), args1.c_ptr()));
|
args0.push_back(m_util.mk_select(args1.size(), args1.data()));
|
||||||
}
|
}
|
||||||
result = m().mk_app(f0, args0.size(), args0.c_ptr());
|
result = m().mk_app(f0, args0.size(), args0.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
|
||||||
args1.append(num_args-1, args + 1);
|
args1.append(num_args-1, args + 1);
|
||||||
args2.push_back(el);
|
args2.push_back(el);
|
||||||
args2.append(num_args-1, args + 1);
|
args2.append(num_args-1, args + 1);
|
||||||
result = m().mk_ite(c, m_util.mk_select(num_args, args1.c_ptr()), m_util.mk_select(num_args, args2.c_ptr()));
|
result = m().mk_ite(c, m_util.mk_select(num_args, args1.data()), m_util.mk_select(num_args, args2.data()));
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ sort_ref array_rewriter::get_map_array_sort(func_decl* f, unsigned num_args, exp
|
||||||
unsigned sz = get_array_arity(s0);
|
unsigned sz = get_array_arity(s0);
|
||||||
ptr_vector<sort> domain;
|
ptr_vector<sort> domain;
|
||||||
for (unsigned i = 0; i < sz; ++i) domain.push_back(get_array_domain(s0, i));
|
for (unsigned i = 0; i < sz; ++i) domain.push_back(get_array_domain(s0, i));
|
||||||
return sort_ref(m_util.mk_array_sort(sz, domain.c_ptr(), f->get_range()), m());
|
return sort_ref(m_util.mk_array_sort(sz, domain.data(), f->get_range()), m());
|
||||||
}
|
}
|
||||||
|
|
||||||
br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result) {
|
br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result) {
|
||||||
|
@ -317,13 +317,13 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
|
||||||
}
|
}
|
||||||
if (store_expr) {
|
if (store_expr) {
|
||||||
ptr_buffer<expr> new_args;
|
ptr_buffer<expr> new_args;
|
||||||
new_args.push_back(m_util.mk_map(f, arrays.size(), arrays.c_ptr()));
|
new_args.push_back(m_util.mk_map(f, arrays.size(), arrays.data()));
|
||||||
new_args.append(num_indices, store_expr->get_args() + 1);
|
new_args.append(num_indices, store_expr->get_args() + 1);
|
||||||
new_args.push_back(m().mk_app(f, values.size(), values.c_ptr()));
|
new_args.push_back(m().mk_app(f, values.size(), values.data()));
|
||||||
result = m().mk_app(get_fid(), OP_STORE, new_args.size(), new_args.c_ptr());
|
result = m().mk_app(get_fid(), OP_STORE, new_args.size(), new_args.data());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
expr_ref value(m().mk_app(f, values.size(), values.c_ptr()), m());
|
expr_ref value(m().mk_app(f, values.size(), values.data()), m());
|
||||||
sort_ref s = get_map_array_sort(f, num_args, args);
|
sort_ref s = get_map_array_sort(f, num_args, args);
|
||||||
result = m_util.mk_const_array(s, value);
|
result = m_util.mk_const_array(s, value);
|
||||||
}
|
}
|
||||||
|
@ -358,10 +358,10 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
|
||||||
for (unsigned i = 0; i < n; ++i) {
|
for (unsigned i = 0; i < n; ++i) {
|
||||||
sel.push_back(m().mk_var(n - i - 1, lam->get_decl_sort(i)));
|
sel.push_back(m().mk_var(n - i - 1, lam->get_decl_sort(i)));
|
||||||
}
|
}
|
||||||
args1.push_back(m_util.mk_select(sel.size(), sel.c_ptr()));
|
args1.push_back(m_util.mk_select(sel.size(), sel.data()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = m().mk_app(f, args1.size(), args1.c_ptr());
|
result = m().mk_app(f, args1.size(), args1.data());
|
||||||
result = m().update_quantifier(lam, result);
|
result = m().update_quantifier(lam, result);
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
|
||||||
gs.shrink(k);
|
gs.shrink(k);
|
||||||
if (and_change) {
|
if (and_change) {
|
||||||
std::sort(gs.begin(), gs.end(), [](expr* a, expr* b) { return a->get_id() < b->get_id(); });
|
std::sort(gs.begin(), gs.end(), [](expr* a, expr* b) { return a->get_id() < b->get_id(); });
|
||||||
expr* arg = m_util.mk_map_assoc(f, gs.size(), gs.c_ptr());
|
expr* arg = m_util.mk_map_assoc(f, gs.size(), gs.data());
|
||||||
es[j] = m_util.mk_map(m().mk_not_decl(), 1, &arg);
|
es[j] = m_util.mk_map(m().mk_not_decl(), 1, &arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
|
||||||
}
|
}
|
||||||
if (change) {
|
if (change) {
|
||||||
std::sort(es.begin(), es.end(), [](expr* a, expr* b) { return a->get_id() < b->get_id(); });
|
std::sort(es.begin(), es.end(), [](expr* a, expr* b) { return a->get_id() < b->get_id(); });
|
||||||
result = m_util.mk_map_assoc(f, es.size(), es.c_ptr());
|
result = m_util.mk_map_assoc(f, es.size(), es.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -466,7 +466,7 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (change) {
|
if (change) {
|
||||||
result = m_util.mk_map_assoc(f, es.size(), es.c_ptr());
|
result = m_util.mk_map_assoc(f, es.size(), es.data());
|
||||||
return BR_REWRITE1;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -545,9 +545,9 @@ void array_rewriter::mk_eq(expr* e, expr* lhs, expr* rhs, expr_ref_vector& fmls)
|
||||||
args.reset();
|
args.reset();
|
||||||
args.push_back(lhs);
|
args.push_back(lhs);
|
||||||
args.append(args0);
|
args.append(args0);
|
||||||
mk_select(args.size(), args.c_ptr(), tmp1);
|
mk_select(args.size(), args.data(), tmp1);
|
||||||
args[0] = rhs;
|
args[0] = rhs;
|
||||||
mk_select(args.size(), args.c_ptr(), tmp2);
|
mk_select(args.size(), args.data(), tmp2);
|
||||||
fmls.push_back(m().mk_eq(tmp1, tmp2));
|
fmls.push_back(m().mk_eq(tmp1, tmp2));
|
||||||
e = a;
|
e = a;
|
||||||
}
|
}
|
||||||
|
@ -686,7 +686,7 @@ expr_ref array_rewriter::expand_store(expr* s) {
|
||||||
sh(st->get_arg(args.size()), arity, tmp);
|
sh(st->get_arg(args.size()), arity, tmp);
|
||||||
result = m().mk_ite(mk_and(eqs), tmp, result);
|
result = m().mk_ite(mk_and(eqs), tmp, result);
|
||||||
}
|
}
|
||||||
result = m().mk_lambda(sorts.size(), sorts.c_ptr(), names.c_ptr(), result);
|
result = m().mk_lambda(sorts.size(), sorts.data(), names.data(), result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
*/
|
*/
|
||||||
counter & count(unsigned sz, const unsigned * els, int delta = 1);
|
counter & count(unsigned sz, const unsigned * els, int delta = 1);
|
||||||
counter & count(const unsigned_vector & els, int delta = 1) {
|
counter & count(const unsigned_vector & els, int delta = 1) {
|
||||||
return count(els.size(), els.c_ptr(), delta);
|
return count(els.size(), els.data(), delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void collect_positive(uint_set & acc) const;
|
void collect_positive(uint_set & acc) const;
|
||||||
|
|
|
@ -244,7 +244,7 @@ void bit2int::visit(app* n) {
|
||||||
m_args.push_back(get_cached(arg));
|
m_args.push_back(get_cached(arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
expr* const* args = m_args.c_ptr();
|
expr* const* args = m_args.data();
|
||||||
|
|
||||||
bool has_b2i =
|
bool has_b2i =
|
||||||
m_arith_util.is_le(n) || m_arith_util.is_ge(n) || m_arith_util.is_gt(n) ||
|
m_arith_util.is_le(n) || m_arith_util.is_ge(n) || m_arith_util.is_gt(n) ||
|
||||||
|
|
|
@ -209,7 +209,7 @@ struct blaster_rewriter_cfg : public default_rewriter_cfg {
|
||||||
|
|
||||||
template<typename V>
|
template<typename V>
|
||||||
app * mk_mkbv(V const & bits) {
|
app * mk_mkbv(V const & bits) {
|
||||||
return m().mk_app(butil().get_family_id(), OP_MKBV, bits.size(), bits.c_ptr());
|
return m().mk_app(butil().get_family_id(), OP_MKBV, bits.size(), bits.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void mk_const(func_decl * f, expr_ref & result) {
|
void mk_const(func_decl * f, expr_ref & result) {
|
||||||
|
@ -241,7 +241,7 @@ void OP(expr * arg, expr_ref & result) { \
|
||||||
m_in1.reset(); \
|
m_in1.reset(); \
|
||||||
get_bits(arg, m_in1); \
|
get_bits(arg, m_in1); \
|
||||||
m_out.reset(); \
|
m_out.reset(); \
|
||||||
m_blaster.BB_OP(m_in1.size(), m_in1.c_ptr(), m_out); \
|
m_blaster.BB_OP(m_in1.size(), m_in1.data(), m_out); \
|
||||||
result = mk_mkbv(m_out); \
|
result = mk_mkbv(m_out); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ void OP(expr * arg1, expr * arg2, expr_ref & result) { \
|
||||||
get_bits(arg1, m_in1); \
|
get_bits(arg1, m_in1); \
|
||||||
get_bits(arg2, m_in2); \
|
get_bits(arg2, m_in2); \
|
||||||
m_out.reset(); \
|
m_out.reset(); \
|
||||||
m_blaster.BB_OP(m_in1.size(), m_in1.c_ptr(), m_in2.c_ptr(), m_out); \
|
m_blaster.BB_OP(m_in1.size(), m_in1.data(), m_in2.data(), m_out); \
|
||||||
result = mk_mkbv(m_out); \
|
result = mk_mkbv(m_out); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ void OP(expr * arg1, expr * arg2, expr_ref & result) {
|
||||||
m_in1.reset(); m_in2.reset(); \
|
m_in1.reset(); m_in2.reset(); \
|
||||||
get_bits(arg1, m_in1); \
|
get_bits(arg1, m_in1); \
|
||||||
get_bits(arg2, m_in2); \
|
get_bits(arg2, m_in2); \
|
||||||
m_blaster.BB_OP(m_in1.size(), m_in1.c_ptr(), m_in2.c_ptr(), result); \
|
m_blaster.BB_OP(m_in1.size(), m_in1.data(), m_in2.data(), result); \
|
||||||
}
|
}
|
||||||
|
|
||||||
MK_BIN_PRED_REDUCE(reduce_eq, mk_eq);
|
MK_BIN_PRED_REDUCE(reduce_eq, mk_eq);
|
||||||
|
@ -309,7 +309,7 @@ void OP(expr * arg, unsigned n, expr_ref & result) { \
|
||||||
m_in1.reset(); \
|
m_in1.reset(); \
|
||||||
get_bits(arg, m_in1); \
|
get_bits(arg, m_in1); \
|
||||||
m_out.reset(); \
|
m_out.reset(); \
|
||||||
m_blaster.BB_OP(m_in1.size(), m_in1.c_ptr(), n, m_out); \
|
m_blaster.BB_OP(m_in1.size(), m_in1.data(), n, m_out); \
|
||||||
result = mk_mkbv(m_out); \
|
result = mk_mkbv(m_out); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ MK_PARAMETRIC_UNARY_REDUCE(reduce_sign_extend, mk_sign_extend);
|
||||||
get_bits(arg2, m_in1);
|
get_bits(arg2, m_in1);
|
||||||
get_bits(arg3, m_in2);
|
get_bits(arg3, m_in2);
|
||||||
m_out.reset();
|
m_out.reset();
|
||||||
m_blaster.mk_multiplexer(arg1, m_in1.size(), m_in1.c_ptr(), m_in2.c_ptr(), m_out);
|
m_blaster.mk_multiplexer(arg1, m_in1.size(), m_in1.data(), m_in2.data(), m_out);
|
||||||
result = mk_mkbv(m_out);
|
result = mk_mkbv(m_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ MK_PARAMETRIC_UNARY_REDUCE(reduce_sign_extend, mk_sign_extend);
|
||||||
i--;
|
i--;
|
||||||
m_in1.reset();
|
m_in1.reset();
|
||||||
get_bits(args[i], m_in1);
|
get_bits(args[i], m_in1);
|
||||||
m_out.append(m_in1.size(), m_in1.c_ptr());
|
m_out.append(m_in1.size(), m_in1.data());
|
||||||
}
|
}
|
||||||
result = mk_mkbv(m_out);
|
result = mk_mkbv(m_out);
|
||||||
}
|
}
|
||||||
|
@ -657,7 +657,7 @@ MK_PARAMETRIC_UNARY_REDUCE(reduce_sign_extend, mk_sign_extend);
|
||||||
new_decl_names.push_back(n);
|
new_decl_names.push_back(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = m().mk_quantifier(old_q->get_kind(), new_decl_sorts.size(), new_decl_sorts.c_ptr(), new_decl_names.c_ptr(),
|
result = m().mk_quantifier(old_q->get_kind(), new_decl_sorts.size(), new_decl_sorts.data(), new_decl_names.data(),
|
||||||
new_body, old_q->get_weight(), old_q->get_qid(), old_q->get_skid(),
|
new_body, old_q->get_weight(), old_q->get_qid(), old_q->get_skid(),
|
||||||
old_q->get_num_patterns(), new_patterns, old_q->get_num_no_patterns(), new_no_patterns);
|
old_q->get_num_patterns(), new_patterns, old_q->get_num_no_patterns(), new_no_patterns);
|
||||||
result_pr = nullptr;
|
result_pr = nullptr;
|
||||||
|
|
|
@ -325,7 +325,7 @@ void bit_blaster_tpl<Cfg>::mk_multiplier(unsigned sz, expr * const * a_bits, exp
|
||||||
expr_ref_vector & carry_bits = pps[save_inx+1];
|
expr_ref_vector & carry_bits = pps[save_inx+1];
|
||||||
SASSERT(sum_bits.empty() && carry_bits.empty());
|
SASSERT(sum_bits.empty() && carry_bits.empty());
|
||||||
carry_bits.push_back(zero);
|
carry_bits.push_back(zero);
|
||||||
mk_carry_save_adder(pp1.size(), pp1.c_ptr(), pp2.c_ptr(), pp3.c_ptr(), sum_bits, carry_bits);
|
mk_carry_save_adder(pp1.size(), pp1.data(), pp2.data(), pp3.data(), sum_bits, carry_bits);
|
||||||
carry_bits.pop_back();
|
carry_bits.pop_back();
|
||||||
save_inx += 2;
|
save_inx += 2;
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ void bit_blaster_tpl<Cfg>::mk_multiplier(unsigned sz, expr * const * a_bits, exp
|
||||||
SASSERT(pps.size() == 2);
|
SASSERT(pps.size() == 2);
|
||||||
|
|
||||||
// Now there are only two numbers to add, we can use a ripple carry adder here.
|
// Now there are only two numbers to add, we can use a ripple carry adder here.
|
||||||
mk_adder(sz, pps[0].c_ptr(), pps[1].c_ptr(), out_bits);
|
mk_adder(sz, pps[0].data(), pps[1].data(), out_bits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ void bit_blaster_tpl<Cfg>::mk_umul_no_overflow(unsigned sz, expr * const * a_bit
|
||||||
// mk_multiplier will simplify output taking into account that
|
// mk_multiplier will simplify output taking into account that
|
||||||
// the most significant bits of ext_a_bits and ext_b_bits are zero.
|
// the most significant bits of ext_a_bits and ext_b_bits are zero.
|
||||||
//
|
//
|
||||||
mk_multiplier(1 + sz, ext_a_bits.c_ptr(), ext_b_bits.c_ptr(), mult_cout);
|
mk_multiplier(1 + sz, ext_a_bits.data(), ext_b_bits.data(), mult_cout);
|
||||||
expr_ref overflow1(m()), overflow2(m()), overflow(m());
|
expr_ref overflow1(m()), overflow2(m()), overflow(m());
|
||||||
//
|
//
|
||||||
// ignore bits [0, sz-1] of mult_cout
|
// ignore bits [0, sz-1] of mult_cout
|
||||||
|
@ -403,7 +403,7 @@ void bit_blaster_tpl<Cfg>::mk_smul_no_overflow_core(unsigned sz, expr * const *
|
||||||
SASSERT(ext_a_bits.size() == 1 + sz);
|
SASSERT(ext_a_bits.size() == 1 + sz);
|
||||||
SASSERT(ext_b_bits.size() == 1 + sz);
|
SASSERT(ext_b_bits.size() == 1 + sz);
|
||||||
expr_ref_vector mult_cout(m());
|
expr_ref_vector mult_cout(m());
|
||||||
mk_multiplier(1 + sz, ext_a_bits.c_ptr(), ext_b_bits.c_ptr(), mult_cout);
|
mk_multiplier(1 + sz, ext_a_bits.data(), ext_b_bits.data(), mult_cout);
|
||||||
expr_ref overflow1(m()), overflow2(m()), overflow(m());
|
expr_ref overflow1(m()), overflow2(m()), overflow(m());
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -478,7 +478,7 @@ void bit_blaster_tpl<Cfg>::mk_udiv_urem(unsigned sz, expr * const * a_bits, expr
|
||||||
// generate p - b
|
// generate p - b
|
||||||
expr_ref q(m());
|
expr_ref q(m());
|
||||||
t.reset();
|
t.reset();
|
||||||
mk_subtracter(sz, p.c_ptr(), b_bits, t, q);
|
mk_subtracter(sz, p.data(), b_bits, t, q);
|
||||||
q_bits.set(sz - i - 1, q);
|
q_bits.set(sz - i - 1, q);
|
||||||
|
|
||||||
// update p
|
// update p
|
||||||
|
@ -549,7 +549,7 @@ void bit_blaster_tpl<Cfg>::mk_abs(unsigned sz, expr * const * a_bits, expr_ref_v
|
||||||
else {
|
else {
|
||||||
expr_ref_vector neg_a_bits(m());
|
expr_ref_vector neg_a_bits(m());
|
||||||
mk_neg(sz, a_bits, neg_a_bits);
|
mk_neg(sz, a_bits, neg_a_bits);
|
||||||
mk_multiplexer(a_msb, sz, neg_a_bits.c_ptr(), a_bits, out_bits);
|
mk_multiplexer(a_msb, sz, neg_a_bits.data(), a_bits, out_bits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,7 +584,7 @@ void bit_blaster_tpl<Cfg>::mk_sdiv_srem_smod(unsigned sz, expr * const * a_bits,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m().is_false(a_msb) && !m().is_true(b_msb)) {
|
if (!m().is_false(a_msb) && !m().is_true(b_msb)) {
|
||||||
mk_udiv_urem(sz, neg_a_bits.c_ptr(), b_bits, np_q, np_r);
|
mk_udiv_urem(sz, neg_a_bits.data(), b_bits, np_q, np_r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
np_q.resize(sz, m().mk_false());
|
np_q.resize(sz, m().mk_false());
|
||||||
|
@ -592,7 +592,7 @@ void bit_blaster_tpl<Cfg>::mk_sdiv_srem_smod(unsigned sz, expr * const * a_bits,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m().is_true(a_msb) && !m().is_false(b_msb)) {
|
if (!m().is_true(a_msb) && !m().is_false(b_msb)) {
|
||||||
mk_udiv_urem(sz, a_bits, neg_b_bits.c_ptr(), pn_q, pn_r);
|
mk_udiv_urem(sz, a_bits, neg_b_bits.data(), pn_q, pn_r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pn_q.resize(sz, m().mk_false());
|
pn_q.resize(sz, m().mk_false());
|
||||||
|
@ -600,7 +600,7 @@ void bit_blaster_tpl<Cfg>::mk_sdiv_srem_smod(unsigned sz, expr * const * a_bits,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m().is_false(a_msb) && !m().is_false(b_msb)) {
|
if (!m().is_false(a_msb) && !m().is_false(b_msb)) {
|
||||||
mk_udiv_urem(sz, neg_a_bits.c_ptr(), neg_b_bits.c_ptr(), nn_q, nn_r);
|
mk_udiv_urem(sz, neg_a_bits.data(), neg_b_bits.data(), nn_q, nn_r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nn_q.resize(sz, m().mk_false());
|
nn_q.resize(sz, m().mk_false());
|
||||||
|
@ -615,19 +615,19 @@ void bit_blaster_tpl<Cfg>::mk_sdiv_srem_smod(unsigned sz, expr * const * a_bits,
|
||||||
expr_ref_vector & nn_out = nn_q;
|
expr_ref_vector & nn_out = nn_q;
|
||||||
|
|
||||||
if (!m().is_false(a_msb) && !m().is_true(b_msb))
|
if (!m().is_false(a_msb) && !m().is_true(b_msb))
|
||||||
mk_neg(sz, np_q.c_ptr(), np_out);
|
mk_neg(sz, np_q.data(), np_out);
|
||||||
else
|
else
|
||||||
np_out.resize(sz, m().mk_false());
|
np_out.resize(sz, m().mk_false());
|
||||||
|
|
||||||
if (!m().is_true(a_msb) && !m().is_false(b_msb))
|
if (!m().is_true(a_msb) && !m().is_false(b_msb))
|
||||||
mk_neg(sz, pn_q.c_ptr(), pn_out);
|
mk_neg(sz, pn_q.data(), pn_out);
|
||||||
else
|
else
|
||||||
pn_out.resize(sz, m().mk_false());
|
pn_out.resize(sz, m().mk_false());
|
||||||
|
|
||||||
#define MK_MULTIPLEXER() \
|
#define MK_MULTIPLEXER() \
|
||||||
mk_multiplexer(b_msb, sz, nn_out.c_ptr(), np_out.c_ptr(), ite1); \
|
mk_multiplexer(b_msb, sz, nn_out.data(), np_out.data(), ite1); \
|
||||||
mk_multiplexer(b_msb, sz, pn_out.c_ptr(), pp_out.c_ptr(), ite2); \
|
mk_multiplexer(b_msb, sz, pn_out.data(), pp_out.data(), ite2); \
|
||||||
mk_multiplexer(a_msb, sz, ite1.c_ptr(), ite2.c_ptr(), out_bits)
|
mk_multiplexer(a_msb, sz, ite1.data(), ite2.data(), out_bits)
|
||||||
|
|
||||||
MK_MULTIPLEXER();
|
MK_MULTIPLEXER();
|
||||||
}
|
}
|
||||||
|
@ -638,12 +638,12 @@ void bit_blaster_tpl<Cfg>::mk_sdiv_srem_smod(unsigned sz, expr * const * a_bits,
|
||||||
expr_ref_vector nn_out(m());
|
expr_ref_vector nn_out(m());
|
||||||
|
|
||||||
if (!m().is_false(a_msb) && !m().is_true(b_msb))
|
if (!m().is_false(a_msb) && !m().is_true(b_msb))
|
||||||
mk_neg(sz, np_r.c_ptr(), np_out);
|
mk_neg(sz, np_r.data(), np_out);
|
||||||
else
|
else
|
||||||
np_out.resize(sz, m().mk_false());
|
np_out.resize(sz, m().mk_false());
|
||||||
|
|
||||||
if (!m().is_false(a_msb) && !m().is_false(b_msb))
|
if (!m().is_false(a_msb) && !m().is_false(b_msb))
|
||||||
mk_neg(sz, nn_r.c_ptr(), nn_out);
|
mk_neg(sz, nn_r.data(), nn_out);
|
||||||
else
|
else
|
||||||
nn_out.resize(sz, m().mk_false());
|
nn_out.resize(sz, m().mk_false());
|
||||||
MK_MULTIPLEXER();
|
MK_MULTIPLEXER();
|
||||||
|
@ -657,18 +657,18 @@ void bit_blaster_tpl<Cfg>::mk_sdiv_srem_smod(unsigned sz, expr * const * a_bits,
|
||||||
|
|
||||||
if (!m().is_false(a_msb) && !m().is_true(b_msb)) {
|
if (!m().is_false(a_msb) && !m().is_true(b_msb)) {
|
||||||
expr_ref cout(m());
|
expr_ref cout(m());
|
||||||
mk_subtracter(sz, b_bits, np_r.c_ptr(), np_out, cout);
|
mk_subtracter(sz, b_bits, np_r.data(), np_out, cout);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
np_out.resize(sz, m().mk_false());
|
np_out.resize(sz, m().mk_false());
|
||||||
|
|
||||||
if (!m().is_true(a_msb) && !m().is_false(b_msb))
|
if (!m().is_true(a_msb) && !m().is_false(b_msb))
|
||||||
mk_adder(sz, b_bits, pn_r.c_ptr(), pn_out);
|
mk_adder(sz, b_bits, pn_r.data(), pn_out);
|
||||||
else
|
else
|
||||||
pn_out.resize(sz, m().mk_false());
|
pn_out.resize(sz, m().mk_false());
|
||||||
|
|
||||||
if (!m().is_false(a_msb) && !m().is_false(b_msb))
|
if (!m().is_false(a_msb) && !m().is_false(b_msb))
|
||||||
mk_neg(sz, nn_r.c_ptr(), nn_out);
|
mk_neg(sz, nn_r.data(), nn_out);
|
||||||
else
|
else
|
||||||
nn_out.resize(sz, m().mk_false());
|
nn_out.resize(sz, m().mk_false());
|
||||||
|
|
||||||
|
@ -687,22 +687,22 @@ void bit_blaster_tpl<Cfg>::mk_sdiv(unsigned sz, expr * const * a_bits, expr * co
|
||||||
expr_ref_vector neg_b_bits(m());
|
expr_ref_vector neg_b_bits(m());
|
||||||
mk_neg(sz, b_bits, neg_b_bits);
|
mk_neg(sz, b_bits, neg_b_bits);
|
||||||
expr_ref_vector tmp(m());
|
expr_ref_vector tmp(m());
|
||||||
mk_udiv(sz, a_bits, neg_b_bits.c_ptr(), tmp);
|
mk_udiv(sz, a_bits, neg_b_bits.data(), tmp);
|
||||||
mk_neg(sz, tmp.c_ptr(), out_bits);
|
mk_neg(sz, tmp.data(), out_bits);
|
||||||
}
|
}
|
||||||
else if (m().is_true(a_msb) && m().is_false(b_msb)) {
|
else if (m().is_true(a_msb) && m().is_false(b_msb)) {
|
||||||
expr_ref_vector neg_a_bits(m());
|
expr_ref_vector neg_a_bits(m());
|
||||||
mk_neg(sz, a_bits, neg_a_bits);
|
mk_neg(sz, a_bits, neg_a_bits);
|
||||||
expr_ref_vector tmp(m());
|
expr_ref_vector tmp(m());
|
||||||
mk_udiv(sz, neg_a_bits.c_ptr(), b_bits, tmp);
|
mk_udiv(sz, neg_a_bits.data(), b_bits, tmp);
|
||||||
mk_neg(sz, tmp.c_ptr(), out_bits);
|
mk_neg(sz, tmp.data(), out_bits);
|
||||||
}
|
}
|
||||||
else if (m().is_true(a_msb) && m().is_true(b_msb)) {
|
else if (m().is_true(a_msb) && m().is_true(b_msb)) {
|
||||||
expr_ref_vector neg_a_bits(m());
|
expr_ref_vector neg_a_bits(m());
|
||||||
mk_neg(sz, a_bits, neg_a_bits);
|
mk_neg(sz, a_bits, neg_a_bits);
|
||||||
expr_ref_vector neg_b_bits(m());
|
expr_ref_vector neg_b_bits(m());
|
||||||
mk_neg(sz, b_bits, neg_b_bits);
|
mk_neg(sz, b_bits, neg_b_bits);
|
||||||
mk_udiv(sz, neg_a_bits.c_ptr(), neg_b_bits.c_ptr(), out_bits);
|
mk_udiv(sz, neg_a_bits.data(), neg_b_bits.data(), out_bits);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -715,12 +715,12 @@ void bit_blaster_tpl<Cfg>::mk_sdiv(unsigned sz, expr * const * a_bits, expr * co
|
||||||
mk_abs(sz, a_bits, abs_a_bits);
|
mk_abs(sz, a_bits, abs_a_bits);
|
||||||
mk_abs(sz, b_bits, abs_b_bits);
|
mk_abs(sz, b_bits, abs_b_bits);
|
||||||
expr_ref_vector udiv_bits(m());
|
expr_ref_vector udiv_bits(m());
|
||||||
mk_udiv(sz, abs_a_bits.c_ptr(), abs_b_bits.c_ptr(), udiv_bits);
|
mk_udiv(sz, abs_a_bits.data(), abs_b_bits.data(), udiv_bits);
|
||||||
expr_ref_vector neg_udiv_bits(m());
|
expr_ref_vector neg_udiv_bits(m());
|
||||||
mk_neg(sz, udiv_bits.c_ptr(), neg_udiv_bits);
|
mk_neg(sz, udiv_bits.data(), neg_udiv_bits);
|
||||||
expr_ref c(m());
|
expr_ref c(m());
|
||||||
mk_iff(a_msb, b_msb, c);
|
mk_iff(a_msb, b_msb, c);
|
||||||
mk_multiplexer(c, sz, udiv_bits.c_ptr(), neg_udiv_bits.c_ptr(), out_bits);
|
mk_multiplexer(c, sz, udiv_bits.data(), neg_udiv_bits.data(), out_bits);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -735,14 +735,14 @@ void bit_blaster_tpl<Cfg>::mk_srem(unsigned sz, expr * const * a_bits, expr * co
|
||||||
else if (m().is_false(a_msb) && m().is_true(b_msb)) {
|
else if (m().is_false(a_msb) && m().is_true(b_msb)) {
|
||||||
expr_ref_vector neg_b_bits(m());
|
expr_ref_vector neg_b_bits(m());
|
||||||
mk_neg(sz, b_bits, neg_b_bits);
|
mk_neg(sz, b_bits, neg_b_bits);
|
||||||
mk_urem(sz, a_bits, neg_b_bits.c_ptr(), out_bits);
|
mk_urem(sz, a_bits, neg_b_bits.data(), out_bits);
|
||||||
}
|
}
|
||||||
else if (m().is_true(a_msb) && m().is_false(b_msb)) {
|
else if (m().is_true(a_msb) && m().is_false(b_msb)) {
|
||||||
expr_ref_vector neg_a_bits(m());
|
expr_ref_vector neg_a_bits(m());
|
||||||
mk_neg(sz, a_bits, neg_a_bits);
|
mk_neg(sz, a_bits, neg_a_bits);
|
||||||
expr_ref_vector tmp(m());
|
expr_ref_vector tmp(m());
|
||||||
mk_urem(sz, neg_a_bits.c_ptr(), b_bits, tmp);
|
mk_urem(sz, neg_a_bits.data(), b_bits, tmp);
|
||||||
mk_neg(sz, tmp.c_ptr(), out_bits);
|
mk_neg(sz, tmp.data(), out_bits);
|
||||||
}
|
}
|
||||||
else if (m().is_true(a_msb) && m().is_true(b_msb)) {
|
else if (m().is_true(a_msb) && m().is_true(b_msb)) {
|
||||||
expr_ref_vector neg_a_bits(m());
|
expr_ref_vector neg_a_bits(m());
|
||||||
|
@ -750,8 +750,8 @@ void bit_blaster_tpl<Cfg>::mk_srem(unsigned sz, expr * const * a_bits, expr * co
|
||||||
expr_ref_vector neg_b_bits(m());
|
expr_ref_vector neg_b_bits(m());
|
||||||
mk_neg(sz, b_bits, neg_b_bits);
|
mk_neg(sz, b_bits, neg_b_bits);
|
||||||
expr_ref_vector tmp(m());
|
expr_ref_vector tmp(m());
|
||||||
mk_urem(sz, neg_a_bits.c_ptr(), neg_b_bits.c_ptr(), tmp);
|
mk_urem(sz, neg_a_bits.data(), neg_b_bits.data(), tmp);
|
||||||
mk_neg(sz, tmp.c_ptr(), out_bits);
|
mk_neg(sz, tmp.data(), out_bits);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -767,14 +767,14 @@ void bit_blaster_tpl<Cfg>::mk_srem(unsigned sz, expr * const * a_bits, expr * co
|
||||||
numeral n_b;
|
numeral n_b;
|
||||||
unsigned shift;
|
unsigned shift;
|
||||||
// a urem 2^n -> a & ((2^n)-1)
|
// a urem 2^n -> a & ((2^n)-1)
|
||||||
if (is_numeral(sz, abs_b_bits.c_ptr(), n_b) && n_b.is_power_of_two(shift)) {
|
if (is_numeral(sz, abs_b_bits.data(), n_b) && n_b.is_power_of_two(shift)) {
|
||||||
mk_zero_extend(shift, abs_a_bits.c_ptr(), sz - shift, urem_bits);
|
mk_zero_extend(shift, abs_a_bits.data(), sz - shift, urem_bits);
|
||||||
} else {
|
} else {
|
||||||
mk_urem(sz, abs_a_bits.c_ptr(), abs_b_bits.c_ptr(), urem_bits);
|
mk_urem(sz, abs_a_bits.data(), abs_b_bits.data(), urem_bits);
|
||||||
}
|
}
|
||||||
expr_ref_vector neg_urem_bits(m());
|
expr_ref_vector neg_urem_bits(m());
|
||||||
mk_neg(sz, urem_bits.c_ptr(), neg_urem_bits);
|
mk_neg(sz, urem_bits.data(), neg_urem_bits);
|
||||||
mk_multiplexer(a_msb, sz, neg_urem_bits.c_ptr(), urem_bits.c_ptr(), out_bits);
|
mk_multiplexer(a_msb, sz, neg_urem_bits.data(), urem_bits.data(), out_bits);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -816,17 +816,17 @@ void bit_blaster_tpl<Cfg>::mk_smod(unsigned sz, expr * const * a_bits, expr * co
|
||||||
mk_abs(sz, a_bits, abs_a_bits);
|
mk_abs(sz, a_bits, abs_a_bits);
|
||||||
mk_abs(sz, b_bits, abs_b_bits);
|
mk_abs(sz, b_bits, abs_b_bits);
|
||||||
expr_ref_vector u_bits(m());
|
expr_ref_vector u_bits(m());
|
||||||
mk_urem(sz, abs_a_bits.c_ptr(), abs_b_bits.c_ptr(), u_bits);
|
mk_urem(sz, abs_a_bits.data(), abs_b_bits.data(), u_bits);
|
||||||
expr_ref_vector neg_u_bits(m());
|
expr_ref_vector neg_u_bits(m());
|
||||||
mk_neg(sz, u_bits.c_ptr(), neg_u_bits);
|
mk_neg(sz, u_bits.data(), neg_u_bits);
|
||||||
expr_ref_vector neg_u_add_b(m());
|
expr_ref_vector neg_u_add_b(m());
|
||||||
mk_adder(sz, neg_u_bits.c_ptr(), b_bits, neg_u_add_b);
|
mk_adder(sz, neg_u_bits.data(), b_bits, neg_u_add_b);
|
||||||
expr_ref_vector u_add_b(m());
|
expr_ref_vector u_add_b(m());
|
||||||
mk_adder(sz, u_bits.c_ptr(), b_bits, u_add_b);
|
mk_adder(sz, u_bits.data(), b_bits, u_add_b);
|
||||||
expr_ref_vector zero(m());
|
expr_ref_vector zero(m());
|
||||||
num2bits(numeral(0), sz, zero);
|
num2bits(numeral(0), sz, zero);
|
||||||
expr_ref u_eq_0(m());
|
expr_ref u_eq_0(m());
|
||||||
mk_eq(sz, u_bits.c_ptr(), zero.c_ptr(), u_eq_0);
|
mk_eq(sz, u_bits.data(), zero.data(), u_eq_0);
|
||||||
|
|
||||||
expr_ref_vector & pp_bits = u_bits; // pos & pos case
|
expr_ref_vector & pp_bits = u_bits; // pos & pos case
|
||||||
expr_ref_vector & pn_bits = u_add_b; // pos & neg case
|
expr_ref_vector & pn_bits = u_add_b; // pos & neg case
|
||||||
|
@ -836,10 +836,10 @@ void bit_blaster_tpl<Cfg>::mk_smod(unsigned sz, expr * const * a_bits, expr * co
|
||||||
expr_ref_vector ite1(m());
|
expr_ref_vector ite1(m());
|
||||||
expr_ref_vector ite2(m());
|
expr_ref_vector ite2(m());
|
||||||
expr_ref_vector body(m());
|
expr_ref_vector body(m());
|
||||||
mk_multiplexer(b_msb, sz, nn_bits.c_ptr(), np_bits.c_ptr(), ite1);
|
mk_multiplexer(b_msb, sz, nn_bits.data(), np_bits.data(), ite1);
|
||||||
mk_multiplexer(b_msb, sz, pn_bits.c_ptr(), pp_bits.c_ptr(), ite2);
|
mk_multiplexer(b_msb, sz, pn_bits.data(), pp_bits.data(), ite2);
|
||||||
mk_multiplexer(a_msb, sz, ite1.c_ptr(), ite2.c_ptr(), body);
|
mk_multiplexer(a_msb, sz, ite1.data(), ite2.data(), body);
|
||||||
mk_multiplexer(u_eq_0, sz, u_bits.c_ptr(), body.c_ptr(), out_bits);
|
mk_multiplexer(u_eq_0, sz, u_bits.data(), body.data(), out_bits);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,7 +850,7 @@ void bit_blaster_tpl<Cfg>::mk_eq(unsigned sz, expr * const * a_bits, expr * cons
|
||||||
mk_iff(a_bits[i], b_bits[i], out);
|
mk_iff(a_bits[i], b_bits[i], out);
|
||||||
out_bits.push_back(out);
|
out_bits.push_back(out);
|
||||||
}
|
}
|
||||||
mk_and(out_bits.size(), out_bits.c_ptr(), out);
|
mk_and(out_bits.size(), out_bits.data(), out);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Cfg>
|
template<typename Cfg>
|
||||||
|
@ -910,7 +910,7 @@ void bit_blaster_tpl<Cfg>::mk_is_eq(unsigned sz, expr * const * a_bits, unsigned
|
||||||
}
|
}
|
||||||
n = n / 2;
|
n = n / 2;
|
||||||
}
|
}
|
||||||
mk_and(out_bits.size(), out_bits.c_ptr(), out);
|
mk_and(out_bits.size(), out_bits.data(), out);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1078,8 +1078,8 @@ void bit_blaster_tpl<Cfg>::mk_ext_rotate_left_right(unsigned sz, expr * const *
|
||||||
expr_ref_vector eqs(m());
|
expr_ref_vector eqs(m());
|
||||||
numeral sz_numeral(sz);
|
numeral sz_numeral(sz);
|
||||||
num2bits(sz_numeral, sz, sz_bits);
|
num2bits(sz_numeral, sz, sz_bits);
|
||||||
mk_urem(sz, b_bits, sz_bits.c_ptr(), masked_b_bits);
|
mk_urem(sz, b_bits, sz_bits.data(), masked_b_bits);
|
||||||
mk_eqs(sz, masked_b_bits.c_ptr(), eqs);
|
mk_eqs(sz, masked_b_bits.data(), eqs);
|
||||||
for (unsigned i = 0; i < sz; i++) {
|
for (unsigned i = 0; i < sz; i++) {
|
||||||
checkpoint();
|
checkpoint();
|
||||||
expr_ref out(m());
|
expr_ref out(m());
|
||||||
|
@ -1237,8 +1237,8 @@ void bit_blaster_tpl<Cfg>::mk_const_case_multiplier(bool is_a, unsigned i, unsig
|
||||||
else {
|
else {
|
||||||
numeral n_a, n_b;
|
numeral n_a, n_b;
|
||||||
SASSERT(i == sz && !is_a);
|
SASSERT(i == sz && !is_a);
|
||||||
VERIFY(is_numeral(sz, a_bits.c_ptr(), n_a));
|
VERIFY(is_numeral(sz, a_bits.data(), n_a));
|
||||||
VERIFY(is_numeral(sz, b_bits.c_ptr(), n_b));
|
VERIFY(is_numeral(sz, b_bits.data(), n_b));
|
||||||
n_a *= n_b;
|
n_a *= n_b;
|
||||||
num2bits(n_a, sz, out_bits);
|
num2bits(n_a, sz, out_bits);
|
||||||
}
|
}
|
||||||
|
@ -1274,12 +1274,12 @@ bool bit_blaster_tpl<Cfg>::mk_const_multiplier(unsigned sz, expr * const * a_bit
|
||||||
tmp.reset();
|
tmp.reset();
|
||||||
|
|
||||||
if (now && !last) {
|
if (now && !last) {
|
||||||
mk_adder(sz - i, out_bits.c_ptr() + i, minus_b_bits.c_ptr(), tmp);
|
mk_adder(sz - i, out_bits.data() + i, minus_b_bits.data(), tmp);
|
||||||
for (unsigned j = 0; j < (sz - i); j++)
|
for (unsigned j = 0; j < (sz - i); j++)
|
||||||
out_bits.set(i+j, tmp.get(j)); // do not use [], it does not work on Linux.
|
out_bits.set(i+j, tmp.get(j)); // do not use [], it does not work on Linux.
|
||||||
}
|
}
|
||||||
else if (!now && last) {
|
else if (!now && last) {
|
||||||
mk_adder(sz - i, out_bits.c_ptr() + i, b_bits, tmp);
|
mk_adder(sz - i, out_bits.data() + i, b_bits, tmp);
|
||||||
for (unsigned j = 0; j < (sz - i); j++)
|
for (unsigned j = 0; j < (sz - i); j++)
|
||||||
out_bits.set(i+j, tmp.get(j)); // do not use [], it does not work on Linux.
|
out_bits.set(i+j, tmp.get(j)); // do not use [], it does not work on Linux.
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ void bool_rewriter::mk_and_as_or(unsigned num_args, expr * const * args, expr_re
|
||||||
new_args.push_back(tmp);
|
new_args.push_back(tmp);
|
||||||
}
|
}
|
||||||
expr_ref tmp(m());
|
expr_ref tmp(m());
|
||||||
mk_or(new_args.size(), new_args.c_ptr(), tmp);
|
mk_or(new_args.size(), new_args.data(), tmp);
|
||||||
mk_not(tmp, result);
|
mk_not(tmp, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ br_status bool_rewriter::mk_flat_and_core(unsigned num_args, expr * const * args
|
||||||
flat_args.push_back(arg);
|
flat_args.push_back(arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mk_nflat_and_core(flat_args.size(), flat_args.c_ptr(), result) == BR_FAILED)
|
if (mk_nflat_and_core(flat_args.size(), flat_args.data(), result) == BR_FAILED)
|
||||||
result = m().mk_and(flat_args);
|
result = m().mk_and(flat_args);
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
|
@ -245,13 +245,13 @@ br_status bool_rewriter::mk_nflat_or_core(unsigned num_args, expr * const * args
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
default:
|
default:
|
||||||
if (m_local_ctx && m_local_ctx_cost <= m_local_ctx_limit) {
|
if (m_local_ctx && m_local_ctx_cost <= m_local_ctx_limit) {
|
||||||
if (local_ctx_simp(sz, buffer.c_ptr(), result))
|
if (local_ctx_simp(sz, buffer.data(), result))
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
if (s) {
|
if (s) {
|
||||||
ast_lt lt;
|
ast_lt lt;
|
||||||
std::sort(buffer.begin(), buffer.end(), lt);
|
std::sort(buffer.begin(), buffer.end(), lt);
|
||||||
result = m().mk_or(sz, buffer.c_ptr());
|
result = m().mk_or(sz, buffer.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
return BR_FAILED;
|
return BR_FAILED;
|
||||||
|
@ -285,7 +285,7 @@ br_status bool_rewriter::mk_flat_or_core(unsigned num_args, expr * const * args,
|
||||||
prev = arg;
|
prev = arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mk_nflat_or_core(flat_args.size(), flat_args.c_ptr(), result) == BR_FAILED) {
|
if (mk_nflat_or_core(flat_args.size(), flat_args.data(), result) == BR_FAILED) {
|
||||||
if (!ordered) {
|
if (!ordered) {
|
||||||
ast_lt lt;
|
ast_lt lt;
|
||||||
std::sort(flat_args.begin(), flat_args.end(), lt);
|
std::sort(flat_args.begin(), flat_args.end(), lt);
|
||||||
|
@ -595,7 +595,7 @@ bool bool_rewriter::local_ctx_simp(unsigned num_args, expr * const * args, expr_
|
||||||
return false; // didn't simplify
|
return false; // didn't simplify
|
||||||
}
|
}
|
||||||
// preserve the original order...
|
// preserve the original order...
|
||||||
std::reverse(new_args.c_ptr(), new_args.c_ptr() + new_args.size());
|
std::reverse(new_args.data(), new_args.data() + new_args.size());
|
||||||
modified = false;
|
modified = false;
|
||||||
forward = true;
|
forward = true;
|
||||||
}
|
}
|
||||||
|
@ -604,7 +604,7 @@ bool bool_rewriter::local_ctx_simp(unsigned num_args, expr * const * args, expr_
|
||||||
old_args.reset();
|
old_args.reset();
|
||||||
old_args.swap(new_args);
|
old_args.swap(new_args);
|
||||||
SASSERT(new_args.empty());
|
SASSERT(new_args.empty());
|
||||||
args = old_args.c_ptr();
|
args = old_args.data();
|
||||||
num_args = old_args.size();
|
num_args = old_args.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,12 +161,12 @@ public:
|
||||||
}
|
}
|
||||||
expr_ref mk_or(expr_ref_vector const& args) {
|
expr_ref mk_or(expr_ref_vector const& args) {
|
||||||
expr_ref result(m());
|
expr_ref result(m());
|
||||||
mk_or(args.size(), args.c_ptr(), result);
|
mk_or(args.size(), args.data(), result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
expr_ref mk_and(expr_ref_vector const& args) {
|
expr_ref mk_and(expr_ref_vector const& args) {
|
||||||
expr_ref result(m());
|
expr_ref result(m());
|
||||||
mk_and(args.size(), args.c_ptr(), result);
|
mk_and(args.size(), args.data(), result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -323,8 +323,8 @@ br_status bv_bounds::rewrite(unsigned limit, func_decl * f, unsigned num, expr *
|
||||||
switch (nargs.size()) {
|
switch (nargs.size()) {
|
||||||
case 0: result = negated ? m_m.mk_false() : m_m.mk_true(); return BR_DONE;
|
case 0: result = negated ? m_m.mk_false() : m_m.mk_true(); return BR_DONE;
|
||||||
case 1: result = nargs.get(0); return BR_DONE;
|
case 1: result = nargs.get(0); return BR_DONE;
|
||||||
default: result = negated ? m_m.mk_or(nargs.size(), nargs.c_ptr())
|
default: result = negated ? m_m.mk_or(nargs.size(), nargs.data())
|
||||||
: m_m.mk_and(nargs.size(), nargs.c_ptr());
|
: m_m.mk_and(nargs.size(), nargs.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ bool bv_elim_cfg::reduce_quantifier(quantifier * q,
|
||||||
_sorts.push_back(m.mk_bool_sort());
|
_sorts.push_back(m.mk_bool_sort());
|
||||||
_names.push_back(symbol(new_name.str()));
|
_names.push_back(symbol(new_name.str()));
|
||||||
}
|
}
|
||||||
bv = m.mk_app(bfid, OP_MKBV, 0, nullptr, args.size(), args.c_ptr());
|
bv = m.mk_app(bfid, OP_MKBV, 0, nullptr, args.size(), args.data());
|
||||||
_subst_map.push_back(bv.get());
|
_subst_map.push_back(bv.get());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -84,7 +84,7 @@ bool bv_elim_cfg::reduce_quantifier(quantifier * q,
|
||||||
subst_map.push_back(_subst_map[i]);
|
subst_map.push_back(_subst_map[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
expr* const* sub = subst_map.c_ptr();
|
expr* const* sub = subst_map.data();
|
||||||
unsigned sub_size = subst_map.size();
|
unsigned sub_size = subst_map.size();
|
||||||
|
|
||||||
new_body = subst(old_body, sub_size, sub);
|
new_body = subst(old_body, sub_size, sub);
|
||||||
|
@ -98,14 +98,14 @@ bool bv_elim_cfg::reduce_quantifier(quantifier * q,
|
||||||
|
|
||||||
result = m.mk_quantifier(forall_k,
|
result = m.mk_quantifier(forall_k,
|
||||||
names.size(),
|
names.size(),
|
||||||
sorts.c_ptr(),
|
sorts.data(),
|
||||||
names.c_ptr(),
|
names.data(),
|
||||||
new_body.get(),
|
new_body.get(),
|
||||||
q->get_weight(),
|
q->get_weight(),
|
||||||
q->get_qid(),
|
q->get_qid(),
|
||||||
q->get_skid(),
|
q->get_skid(),
|
||||||
pats.size(), pats.c_ptr(),
|
pats.size(), pats.data(),
|
||||||
no_pats.size(), no_pats.c_ptr());
|
no_pats.size(), no_pats.data());
|
||||||
result_pr = m.mk_rewrite(q, result);
|
result_pr = m.mk_rewrite(q, result);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,7 +374,7 @@ br_status bv_rewriter::rw_leq_concats(bool is_signed, expr * _a, expr * _b, expr
|
||||||
ptr_buffer<expr> new_args;
|
ptr_buffer<expr> new_args;
|
||||||
new_args.push_back(mk_numeral(af, af_sz - sz_min));
|
new_args.push_back(mk_numeral(af, af_sz - sz_min));
|
||||||
for (unsigned i = 1; i < numa; ++i) new_args.push_back(a->get_arg(i));
|
for (unsigned i = 1; i < numa; ++i) new_args.push_back(a->get_arg(i));
|
||||||
new_a = concat(new_args.size(), new_args.c_ptr());
|
new_a = concat(new_args.size(), new_args.data());
|
||||||
} else {
|
} else {
|
||||||
new_a = concat(numa - 1, a->get_args() + 1);
|
new_a = concat(numa - 1, a->get_args() + 1);
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ br_status bv_rewriter::rw_leq_concats(bool is_signed, expr * _a, expr * _b, expr
|
||||||
ptr_buffer<expr> new_args;
|
ptr_buffer<expr> new_args;
|
||||||
new_args.push_back(mk_numeral(bf, bf_sz - sz_min));
|
new_args.push_back(mk_numeral(bf, bf_sz - sz_min));
|
||||||
for (unsigned i = 1; i < numb; ++i) new_args.push_back(b->get_arg(i));
|
for (unsigned i = 1; i < numb; ++i) new_args.push_back(b->get_arg(i));
|
||||||
new_b = concat(new_args.size(), new_args.c_ptr());
|
new_b = concat(new_args.size(), new_args.data());
|
||||||
} else {
|
} else {
|
||||||
new_b = concat(numb - 1, b->get_args() + 1);
|
new_b = concat(numb - 1, b->get_args() + 1);
|
||||||
}
|
}
|
||||||
|
@ -659,7 +659,7 @@ unsigned bv_rewriter::propagate_extract(unsigned high, expr * arg, expr_ref & re
|
||||||
new_concat_args.push_back(new_first);
|
new_concat_args.push_back(new_first);
|
||||||
for (unsigned j = 1; j < conc_num; ++j)
|
for (unsigned j = 1; j < conc_num; ++j)
|
||||||
new_concat_args.push_back(to_app(curr)->get_arg(j));
|
new_concat_args.push_back(to_app(curr)->get_arg(j));
|
||||||
new_arg = m_util.mk_concat(new_concat_args.size(), new_concat_args.c_ptr());
|
new_arg = m_util.mk_concat(new_concat_args.size(), new_concat_args.data());
|
||||||
} else {
|
} else {
|
||||||
// remove first element of concat
|
// remove first element of concat
|
||||||
expr * const * const old_conc_args = to_app(curr)->get_args();
|
expr * const * const old_conc_args = to_app(curr)->get_args();
|
||||||
|
@ -675,7 +675,7 @@ unsigned bv_rewriter::propagate_extract(unsigned high, expr * arg, expr_ref & re
|
||||||
}
|
}
|
||||||
if (new_arg) new_args.push_back(new_arg);
|
if (new_arg) new_args.push_back(new_arg);
|
||||||
}
|
}
|
||||||
result = m().mk_app(get_fid(), a->get_decl()->get_decl_kind(), new_args.size(), new_args.c_ptr());
|
result = m().mk_app(get_fid(), a->get_decl()->get_decl_kind(), new_args.size(), new_args.data());
|
||||||
SASSERT(m_util.is_bv(result));
|
SASSERT(m_util.is_bv(result));
|
||||||
return removable;
|
return removable;
|
||||||
}
|
}
|
||||||
|
@ -755,11 +755,11 @@ br_status bv_rewriter::mk_extract(unsigned high, unsigned low, expr * arg, expr_
|
||||||
}
|
}
|
||||||
if (idx == low) {
|
if (idx == low) {
|
||||||
new_args.push_back(curr);
|
new_args.push_back(curr);
|
||||||
result = m_util.mk_concat(new_args.size(), new_args.c_ptr());
|
result = m_util.mk_concat(new_args.size(), new_args.data());
|
||||||
return used_extract ? BR_REWRITE2 : BR_DONE;
|
return used_extract ? BR_REWRITE2 : BR_DONE;
|
||||||
}
|
}
|
||||||
new_args.push_back(m_mk_extract(curr_sz - 1, low - idx, curr));
|
new_args.push_back(m_mk_extract(curr_sz - 1, low - idx, curr));
|
||||||
result = m_util.mk_concat(new_args.size(), new_args.c_ptr());
|
result = m_util.mk_concat(new_args.size(), new_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
@ -779,7 +779,7 @@ br_status bv_rewriter::mk_extract(unsigned high, unsigned low, expr * arg, expr_
|
||||||
expr * curr = to_app(arg)->get_arg(i);
|
expr * curr = to_app(arg)->get_arg(i);
|
||||||
new_args.push_back(m_mk_extract(high, low, curr));
|
new_args.push_back(m_mk_extract(high, low, curr));
|
||||||
}
|
}
|
||||||
result = m().mk_app(get_fid(), to_app(arg)->get_decl()->get_decl_kind(), new_args.size(), new_args.c_ptr());
|
result = m().mk_app(get_fid(), to_app(arg)->get_decl()->get_decl_kind(), new_args.size(), new_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1415,19 +1415,19 @@ br_status bv_rewriter::mk_bv2int(expr * arg, expr_ref & result) {
|
||||||
args[i] = std::move(tmp);
|
args[i] = std::move(tmp);
|
||||||
sz += get_bv_size(to_app(arg)->get_arg(i));
|
sz += get_bv_size(to_app(arg)->get_arg(i));
|
||||||
}
|
}
|
||||||
result = m_autil.mk_add(args.size(), args.c_ptr());
|
result = m_autil.mk_add(args.size(), args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
if (is_mul_no_overflow(arg)) {
|
if (is_mul_no_overflow(arg)) {
|
||||||
expr_ref_vector args(m());
|
expr_ref_vector args(m());
|
||||||
for (expr* x : *to_app(arg)) args.push_back(m_util.mk_bv2int(x));
|
for (expr* x : *to_app(arg)) args.push_back(m_util.mk_bv2int(x));
|
||||||
result = m_autil.mk_mul(args.size(), args.c_ptr());
|
result = m_autil.mk_mul(args.size(), args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
if (is_add_no_overflow(arg)) {
|
if (is_add_no_overflow(arg)) {
|
||||||
expr_ref_vector args(m());
|
expr_ref_vector args(m());
|
||||||
for (expr* x : *to_app(arg)) args.push_back(m_util.mk_bv2int(x));
|
for (expr* x : *to_app(arg)) args.push_back(m_util.mk_bv2int(x));
|
||||||
result = m_autil.mk_add(args.size(), args.c_ptr());
|
result = m_autil.mk_add(args.size(), args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1528,7 +1528,7 @@ br_status bv_rewriter::mk_concat(unsigned num_args, expr * const * args, expr_re
|
||||||
result = new_args.back();
|
result = new_args.back();
|
||||||
return fused_extract ? BR_REWRITE1 : BR_DONE;
|
return fused_extract ? BR_REWRITE1 : BR_DONE;
|
||||||
}
|
}
|
||||||
result = m_util.mk_concat(new_args.size(), new_args.c_ptr());
|
result = m_util.mk_concat(new_args.size(), new_args.data());
|
||||||
if (fused_extract)
|
if (fused_extract)
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
else if (expanded)
|
else if (expanded)
|
||||||
|
@ -1574,7 +1574,7 @@ br_status bv_rewriter::mk_sign_extend(unsigned n, expr * arg, expr_ref & result)
|
||||||
for (unsigned i = 0; i < n; i++)
|
for (unsigned i = 0; i < n; i++)
|
||||||
args.push_back(sign);
|
args.push_back(sign);
|
||||||
args.push_back(arg);
|
args.push_back(arg);
|
||||||
result = m_util.mk_concat(args.size(), args.c_ptr());
|
result = m_util.mk_concat(args.size(), args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1589,7 +1589,7 @@ br_status bv_rewriter::mk_repeat(unsigned n, expr * arg, expr_ref & result) {
|
||||||
ptr_buffer<expr> args;
|
ptr_buffer<expr> args;
|
||||||
for (unsigned i = 0; i < n; i++)
|
for (unsigned i = 0; i < n; i++)
|
||||||
args.push_back(arg);
|
args.push_back(arg);
|
||||||
result = m_util.mk_concat(args.size(), args.c_ptr());
|
result = m_util.mk_concat(args.size(), args.data());
|
||||||
return BR_REWRITE1;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1617,7 +1617,7 @@ br_status bv_rewriter::mk_bv_or(unsigned num, expr * const * args, expr_ref & re
|
||||||
if (flat_args.size() != num) {
|
if (flat_args.size() != num) {
|
||||||
flattened = true;
|
flattened = true;
|
||||||
num = flat_args.size();
|
num = flat_args.size();
|
||||||
args = flat_args.c_ptr();
|
args = flat_args.data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1696,7 +1696,7 @@ br_status bv_rewriter::mk_bv_or(unsigned num, expr * const * args, expr_ref & re
|
||||||
if (j != high)
|
if (j != high)
|
||||||
non_zero_args.push_back(m_mk_extract(high, j+1, concat1));
|
non_zero_args.push_back(m_mk_extract(high, j+1, concat1));
|
||||||
}
|
}
|
||||||
result = m_util.mk_concat(non_zero_args.size(), non_zero_args.c_ptr());
|
result = m_util.mk_concat(non_zero_args.size(), non_zero_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1732,7 +1732,7 @@ br_status bv_rewriter::mk_bv_or(unsigned num, expr * const * args, expr_ref & re
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::reverse(exs.begin(), exs.end());
|
std::reverse(exs.begin(), exs.end());
|
||||||
result = m_util.mk_concat(exs.size(), exs.c_ptr());
|
result = m_util.mk_concat(exs.size(), exs.data());
|
||||||
TRACE("mask_bug",
|
TRACE("mask_bug",
|
||||||
tout << "(assert (distinct (bvor (_ bv" << old_v1 << " " << sz << ")\n" << mk_ismt2_pp(t, m()) << ")\n";
|
tout << "(assert (distinct (bvor (_ bv" << old_v1 << " " << sz << ")\n" << mk_ismt2_pp(t, m()) << ")\n";
|
||||||
tout << mk_ismt2_pp(result, m()) << "))\n";);
|
tout << mk_ismt2_pp(result, m()) << "))\n";);
|
||||||
|
@ -1757,10 +1757,10 @@ br_status bv_rewriter::mk_bv_or(unsigned num, expr * const * args, expr_ref & re
|
||||||
default:
|
default:
|
||||||
if (m_bv_sort_ac)
|
if (m_bv_sort_ac)
|
||||||
std::sort(new_args.begin(), new_args.end(), ast_to_lt());
|
std::sort(new_args.begin(), new_args.end(), ast_to_lt());
|
||||||
if (distribute_concat(OP_BOR, new_args.size(), new_args.c_ptr(), result)) {
|
if (distribute_concat(OP_BOR, new_args.size(), new_args.data(), result)) {
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
result = m_util.mk_bv_or(new_args.size(), new_args.c_ptr());
|
result = m_util.mk_bv_or(new_args.size(), new_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1789,7 +1789,7 @@ br_status bv_rewriter::mk_bv_xor(unsigned num, expr * const * args, expr_ref & r
|
||||||
if (flat_args.size() != num) {
|
if (flat_args.size() != num) {
|
||||||
flattened = true;
|
flattened = true;
|
||||||
num = flat_args.size();
|
num = flat_args.size();
|
||||||
args = flat_args.c_ptr();
|
args = flat_args.data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1877,11 +1877,11 @@ br_status bv_rewriter::mk_bv_xor(unsigned num, expr * const * args, expr_ref & r
|
||||||
low = i;
|
low = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::reverse(exs.c_ptr(), exs.c_ptr() + exs.size());
|
std::reverse(exs.data(), exs.data() + exs.size());
|
||||||
if (exs.size() == 1)
|
if (exs.size() == 1)
|
||||||
result = exs[0];
|
result = exs[0];
|
||||||
else
|
else
|
||||||
result = m_util.mk_concat(exs.size(), exs.c_ptr());
|
result = m_util.mk_concat(exs.size(), exs.data());
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1933,10 +1933,10 @@ br_status bv_rewriter::mk_bv_xor(unsigned num, expr * const * args, expr_ref & r
|
||||||
default:
|
default:
|
||||||
if (m_bv_sort_ac)
|
if (m_bv_sort_ac)
|
||||||
std::sort(new_args.begin(), new_args.end(), ast_to_lt());
|
std::sort(new_args.begin(), new_args.end(), ast_to_lt());
|
||||||
if (distribute_concat(OP_BXOR, new_args.size(), new_args.c_ptr(), result)) {
|
if (distribute_concat(OP_BXOR, new_args.size(), new_args.data(), result)) {
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
result = m_util.mk_bv_xor(new_args.size(), new_args.c_ptr());
|
result = m_util.mk_bv_xor(new_args.size(), new_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1953,8 +1953,8 @@ bool bv_rewriter::distribute_concat(decl_kind k, unsigned n, expr* const* args,
|
||||||
args1.push_back(m_mk_extract(sz2 - 1, sz2 - sz1, args[j]));
|
args1.push_back(m_mk_extract(sz2 - 1, sz2 - sz1, args[j]));
|
||||||
args2.push_back(m_mk_extract(sz2 - sz1 - 1, 0, args[j]));
|
args2.push_back(m_mk_extract(sz2 - sz1 - 1, 0, args[j]));
|
||||||
}
|
}
|
||||||
expr* arg1 = m().mk_app(get_fid(), k, args1.size(), args1.c_ptr());
|
expr* arg1 = m().mk_app(get_fid(), k, args1.size(), args1.data());
|
||||||
expr* arg2 = m().mk_app(get_fid(), k, args2.size(), args2.c_ptr());
|
expr* arg2 = m().mk_app(get_fid(), k, args2.size(), args2.data());
|
||||||
result = m_util.mk_concat(arg1, arg2);
|
result = m_util.mk_concat(arg1, arg2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1981,7 +1981,7 @@ br_status bv_rewriter::mk_bv_not(expr * arg, expr_ref & result) {
|
||||||
for (expr* a : *to_app(arg)) {
|
for (expr* a : *to_app(arg)) {
|
||||||
new_args.push_back(m_util.mk_bv_not(a));
|
new_args.push_back(m_util.mk_bv_not(a));
|
||||||
}
|
}
|
||||||
result = m_util.mk_concat(new_args.size(), new_args.c_ptr());
|
result = m_util.mk_concat(new_args.size(), new_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2017,7 +2017,7 @@ br_status bv_rewriter::mk_bv_and(unsigned num, expr * const * args, expr_ref & r
|
||||||
new_args.push_back(m_util.mk_bv_not(args[i]));
|
new_args.push_back(m_util.mk_bv_not(args[i]));
|
||||||
}
|
}
|
||||||
SASSERT(num == new_args.size());
|
SASSERT(num == new_args.size());
|
||||||
result = m_util.mk_bv_not(m_util.mk_bv_or(new_args.size(), new_args.c_ptr()));
|
result = m_util.mk_bv_not(m_util.mk_bv_or(new_args.size(), new_args.data()));
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2026,7 +2026,7 @@ br_status bv_rewriter::mk_bv_nand(unsigned num, expr * const * args, expr_ref &
|
||||||
for (unsigned i = 0; i < num; i++) {
|
for (unsigned i = 0; i < num; i++) {
|
||||||
new_args.push_back(m_util.mk_bv_not(args[i]));
|
new_args.push_back(m_util.mk_bv_not(args[i]));
|
||||||
}
|
}
|
||||||
result = m_util.mk_bv_or(new_args.size(), new_args.c_ptr());
|
result = m_util.mk_bv_or(new_args.size(), new_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ br_status datatype_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr
|
||||||
new_args.push_back(a->get_arg(i));
|
new_args.push_back(a->get_arg(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = m().mk_app(c_decl, num, new_args.c_ptr());
|
result = m().mk_app(c_decl, num, new_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -137,6 +137,6 @@ br_status datatype_rewriter::mk_eq_core(expr * lhs, expr * rhs, expr_ref & resul
|
||||||
for (unsigned i = 0; i < num; ++i) {
|
for (unsigned i = 0; i < num; ++i) {
|
||||||
eqs.push_back(m().mk_eq(to_app(lhs)->get_arg(i), to_app(rhs)->get_arg(i)));
|
eqs.push_back(m().mk_eq(to_app(lhs)->get_arg(i), to_app(rhs)->get_arg(i)));
|
||||||
}
|
}
|
||||||
result = m().mk_and(eqs.size(), eqs.c_ptr());
|
result = m().mk_and(eqs.size(), eqs.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -319,7 +319,7 @@ void der::create_substitution(unsigned sz) {
|
||||||
expr_ref cur(m_map.get(m_order[i]), m);
|
expr_ref cur(m_map.get(m_order[i]), m);
|
||||||
|
|
||||||
// do all the previous substitutions before inserting
|
// do all the previous substitutions before inserting
|
||||||
expr_ref r = m_subst(cur, m_subst_map.size(), m_subst_map.c_ptr());
|
expr_ref r = m_subst(cur, m_subst_map.size(), m_subst_map.data());
|
||||||
|
|
||||||
unsigned inx = sz - m_order[i]- 1;
|
unsigned inx = sz - m_order[i]- 1;
|
||||||
SASSERT(m_subst_map[inx]==0);
|
SASSERT(m_subst_map[inx]==0);
|
||||||
|
@ -343,22 +343,22 @@ void der::apply_substitution(quantifier * q, expr_ref & r) {
|
||||||
|
|
||||||
unsigned sz = m_new_args.size();
|
unsigned sz = m_new_args.size();
|
||||||
expr_ref t(m);
|
expr_ref t(m);
|
||||||
t = (sz == 1) ? m_new_args[0] : m.mk_or(sz, m_new_args.c_ptr());
|
t = (sz == 1) ? m_new_args[0] : m.mk_or(sz, m_new_args.data());
|
||||||
expr_ref new_e = m_subst(t, m_subst_map.size(), m_subst_map.c_ptr());
|
expr_ref new_e = m_subst(t, m_subst_map.size(), m_subst_map.data());
|
||||||
|
|
||||||
// don't forget to update the quantifier patterns
|
// don't forget to update the quantifier patterns
|
||||||
expr_ref_buffer new_patterns(m);
|
expr_ref_buffer new_patterns(m);
|
||||||
expr_ref_buffer new_no_patterns(m);
|
expr_ref_buffer new_no_patterns(m);
|
||||||
for (unsigned j = 0; j < q->get_num_patterns(); j++) {
|
for (unsigned j = 0; j < q->get_num_patterns(); j++) {
|
||||||
new_patterns.push_back(m_subst(q->get_pattern(j), m_subst_map.size(), m_subst_map.c_ptr()));
|
new_patterns.push_back(m_subst(q->get_pattern(j), m_subst_map.size(), m_subst_map.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned j = 0; j < q->get_num_no_patterns(); j++) {
|
for (unsigned j = 0; j < q->get_num_no_patterns(); j++) {
|
||||||
new_no_patterns.push_back(m_subst(q->get_no_pattern(j), m_subst_map.size(), m_subst_map.c_ptr()));
|
new_no_patterns.push_back(m_subst(q->get_no_pattern(j), m_subst_map.size(), m_subst_map.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
r = m.update_quantifier(q, new_patterns.size(), new_patterns.c_ptr(),
|
r = m.update_quantifier(q, new_patterns.size(), new_patterns.data(),
|
||||||
new_no_patterns.size(), new_no_patterns.c_ptr(), new_e);
|
new_no_patterns.size(), new_no_patterns.data(), new_e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ void distribute_forall::reduce1_app(app * a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reduced) {
|
if (reduced) {
|
||||||
na = m_manager.mk_app(a->get_decl(), num_args, m_new_args.c_ptr());
|
na = m_manager.mk_app(a->get_decl(), num_args, m_new_args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
cache_result(a, na);
|
cache_result(a, na);
|
||||||
|
@ -131,7 +131,7 @@ void distribute_forall::reduce1_quantifier(quantifier * q) {
|
||||||
expr_ref result(m_manager);
|
expr_ref result(m_manager);
|
||||||
// m_bsimp.mk_and actually constructs a (not (or ...)) formula,
|
// m_bsimp.mk_and actually constructs a (not (or ...)) formula,
|
||||||
// it will also apply basic simplifications.
|
// it will also apply basic simplifications.
|
||||||
br.mk_and(new_args.size(), new_args.c_ptr(), result);
|
br.mk_and(new_args.size(), new_args.data(), result);
|
||||||
cache_result(q, result);
|
cache_result(q, result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -189,7 +189,7 @@ bool elim_bounds_cfg::reduce_quantifier(quantifier * q,
|
||||||
new_body = atoms[0];
|
new_body = atoms[0];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
new_body = m.mk_or(atoms.size(), atoms.c_ptr());
|
new_body = m.mk_or(atoms.size(), atoms.data());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
quantifier_ref new_q(m);
|
quantifier_ref new_q(m);
|
||||||
|
|
|
@ -94,7 +94,7 @@ struct enum2bv_rewriter::imp {
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
else if (m.is_distinct(f) && reduce_args(num, args, _args)) {
|
else if (m.is_distinct(f) && reduce_args(num, args, _args)) {
|
||||||
result = m.mk_distinct(_args.size(), _args.c_ptr());
|
result = m.mk_distinct(_args.size(), _args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
else if (m_dt.is_recognizer(f) && reduce_arg(args[0], a0)) {
|
else if (m_dt.is_recognizer(f) && reduce_arg(args[0], a0)) {
|
||||||
|
@ -229,7 +229,7 @@ struct enum2bv_rewriter::imp {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = m.mk_quantifier(q->get_kind(), q->get_num_decls(), m_sorts.c_ptr(), q->get_decl_names(), new_body_ref,
|
result = m.mk_quantifier(q->get_kind(), q->get_num_decls(), m_sorts.data(), q->get_decl_names(), new_body_ref,
|
||||||
q->get_weight(), q->get_qid(), q->get_skid(),
|
q->get_weight(), q->get_qid(), q->get_skid(),
|
||||||
q->get_num_patterns(), new_patterns,
|
q->get_num_patterns(), new_patterns,
|
||||||
q->get_num_no_patterns(), new_no_patterns);
|
q->get_num_no_patterns(), new_no_patterns);
|
||||||
|
|
|
@ -159,7 +159,7 @@ void expr_safe_replace::operator()(expr* e, expr_ref& res) {
|
||||||
}
|
}
|
||||||
replace(q->get_expr(), new_body);
|
replace(q->get_expr(), new_body);
|
||||||
}
|
}
|
||||||
b = m.update_quantifier(q, pats.size(), pats.c_ptr(), nopats.size(), nopats.c_ptr(), new_body);
|
b = m.update_quantifier(q, pats.size(), pats.data(), nopats.size(), nopats.data(), new_body);
|
||||||
m_refs.push_back(b);
|
m_refs.push_back(b);
|
||||||
cached = b;
|
cached = b;
|
||||||
m_todo.pop_back();
|
m_todo.pop_back();
|
||||||
|
|
|
@ -62,7 +62,7 @@ br_status factor_rewriter::mk_eq(expr * arg1, expr * arg2, expr_ref & result) {
|
||||||
expr* e = it->m_key;
|
expr* e = it->m_key;
|
||||||
eqs.push_back(m().mk_eq(e, a().mk_numeral(rational(0), e->get_sort())));
|
eqs.push_back(m().mk_eq(e, a().mk_numeral(rational(0), e->get_sort())));
|
||||||
}
|
}
|
||||||
result = m().mk_or(eqs.size(), eqs.c_ptr());
|
result = m().mk_or(eqs.size(), eqs.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ br_status factor_rewriter::mk_le(expr * arg1, expr * arg2, expr_ref & result) {
|
||||||
expr_ref_vector eqs(m());
|
expr_ref_vector eqs(m());
|
||||||
mk_is_negative(neg, eqs);
|
mk_is_negative(neg, eqs);
|
||||||
eqs.push_back(neg);
|
eqs.push_back(neg);
|
||||||
result = m().mk_or(eqs.size(), eqs.c_ptr());
|
result = m().mk_or(eqs.size(), eqs.data());
|
||||||
TRACE("factor_rewriter",
|
TRACE("factor_rewriter",
|
||||||
tout << mk_pp(arg1, m()) << " <= " << mk_pp(arg2, m()) << "\n";
|
tout << mk_pp(arg1, m()) << " <= " << mk_pp(arg2, m()) << "\n";
|
||||||
tout << mk_pp(result.get(), m()) << "\n";);
|
tout << mk_pp(result.get(), m()) << "\n";);
|
||||||
|
@ -115,7 +115,7 @@ br_status factor_rewriter::mk_lt(expr * arg1, expr * arg2, expr_ref & result) {
|
||||||
eqs[i] = m().mk_not(eqs[i].get());
|
eqs[i] = m().mk_not(eqs[i].get());
|
||||||
}
|
}
|
||||||
eqs.push_back(neg);
|
eqs.push_back(neg);
|
||||||
result = m().mk_and(eqs.size(), eqs.c_ptr());
|
result = m().mk_and(eqs.size(), eqs.data());
|
||||||
TRACE("factor_rewriter", tout << mk_pp(result.get(), m()) << "\n";);
|
TRACE("factor_rewriter", tout << mk_pp(result.get(), m()) << "\n";);
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ bool factor_rewriter::extract_factors() {
|
||||||
SASSERT(!m_muls.empty());
|
SASSERT(!m_muls.empty());
|
||||||
if (m_muls.size() == 1) {
|
if (m_muls.size() == 1) {
|
||||||
if (m_muls[0].size() > 1) {
|
if (m_muls[0].size() > 1) {
|
||||||
m_factors.append(m_muls[0].size(), m_muls[0].c_ptr());
|
m_factors.append(m_muls[0].size(), m_muls[0].data());
|
||||||
if (!m_adds[0].second) {
|
if (!m_adds[0].second) {
|
||||||
bool found_numeral = false;
|
bool found_numeral = false;
|
||||||
sort* s = m_muls[0][0]->get_sort();
|
sort* s = m_muls[0][0]->get_sort();
|
||||||
|
@ -311,7 +311,7 @@ bool factor_rewriter::extract_factors() {
|
||||||
e = m_muls[i][0];
|
e = m_muls[i][0];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
e = a().mk_mul(m_muls[i].size(), m_muls[i].c_ptr());
|
e = a().mk_mul(m_muls[i].size(), m_muls[i].data());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!m_adds[i].second) {
|
if (!m_adds[i].second) {
|
||||||
|
@ -326,7 +326,7 @@ bool factor_rewriter::extract_factors() {
|
||||||
m_factors.push_back(trail[0].get());
|
m_factors.push_back(trail[0].get());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
m_factors.push_back(a().mk_add(trail.size(), trail.c_ptr()));
|
m_factors.push_back(a().mk_add(trail.size(), trail.data()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TRACE("factor_rewriter",
|
TRACE("factor_rewriter",
|
||||||
|
|
|
@ -51,7 +51,7 @@ expr_ref func_decl_replace::operator()(expr* e) {
|
||||||
}
|
}
|
||||||
if (m_args.size() == n) {
|
if (m_args.size() == n) {
|
||||||
if (arg_differs) {
|
if (arg_differs) {
|
||||||
b = m.mk_app(c->get_decl(), m_args.size(), m_args.c_ptr());
|
b = m.mk_app(c->get_decl(), m_args.size(), m_args.data());
|
||||||
m_refs.push_back(b);
|
m_refs.push_back(b);
|
||||||
SASSERT(a->get_sort() == b->get_sort());
|
SASSERT(a->get_sort() == b->get_sort());
|
||||||
} else {
|
} else {
|
||||||
|
@ -59,7 +59,7 @@ expr_ref func_decl_replace::operator()(expr* e) {
|
||||||
}
|
}
|
||||||
func_decl* f = nullptr;
|
func_decl* f = nullptr;
|
||||||
if (m_subst.find(c->get_decl(), f)) {
|
if (m_subst.find(c->get_decl(), f)) {
|
||||||
b = m.mk_app(f, m_args.size(), m_args.c_ptr());
|
b = m.mk_app(f, m_args.size(), m_args.data());
|
||||||
m_refs.push_back(b);
|
m_refs.push_back(b);
|
||||||
}
|
}
|
||||||
m_cache.insert(a, b);
|
m_cache.insert(a, b);
|
||||||
|
|
|
@ -107,7 +107,7 @@ bool simplify_inj_axiom(ast_manager & m, quantifier * q, expr_ref & result) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SASSERT(var != 0);
|
SASSERT(var != 0);
|
||||||
app * f = m.mk_app(decl, f_args.size(), f_args.c_ptr());
|
app * f = m.mk_app(decl, f_args.size(), f_args.data());
|
||||||
|
|
||||||
ptr_vector<sort> domain;
|
ptr_vector<sort> domain;
|
||||||
inv_vars.push_back(f);
|
inv_vars.push_back(f);
|
||||||
|
@ -115,9 +115,9 @@ bool simplify_inj_axiom(ast_manager & m, quantifier * q, expr_ref & result) {
|
||||||
domain.push_back(inv_vars[i]->get_sort());
|
domain.push_back(inv_vars[i]->get_sort());
|
||||||
}
|
}
|
||||||
sort * d = decl->get_domain(idx);
|
sort * d = decl->get_domain(idx);
|
||||||
func_decl * inv_decl = m.mk_fresh_func_decl("inj", domain.size(), domain.c_ptr(), d);
|
func_decl * inv_decl = m.mk_fresh_func_decl("inj", domain.size(), domain.data(), d);
|
||||||
|
|
||||||
expr * proj = m.mk_app(inv_decl, inv_vars.size(), inv_vars.c_ptr());
|
expr * proj = m.mk_app(inv_decl, inv_vars.size(), inv_vars.data());
|
||||||
expr * eq = m.mk_eq(proj, var);
|
expr * eq = m.mk_eq(proj, var);
|
||||||
expr * p = m.mk_pattern(f);
|
expr * p = m.mk_pattern(f);
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ bool simplify_inj_axiom(ast_manager & m, quantifier * q, expr_ref & result) {
|
||||||
// Remark: the sort of the var 0 must be in the last position.
|
// Remark: the sort of the var 0 must be in the last position.
|
||||||
std::reverse(decls.begin(), decls.end());
|
std::reverse(decls.begin(), decls.end());
|
||||||
|
|
||||||
result = m.mk_forall(decls.size(), decls.c_ptr(), names.c_ptr(), eq,
|
result = m.mk_forall(decls.size(), decls.data(), names.data(), eq,
|
||||||
0, symbol(), symbol(), 1, &p);
|
0, symbol(), symbol(), 1, &p);
|
||||||
TRACE("inj_axiom", tout << "new axiom:\n" << mk_pp(result, m) << "\n";);
|
TRACE("inj_axiom", tout << "new axiom:\n" << mk_pp(result, m) << "\n";);
|
||||||
SASSERT(is_well_sorted(m, result));
|
SASSERT(is_well_sorted(m, result));
|
||||||
|
|
|
@ -156,7 +156,7 @@ struct pb2bv_rewriter::imp {
|
||||||
//sort_args();
|
//sort_args();
|
||||||
gcd_reduce<is_le>(m_coeffs, k);
|
gcd_reduce<is_le>(m_coeffs, k);
|
||||||
unsigned sz = m_args.size();
|
unsigned sz = m_args.size();
|
||||||
expr * const* args = m_args.c_ptr();
|
expr * const* args = m_args.data();
|
||||||
TRACE("pb",
|
TRACE("pb",
|
||||||
for (unsigned i = 0; i < sz; ++i) {
|
for (unsigned i = 0; i < sz; ++i) {
|
||||||
tout << m_coeffs[i] << "*" << mk_pp(args[i], m) << " ";
|
tout << m_coeffs[i] << "*" << mk_pp(args[i], m) << " ";
|
||||||
|
@ -277,7 +277,7 @@ struct pb2bv_rewriter::imp {
|
||||||
rational bound;
|
rational bound;
|
||||||
flip(sz, args, args1, _k, bound);
|
flip(sz, args, args1, _k, bound);
|
||||||
if (bound.get_unsigned() < k) {
|
if (bound.get_unsigned() < k) {
|
||||||
return mk_ge_tot(sz, args1.c_ptr(), bound, result);
|
return mk_ge_tot(sz, args1.data(), bound, result);
|
||||||
}
|
}
|
||||||
if (k > 20) {
|
if (k > 20) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -295,7 +295,7 @@ struct pb2bv_rewriter::imp {
|
||||||
rational bound;
|
rational bound;
|
||||||
flip(sz, args, args1, _k, bound);
|
flip(sz, args, args1, _k, bound);
|
||||||
if (bound.get_unsigned() < k) {
|
if (bound.get_unsigned() < k) {
|
||||||
return mk_le_tot(sz, args1.c_ptr(), bound, result);
|
return mk_le_tot(sz, args1.data(), bound, result);
|
||||||
}
|
}
|
||||||
if (k > 20) {
|
if (k > 20) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -519,7 +519,7 @@ struct pb2bv_rewriter::imp {
|
||||||
tout << "\n";
|
tout << "\n";
|
||||||
);
|
);
|
||||||
ptr_vector<expr> out;
|
ptr_vector<expr> out;
|
||||||
m_sort.sorting(carry.size(), carry.c_ptr(), out);
|
m_sort.sorting(carry.size(), carry.data(), out);
|
||||||
|
|
||||||
expr_ref gt = mod_ge(out, B, d_i + 1);
|
expr_ref gt = mod_ge(out, B, d_i + 1);
|
||||||
expr_ref ge = mod_ge(out, B, d_i);
|
expr_ref ge = mod_ge(out, B, d_i);
|
||||||
|
@ -557,13 +557,13 @@ struct pb2bv_rewriter::imp {
|
||||||
}
|
}
|
||||||
switch (is_le) {
|
switch (is_le) {
|
||||||
case l_true:
|
case l_true:
|
||||||
result = m_sort.le(k.get_unsigned(), coeffs.size(), coeffs.c_ptr(), m_args.c_ptr());
|
result = m_sort.le(k.get_unsigned(), coeffs.size(), coeffs.data(), m_args.data());
|
||||||
break;
|
break;
|
||||||
case l_false:
|
case l_false:
|
||||||
result = m_sort.ge(k.get_unsigned(), coeffs.size(), coeffs.c_ptr(), m_args.c_ptr());
|
result = m_sort.ge(k.get_unsigned(), coeffs.size(), coeffs.data(), m_args.data());
|
||||||
break;
|
break;
|
||||||
case l_undef:
|
case l_undef:
|
||||||
result = m_sort.eq(k.get_unsigned(), coeffs.size(), coeffs.c_ptr(), m_args.c_ptr());
|
result = m_sort.eq(k.get_unsigned(), coeffs.size(), coeffs.data(), m_args.data());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -588,7 +588,7 @@ struct pb2bv_rewriter::imp {
|
||||||
expr_ref mk_seg_le(rational const& k) {
|
expr_ref mk_seg_le(rational const& k) {
|
||||||
sort_args();
|
sort_args();
|
||||||
unsigned sz = m_args.size();
|
unsigned sz = m_args.size();
|
||||||
expr* const* args = m_args.c_ptr();
|
expr* const* args = m_args.data();
|
||||||
|
|
||||||
// Create sorted entries.
|
// Create sorted entries.
|
||||||
vector<ptr_vector<expr>> outs;
|
vector<ptr_vector<expr>> outs;
|
||||||
|
@ -661,7 +661,7 @@ struct pb2bv_rewriter::imp {
|
||||||
args1.push_back(mk_not(args[i]));
|
args1.push_back(mk_not(args[i]));
|
||||||
bound += m_coeffs[i];
|
bound += m_coeffs[i];
|
||||||
}
|
}
|
||||||
return mk_ge(sz, args1.c_ptr(), bound, result);
|
return mk_ge(sz, args1.data(), bound, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mk_eq(unsigned sz, expr * const* args, rational const& k, expr_ref& result) {
|
bool mk_eq(unsigned sz, expr * const* args, rational const& k, expr_ref& result) {
|
||||||
|
|
|
@ -96,7 +96,7 @@ expr_ref pb_rewriter::translate_pb2lia(obj_map<expr,expr*>& vars, expr* fml) {
|
||||||
tmp = a.mk_numeral(rational(0), true);
|
tmp = a.mk_numeral(rational(0), true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmp = a.mk_add(es.size(), es.c_ptr());
|
tmp = a.mk_add(es.size(), es.data());
|
||||||
}
|
}
|
||||||
if (util.is_at_most_k(fml)) {
|
if (util.is_at_most_k(fml)) {
|
||||||
result = a.mk_le(tmp, a.mk_numeral(util.get_k(fml), false));
|
result = a.mk_le(tmp, a.mk_numeral(util.get_k(fml), false));
|
||||||
|
@ -113,7 +113,7 @@ expr_ref pb_rewriter::translate_pb2lia(obj_map<expr,expr*>& vars, expr* fml) {
|
||||||
tmp = a.mk_numeral(rational(0), true);
|
tmp = a.mk_numeral(rational(0), true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmp = a.mk_add(es.size(), es.c_ptr());
|
tmp = a.mk_add(es.size(), es.data());
|
||||||
}
|
}
|
||||||
rational k = util.get_k(fml);
|
rational k = util.get_k(fml);
|
||||||
if (util.is_le(fml)) {
|
if (util.is_le(fml)) {
|
||||||
|
@ -172,7 +172,7 @@ expr_ref pb_rewriter::mk_validate_rewrite(app_ref& e1, app_ref& e2) {
|
||||||
expr_ref fml2 = translate_pb2lia(vars, e2);
|
expr_ref fml2 = translate_pb2lia(vars, e2);
|
||||||
tmp = m.mk_not(m.mk_eq(fml1, fml2));
|
tmp = m.mk_not(m.mk_eq(fml1, fml2));
|
||||||
fmls.push_back(tmp);
|
fmls.push_back(tmp);
|
||||||
tmp = m.mk_and(fmls.size(), fmls.c_ptr());
|
tmp = m.mk_and(fmls.size(), fmls.data());
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,23 +267,23 @@ br_status pb_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * cons
|
||||||
result = k.is_zero()?m.mk_true():m.mk_false();
|
result = k.is_zero()?m.mk_true():m.mk_false();
|
||||||
}
|
}
|
||||||
else if (k.is_zero()) {
|
else if (k.is_zero()) {
|
||||||
result = mk_not(m, mk_or(m, sz, m_args.c_ptr()));
|
result = mk_not(m, mk_or(m, sz, m_args.data()));
|
||||||
}
|
}
|
||||||
else if (k.is_one() && all_unit && m_args.size() == 1) {
|
else if (k.is_one() && all_unit && m_args.size() == 1) {
|
||||||
result = m_args.back();
|
result = m_args.back();
|
||||||
}
|
}
|
||||||
else if (slack == k) {
|
else if (slack == k) {
|
||||||
result = mk_and(m, sz, m_args.c_ptr());
|
result = mk_and(m, sz, m_args.data());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = m_util.mk_eq(sz, m_coeffs.c_ptr(), m_args.c_ptr(), k);
|
result = m_util.mk_eq(sz, m_coeffs.data(), m_args.data(), k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (all_unit && k.is_one() && sz < 10) {
|
else if (all_unit && k.is_one() && sz < 10) {
|
||||||
result = mk_or(m, sz, m_args.c_ptr());
|
result = mk_or(m, sz, m_args.data());
|
||||||
}
|
}
|
||||||
else if (all_unit && k == rational(sz)) {
|
else if (all_unit && k == rational(sz)) {
|
||||||
result = mk_and(m, sz, m_args.c_ptr());
|
result = mk_and(m, sz, m_args.data());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
expr_ref_vector conj(m), disj(m);
|
expr_ref_vector conj(m), disj(m);
|
||||||
|
@ -309,7 +309,7 @@ br_status pb_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * cons
|
||||||
m_coeffs.shrink(j);
|
m_coeffs.shrink(j);
|
||||||
sz = j;
|
sz = j;
|
||||||
if (sz > 0) {
|
if (sz > 0) {
|
||||||
disj.push_back(m_util.mk_ge(sz, m_coeffs.c_ptr(), m_args.c_ptr(), k));
|
disj.push_back(m_util.mk_ge(sz, m_coeffs.data(), m_args.data(), k));
|
||||||
}
|
}
|
||||||
if (!disj.empty()) {
|
if (!disj.empty()) {
|
||||||
conj.push_back(mk_or(disj));
|
conj.push_back(mk_or(disj));
|
||||||
|
|
|
@ -116,9 +116,9 @@ expr * poly_rewriter<Config>::mk_mul_app(unsigned num_args, expr * const * args)
|
||||||
else {
|
else {
|
||||||
numeral a;
|
numeral a;
|
||||||
if (new_args.size() > 2 && is_numeral(new_args.get(0), a)) {
|
if (new_args.size() > 2 && is_numeral(new_args.get(0), a)) {
|
||||||
return mk_mul_app(a, mk_mul_app(new_args.size() - 1, new_args.c_ptr() + 1));
|
return mk_mul_app(a, mk_mul_app(new_args.size() - 1, new_args.data() + 1));
|
||||||
}
|
}
|
||||||
return m().mk_app(get_fid(), mul_decl_kind(), new_args.size(), new_args.c_ptr());
|
return m().mk_app(get_fid(), mul_decl_kind(), new_args.size(), new_args.data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -185,7 +185,7 @@ br_status poly_rewriter<Config>::mk_flat_mul_core(unsigned num_args, expr * cons
|
||||||
flat_args.push_back(args[j]);
|
flat_args.push_back(args[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
br_status st = mk_nflat_mul_core(flat_args.size(), flat_args.c_ptr(), result);
|
br_status st = mk_nflat_mul_core(flat_args.size(), flat_args.data(), result);
|
||||||
TRACE("poly_rewriter",
|
TRACE("poly_rewriter",
|
||||||
tout << "flat mul:\n";
|
tout << "flat mul:\n";
|
||||||
for (unsigned i = 0; i < num_args; i++) tout << mk_bounded_pp(args[i], m()) << "\n";
|
for (unsigned i = 0; i < num_args; i++) tout << mk_bounded_pp(args[i], m()) << "\n";
|
||||||
|
@ -194,7 +194,7 @@ br_status poly_rewriter<Config>::mk_flat_mul_core(unsigned num_args, expr * cons
|
||||||
tout << st << "\n";
|
tout << st << "\n";
|
||||||
);
|
);
|
||||||
if (st == BR_FAILED) {
|
if (st == BR_FAILED) {
|
||||||
result = mk_mul_app(flat_args.size(), flat_args.c_ptr());
|
result = mk_mul_app(flat_args.size(), flat_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
return st;
|
return st;
|
||||||
|
@ -290,7 +290,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
|
||||||
for (unsigned i = 0; i < num; i++) {
|
for (unsigned i = 0; i < num; i++) {
|
||||||
new_add_args.push_back(mk_mul_app(c, to_app(var)->get_arg(i)));
|
new_add_args.push_back(mk_mul_app(c, to_app(var)->get_arg(i)));
|
||||||
}
|
}
|
||||||
result = mk_add_app(new_add_args.size(), new_add_args.c_ptr());
|
result = mk_add_app(new_add_args.size(), new_add_args.data());
|
||||||
TRACE("mul_bug", tout << "result: " << mk_bounded_pp(result, m(),5) << "\n";);
|
TRACE("mul_bug", tout << "result: " << mk_bounded_pp(result, m(),5) << "\n";);
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
|
||||||
m_args.push_back(args[i]);
|
m_args.push_back(args[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = mk_mul_app(c, mk_mul_app(m_args.size(), m_args.c_ptr()));
|
result = mk_mul_app(c, mk_mul_app(m_args.size(), m_args.data()));
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
|
||||||
tout << "\n";);
|
tout << "\n";);
|
||||||
}
|
}
|
||||||
SASSERT(new_args.size() >= 2);
|
SASSERT(new_args.size() >= 2);
|
||||||
result = mk_mul_app(new_args.size(), new_args.c_ptr());
|
result = mk_mul_app(new_args.size(), new_args.data());
|
||||||
result = mk_mul_app(c, result);
|
result = mk_mul_app(c, result);
|
||||||
TRACE("poly_rewriter",
|
TRACE("poly_rewriter",
|
||||||
for (unsigned i = 0; i < num_args; ++i)
|
for (unsigned i = 0; i < num_args; ++i)
|
||||||
|
@ -387,10 +387,10 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
|
||||||
expr * arg = v[it[i]];
|
expr * arg = v[it[i]];
|
||||||
m_args.push_back(arg);
|
m_args.push_back(arg);
|
||||||
}
|
}
|
||||||
sum.push_back(mk_mul_app(m_args.size(), m_args.c_ptr()));
|
sum.push_back(mk_mul_app(m_args.size(), m_args.data()));
|
||||||
}
|
}
|
||||||
while (product_iterator_next(szs.size(), szs.c_ptr(), it.c_ptr()));
|
while (product_iterator_next(szs.size(), szs.data(), it.data()));
|
||||||
result = mk_add_app(sum.size(), sum.c_ptr());
|
result = mk_add_app(sum.size(), sum.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,9 +417,9 @@ br_status poly_rewriter<Config>::mk_flat_add_core(unsigned num_args, expr * cons
|
||||||
flat_args.push_back(arg);
|
flat_args.push_back(arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
br_status st = mk_nflat_add_core(flat_args.size(), flat_args.c_ptr(), result);
|
br_status st = mk_nflat_add_core(flat_args.size(), flat_args.data(), result);
|
||||||
if (st == BR_FAILED) {
|
if (st == BR_FAILED) {
|
||||||
result = mk_add_app(flat_args.size(), flat_args.c_ptr());
|
result = mk_add_app(flat_args.size(), flat_args.data());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
return st;
|
return st;
|
||||||
|
@ -616,11 +616,11 @@ br_status poly_rewriter<Config>::mk_nflat_add_core(unsigned num_args, expr * con
|
||||||
if (m_sort_sums) {
|
if (m_sort_sums) {
|
||||||
TRACE("rewriter_bug", tout << "new_args.size(): " << new_args.size() << "\n";);
|
TRACE("rewriter_bug", tout << "new_args.size(): " << new_args.size() << "\n";);
|
||||||
if (c.is_zero())
|
if (c.is_zero())
|
||||||
std::sort(new_args.c_ptr(), new_args.c_ptr() + new_args.size(), mon_lt(*this));
|
std::sort(new_args.data(), new_args.data() + new_args.size(), mon_lt(*this));
|
||||||
else
|
else
|
||||||
std::sort(new_args.c_ptr() + 1, new_args.c_ptr() + new_args.size(), mon_lt(*this));
|
std::sort(new_args.data() + 1, new_args.data() + new_args.size(), mon_lt(*this));
|
||||||
}
|
}
|
||||||
result = mk_add_app(new_args.size(), new_args.c_ptr());
|
result = mk_add_app(new_args.size(), new_args.data());
|
||||||
TRACE("rewriter", tout << result << "\n";);
|
TRACE("rewriter", tout << result << "\n";);
|
||||||
if (hoist_multiplication(result)) {
|
if (hoist_multiplication(result)) {
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
|
@ -649,11 +649,11 @@ br_status poly_rewriter<Config>::mk_nflat_add_core(unsigned num_args, expr * con
|
||||||
}
|
}
|
||||||
if (!ordered) {
|
if (!ordered) {
|
||||||
if (c.is_zero())
|
if (c.is_zero())
|
||||||
std::sort(new_args.c_ptr(), new_args.c_ptr() + new_args.size(), lt);
|
std::sort(new_args.data(), new_args.data() + new_args.size(), lt);
|
||||||
else
|
else
|
||||||
std::sort(new_args.c_ptr() + 1, new_args.c_ptr() + new_args.size(), lt);
|
std::sort(new_args.data() + 1, new_args.data() + new_args.size(), lt);
|
||||||
}
|
}
|
||||||
result = mk_add_app(new_args.size(), new_args.c_ptr());
|
result = mk_add_app(new_args.size(), new_args.data());
|
||||||
if (hoist_multiplication(result)) {
|
if (hoist_multiplication(result)) {
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
|
@ -697,7 +697,7 @@ br_status poly_rewriter<Config>::mk_sub(unsigned num_args, expr * const * args,
|
||||||
expr * aux_args[2] = { minus_one, args[i] };
|
expr * aux_args[2] = { minus_one, args[i] };
|
||||||
new_args.push_back(mk_mul_app(2, aux_args));
|
new_args.push_back(mk_mul_app(2, aux_args));
|
||||||
}
|
}
|
||||||
result = mk_add_app(new_args.size(), new_args.c_ptr());
|
result = mk_add_app(new_args.size(), new_args.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,8 +878,8 @@ br_status poly_rewriter<Config>::cancel_monomials(expr * lhs, expr * rhs, bool m
|
||||||
const unsigned rhs_offset = insert_c_rhs ? 0 : 1;
|
const unsigned rhs_offset = insert_c_rhs ? 0 : 1;
|
||||||
new_rhs_monomials[0] = insert_c_rhs ? mk_numeral(c) : nullptr;
|
new_rhs_monomials[0] = insert_c_rhs ? mk_numeral(c) : nullptr;
|
||||||
new_lhs_monomials[0] = insert_c_lhs ? mk_numeral(c) : nullptr;
|
new_lhs_monomials[0] = insert_c_lhs ? mk_numeral(c) : nullptr;
|
||||||
lhs_result = mk_add_app(new_lhs_monomials.size() - lhs_offset, new_lhs_monomials.c_ptr() + lhs_offset);
|
lhs_result = mk_add_app(new_lhs_monomials.size() - lhs_offset, new_lhs_monomials.data() + lhs_offset);
|
||||||
rhs_result = mk_add_app(new_rhs_monomials.size() - rhs_offset, new_rhs_monomials.c_ptr() + rhs_offset);
|
rhs_result = mk_add_app(new_rhs_monomials.size() - rhs_offset, new_rhs_monomials.data() + rhs_offset);
|
||||||
TRACE("le_bug", tout << lhs_result << " " << rhs_result << "\n";);
|
TRACE("le_bug", tout << lhs_result << " " << rhs_result << "\n";);
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
|
@ -938,7 +938,7 @@ bool poly_rewriter<Config>::hoist_multiplication(expr_ref& som) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
som = mk_add_app(adds.size(), adds.c_ptr());
|
som = mk_add_app(adds.size(), adds.data());
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -968,13 +968,13 @@ expr* poly_rewriter<Config>::merge_muls(expr* x, expr* y) {
|
||||||
SASSERT(k > 0);
|
SASSERT(k > 0);
|
||||||
SASSERT(m1.size() >= k);
|
SASSERT(m1.size() >= k);
|
||||||
SASSERT(m2.size() >= k);
|
SASSERT(m2.size() >= k);
|
||||||
expr* args[2] = { mk_mul_app(m1.size()-k, m1.c_ptr()+k),
|
expr* args[2] = { mk_mul_app(m1.size()-k, m1.data()+k),
|
||||||
mk_mul_app(m2.size()-k, m2.c_ptr()+k) };
|
mk_mul_app(m2.size()-k, m2.data()+k) };
|
||||||
if (k == m1.size()) {
|
if (k == m1.size()) {
|
||||||
m1.push_back(0);
|
m1.push_back(0);
|
||||||
}
|
}
|
||||||
m1[k] = mk_add_app(2, args);
|
m1[k] = mk_add_app(2, args);
|
||||||
return mk_mul_app(k+1, m1.c_ptr());
|
return mk_mul_app(k+1, m1.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Config>
|
template<typename Config>
|
||||||
|
@ -999,7 +999,7 @@ bool poly_rewriter<Config>::hoist_ite(expr_ref& e) {
|
||||||
bs.push_back(apply_hoist(a, g, shared));
|
bs.push_back(apply_hoist(a, g, shared));
|
||||||
if (is_nontrivial_gcd(g)) {
|
if (is_nontrivial_gcd(g)) {
|
||||||
bs.push_back(mk_numeral(g));
|
bs.push_back(mk_numeral(g));
|
||||||
bs[0] = mk_mul_app(2, bs.c_ptr());
|
bs[0] = mk_mul_app(2, bs.data());
|
||||||
bs.pop_back();
|
bs.pop_back();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1007,7 +1007,7 @@ bool poly_rewriter<Config>::hoist_ite(expr_ref& e) {
|
||||||
bs.push_back(s);
|
bs.push_back(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expr* a2 = mk_add_app(bs.size(), bs.c_ptr());
|
expr* a2 = mk_add_app(bs.size(), bs.data());
|
||||||
if (a != a2) {
|
if (a != a2) {
|
||||||
adds[i] = a2;
|
adds[i] = a2;
|
||||||
pinned.push_back(a2);
|
pinned.push_back(a2);
|
||||||
|
@ -1017,7 +1017,7 @@ bool poly_rewriter<Config>::hoist_ite(expr_ref& e) {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (!pinned.empty()) {
|
if (!pinned.empty()) {
|
||||||
e = mk_add_app(adds.size(), adds.c_ptr());
|
e = mk_add_app(adds.size(), adds.data());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1080,7 +1080,7 @@ expr* poly_rewriter<Config>::apply_hoist(expr* a, numeral const& g, obj_hashtabl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adds.shrink(i);
|
adds.shrink(i);
|
||||||
return mk_add_app(adds.size(), adds.c_ptr());
|
return mk_add_app(adds.size(), adds.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1139,6 +1139,6 @@ bool poly_rewriter<Config>::is_var_plus_ground(expr * n, bool & inv, var * & v,
|
||||||
if (v == nullptr)
|
if (v == nullptr)
|
||||||
return false; // did not find variable
|
return false; // did not find variable
|
||||||
SASSERT(!args.empty());
|
SASSERT(!args.empty());
|
||||||
mk_add(args.size(), args.c_ptr(), t);
|
mk_add(args.size(), args.data(), t);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ public:
|
||||||
: m.mk_const (sym, s);
|
: m.mk_const (sym, s);
|
||||||
vars.push_back(a);
|
vars.push_back(a);
|
||||||
}
|
}
|
||||||
expr * const * exprs = (expr* const*) (vars.c_ptr() + vars.size()- nd);
|
expr * const * exprs = (expr* const*) (vars.data() + vars.size()- nd);
|
||||||
result = instantiate(m, q, exprs);
|
result = instantiate(m, q, exprs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,10 +215,10 @@ private:
|
||||||
args.push_back(tmp);
|
args.push_back(tmp);
|
||||||
}
|
}
|
||||||
if (rewrite_ok) {
|
if (rewrite_ok) {
|
||||||
m_rewriter.mk_and(args.size(), args.c_ptr(), result);
|
m_rewriter.mk_and(args.size(), args.data(), result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = m.mk_and (args.size (), args.c_ptr ());
|
result = m.mk_and (args.size (), args.data ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m.is_or(fml)) {
|
else if (m.is_or(fml)) {
|
||||||
|
@ -228,10 +228,10 @@ private:
|
||||||
args.push_back(tmp);
|
args.push_back(tmp);
|
||||||
}
|
}
|
||||||
if (rewrite_ok) {
|
if (rewrite_ok) {
|
||||||
m_rewriter.mk_or(args.size(), args.c_ptr(), result);
|
m_rewriter.mk_or(args.size(), args.data(), result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = m.mk_or (args.size (), args.c_ptr ());
|
result = m.mk_or (args.size (), args.data ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m.is_not(fml)) {
|
else if (m.is_not(fml)) {
|
||||||
|
|
|
@ -275,7 +275,7 @@ void var_shifter_core::process_app(app * t, frame & fr) {
|
||||||
SASSERT(fr.m_spos + num_args == m_result_stack.size());
|
SASSERT(fr.m_spos + num_args == m_result_stack.size());
|
||||||
expr * new_t;
|
expr * new_t;
|
||||||
if (fr.m_new_child) {
|
if (fr.m_new_child) {
|
||||||
expr * const * new_args = m_result_stack.c_ptr() + fr.m_spos;
|
expr * const * new_args = m_result_stack.data() + fr.m_spos;
|
||||||
new_t = m().mk_app(t->get_decl(), num_args, new_args);
|
new_t = m().mk_app(t->get_decl(), num_args, new_args);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -305,7 +305,7 @@ void var_shifter_core::process_quantifier(quantifier * q, frame & fr) {
|
||||||
SASSERT(fr.m_spos + num_children == m_result_stack.size());
|
SASSERT(fr.m_spos + num_children == m_result_stack.size());
|
||||||
expr * new_q;
|
expr * new_q;
|
||||||
if (fr.m_new_child) {
|
if (fr.m_new_child) {
|
||||||
expr * const * it = m_result_stack.c_ptr() + fr.m_spos;
|
expr * const * it = m_result_stack.data() + fr.m_spos;
|
||||||
expr * new_expr = *it;
|
expr * new_expr = *it;
|
||||||
++it;
|
++it;
|
||||||
expr * const * new_pats = it;
|
expr * const * new_pats = it;
|
||||||
|
|
|
@ -284,7 +284,7 @@ void rewriter_tpl<Config>::process_app(app * t, frame & fr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned new_num_args = result_stack().size() - fr.m_spos;
|
unsigned new_num_args = result_stack().size() - fr.m_spos;
|
||||||
expr * const * new_args = result_stack().c_ptr() + fr.m_spos;
|
expr * const * new_args = result_stack().data() + fr.m_spos;
|
||||||
app_ref new_t(m());
|
app_ref new_t(m());
|
||||||
if (ProofGen) {
|
if (ProofGen) {
|
||||||
elim_reflex_prs(fr.m_spos);
|
elim_reflex_prs(fr.m_spos);
|
||||||
|
@ -295,7 +295,7 @@ void rewriter_tpl<Config>::process_app(app * t, frame & fr) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
new_t = m().mk_app(f, new_num_args, new_args);
|
new_t = m().mk_app(f, new_num_args, new_args);
|
||||||
m_pr = m().mk_congruence(t, new_t, num_prs, result_pr_stack().c_ptr() + fr.m_spos);
|
m_pr = m().mk_congruence(t, new_t, num_prs, result_pr_stack().data() + fr.m_spos);
|
||||||
SASSERT(rewrites_from(t, m_pr));
|
SASSERT(rewrites_from(t, m_pr));
|
||||||
SASSERT(rewrites_to(new_t, m_pr));
|
SASSERT(rewrites_to(new_t, m_pr));
|
||||||
}
|
}
|
||||||
|
@ -537,7 +537,7 @@ void rewriter_tpl<Config>::process_quantifier(quantifier * q, frame & fr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SASSERT(fr.m_spos + num_children == result_stack().size());
|
SASSERT(fr.m_spos + num_children == result_stack().size());
|
||||||
expr * const * it = result_stack().c_ptr() + fr.m_spos;
|
expr * const * it = result_stack().data() + fr.m_spos;
|
||||||
expr * new_body = *it;
|
expr * new_body = *it;
|
||||||
unsigned num_pats = q->get_num_patterns();
|
unsigned num_pats = q->get_num_patterns();
|
||||||
unsigned num_no_pats = q->get_num_no_patterns();
|
unsigned num_no_pats = q->get_num_no_patterns();
|
||||||
|
@ -561,7 +561,7 @@ void rewriter_tpl<Config>::process_quantifier(quantifier * q, frame & fr) {
|
||||||
num_no_pats = j;
|
num_no_pats = j;
|
||||||
}
|
}
|
||||||
if (ProofGen) {
|
if (ProofGen) {
|
||||||
quantifier_ref new_q(m().update_quantifier(q, num_pats, new_pats.c_ptr(), num_no_pats, new_no_pats.c_ptr(), new_body), m());
|
quantifier_ref new_q(m().update_quantifier(q, num_pats, new_pats.data(), num_no_pats, new_no_pats.data(), new_body), m());
|
||||||
m_pr = nullptr;
|
m_pr = nullptr;
|
||||||
if (q != new_q) {
|
if (q != new_q) {
|
||||||
m_pr = result_pr_stack().get(fr.m_spos);
|
m_pr = result_pr_stack().get(fr.m_spos);
|
||||||
|
@ -575,7 +575,7 @@ void rewriter_tpl<Config>::process_quantifier(quantifier * q, frame & fr) {
|
||||||
}
|
}
|
||||||
m_r = new_q;
|
m_r = new_q;
|
||||||
proof_ref pr2(m());
|
proof_ref pr2(m());
|
||||||
if (m_cfg.reduce_quantifier(new_q, new_body, new_pats.c_ptr(), new_no_pats.c_ptr(), m_r, pr2)) {
|
if (m_cfg.reduce_quantifier(new_q, new_body, new_pats.data(), new_no_pats.data(), m_r, pr2)) {
|
||||||
m_pr = m().mk_transitivity(m_pr, pr2);
|
m_pr = m().mk_transitivity(m_pr, pr2);
|
||||||
}
|
}
|
||||||
TRACE("reduce_quantifier_bug",if (m_pr) tout << mk_ismt2_pp(m_pr, m()) << "\n"; else tout << "m_pr is_null\n";);
|
TRACE("reduce_quantifier_bug",if (m_pr) tout << mk_ismt2_pp(m_pr, m()) << "\n"; else tout << "m_pr is_null\n";);
|
||||||
|
@ -584,9 +584,9 @@ void rewriter_tpl<Config>::process_quantifier(quantifier * q, frame & fr) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TRACE("reduce_quantifier_bug", tout << mk_ismt2_pp(q, m()) << " " << mk_ismt2_pp(new_body, m()) << "\n";);
|
TRACE("reduce_quantifier_bug", tout << mk_ismt2_pp(q, m()) << " " << mk_ismt2_pp(new_body, m()) << "\n";);
|
||||||
if (!m_cfg.reduce_quantifier(q, new_body, new_pats.c_ptr(), new_no_pats.c_ptr(), m_r, m_pr)) {
|
if (!m_cfg.reduce_quantifier(q, new_body, new_pats.data(), new_no_pats.data(), m_r, m_pr)) {
|
||||||
if (fr.m_new_child) {
|
if (fr.m_new_child) {
|
||||||
m_r = m().update_quantifier(q, num_pats, new_pats.c_ptr(), num_no_pats, new_no_pats.c_ptr(), new_body);
|
m_r = m().update_quantifier(q, num_pats, new_pats.data(), num_no_pats, new_no_pats.data(), new_body);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TRACE("rewriter_reuse", tout << "reusing:\n" << mk_ismt2_pp(q, m()) << "\n";);
|
TRACE("rewriter_reuse", tout << "reusing:\n" << mk_ismt2_pp(q, m()) << "\n";);
|
||||||
|
|
|
@ -109,7 +109,7 @@ namespace seq {
|
||||||
if (m_trail.size() != 4000)
|
if (m_trail.size() != 4000)
|
||||||
return;
|
return;
|
||||||
unsigned new_size = 2000;
|
unsigned new_size = 2000;
|
||||||
expr_ref_vector new_trail(m, new_size, m_trail.c_ptr() + new_size);
|
expr_ref_vector new_trail(m, new_size, m_trail.data() + new_size);
|
||||||
m_purified.reset();
|
m_purified.reset();
|
||||||
for (unsigned i = 0; i < new_size; i += 2)
|
for (unsigned i = 0; i < new_size; i += 2)
|
||||||
m_purified.insert(new_trail.get(i), new_trail.get(i + 1));
|
m_purified.insert(new_trail.get(i), new_trail.get(i + 1));
|
||||||
|
|
|
@ -304,7 +304,7 @@ namespace seq {
|
||||||
expr_ref eq_length(m.mk_eq(a.mk_int(lenX), seq.str.mk_length(X)), m);
|
expr_ref eq_length(m.mk_eq(a.mk_int(lenX), seq.str.mk_length(X)), m);
|
||||||
expr* val = ctx.expr2rep(eq_length);
|
expr* val = ctx.expr2rep(eq_length);
|
||||||
if (!m.is_false(val)) {
|
if (!m.is_false(val)) {
|
||||||
expr_ref Y(seq.str.mk_concat(lenX.get_unsigned(), units.c_ptr(), X->get_sort()), m);
|
expr_ref Y(seq.str.mk_concat(lenX.get_unsigned(), units.data(), X->get_sort()), m);
|
||||||
expr_ref eq = m_ax.sk().mk_eq(X, Y);
|
expr_ref eq = m_ax.sk().mk_eq(X, Y);
|
||||||
add_consequence(~eq_length, eq);
|
add_consequence(~eq_length, eq);
|
||||||
return true;
|
return true;
|
||||||
|
@ -369,12 +369,12 @@ namespace seq {
|
||||||
|
|
||||||
void eq_solver::set_prefix(expr_ref& x, expr_ref_vector const& xs, unsigned sz) const {
|
void eq_solver::set_prefix(expr_ref& x, expr_ref_vector const& xs, unsigned sz) const {
|
||||||
SASSERT(0 < xs.size() && sz <= xs.size());
|
SASSERT(0 < xs.size() && sz <= xs.size());
|
||||||
x = seq.str.mk_concat(sz, xs.c_ptr(), xs[0]->get_sort());
|
x = seq.str.mk_concat(sz, xs.data(), xs[0]->get_sort());
|
||||||
}
|
}
|
||||||
|
|
||||||
void eq_solver::set_suffix(expr_ref& x, expr_ref_vector const& xs, unsigned sz) const {
|
void eq_solver::set_suffix(expr_ref& x, expr_ref_vector const& xs, unsigned sz) const {
|
||||||
SASSERT(0 < xs.size() && sz <= xs.size());
|
SASSERT(0 < xs.size() && sz <= xs.size());
|
||||||
x = seq.str.mk_concat(sz, xs.c_ptr() + xs.size() - sz, xs[0]->get_sort());
|
x = seq.str.mk_concat(sz, xs.data() + xs.size() - sz, xs[0]->get_sort());
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned eq_solver::count_units_l2r(expr_ref_vector const& es, unsigned offset) const {
|
unsigned eq_solver::count_units_l2r(expr_ref_vector const& es, unsigned offset) const {
|
||||||
|
|
|
@ -102,7 +102,7 @@ namespace seq {
|
||||||
void set_extract(V& dst, expr_ref_vector const& xs, unsigned offset, unsigned sz) const {
|
void set_extract(V& dst, expr_ref_vector const& xs, unsigned offset, unsigned sz) const {
|
||||||
SASSERT(offset + sz <= xs.size());
|
SASSERT(offset + sz <= xs.size());
|
||||||
dst.reset();
|
dst.reset();
|
||||||
dst.append(sz, xs.c_ptr() + offset);
|
dst.append(sz, xs.data() + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_conflict();
|
void set_conflict();
|
||||||
|
|
|
@ -828,7 +828,7 @@ br_status seq_rewriter::mk_seq_length(expr* a, expr_ref& result) {
|
||||||
if (len != 0) {
|
if (len != 0) {
|
||||||
es.push_back(m_autil.mk_int(len));
|
es.push_back(m_autil.mk_int(len));
|
||||||
}
|
}
|
||||||
result = m_autil.mk_add(es.size(), es.c_ptr());
|
result = m_autil.mk_add(es.size(), es.data());
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
expr* x = nullptr, *y = nullptr, *z = nullptr;
|
expr* x = nullptr, *y = nullptr, *z = nullptr;
|
||||||
|
@ -993,7 +993,7 @@ bool seq_rewriter::extract_pop_suffix(expr_ref_vector const& as, expr* b, expr*
|
||||||
len_a1 += len_a2;
|
len_a1 += len_a2;
|
||||||
}
|
}
|
||||||
if (i < as.size()) {
|
if (i < as.size()) {
|
||||||
expr* a = str().mk_concat(i, as.c_ptr(), as[0]->get_sort());
|
expr* a = str().mk_concat(i, as.data(), as[0]->get_sort());
|
||||||
result = str().mk_substr(a, b, c);
|
result = str().mk_substr(a, b, c);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1021,7 +1021,7 @@ bool seq_rewriter::extract_push_offset(expr_ref_vector const& as, expr* b, expr*
|
||||||
}
|
}
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
expr_ref t1(m());
|
expr_ref t1(m());
|
||||||
t1 = str().mk_concat(as.size() - i, as.c_ptr() + i, as[0]->get_sort());
|
t1 = str().mk_concat(as.size() - i, as.data() + i, as[0]->get_sort());
|
||||||
expr_ref t2 = mk_len(pos1, lens);
|
expr_ref t2 = mk_len(pos1, lens);
|
||||||
result = str().mk_substr(t1, t2, c);
|
result = str().mk_substr(t1, t2, c);
|
||||||
TRACE("seq", tout << result << "\n";);
|
TRACE("seq", tout << result << "\n";);
|
||||||
|
@ -1051,16 +1051,16 @@ bool seq_rewriter::extract_push_length(expr_ref_vector& as, expr* b, expr* c, ex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == as.size()) {
|
if (i == as.size()) {
|
||||||
result = str().mk_concat(as.size(), as.c_ptr(), as[0]->get_sort());
|
result = str().mk_concat(as.size(), as.data(), as[0]->get_sort());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (i != 0) {
|
else if (i != 0) {
|
||||||
expr_ref t1(m()), t2(m());
|
expr_ref t1(m()), t2(m());
|
||||||
t1 = str().mk_concat(as.size() - i, as.c_ptr() + i, as[0]->get_sort());
|
t1 = str().mk_concat(as.size() - i, as.data() + i, as[0]->get_sort());
|
||||||
t2 = mk_len(pos, lens);
|
t2 = mk_len(pos, lens);
|
||||||
result = str().mk_substr(t1, b, t2);
|
result = str().mk_substr(t1, b, t2);
|
||||||
as[i] = result;
|
as[i] = result;
|
||||||
result = str().mk_concat(i + 1, as.c_ptr(), as[0]->get_sort());
|
result = str().mk_concat(i + 1, as.data(), as[0]->get_sort());
|
||||||
TRACE("seq", tout << result << "\n";);
|
TRACE("seq", tout << result << "\n";);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1191,7 @@ br_status seq_rewriter::mk_seq_extract(expr* a, expr* b, expr* c, expr_ref& resu
|
||||||
result = str().mk_empty(a->get_sort());
|
result = str().mk_empty(a->get_sort());
|
||||||
for (unsigned i = 1; i <= as.size(); ++i) {
|
for (unsigned i = 1; i <= as.size(); ++i) {
|
||||||
result = m().mk_ite(m_autil.mk_ge(c, m_autil.mk_int(i)),
|
result = m().mk_ite(m_autil.mk_ge(c, m_autil.mk_int(i)),
|
||||||
str().mk_concat(i, as.c_ptr(), a->get_sort()),
|
str().mk_concat(i, as.data(), a->get_sort()),
|
||||||
result);
|
result);
|
||||||
}
|
}
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
|
@ -1212,11 +1212,11 @@ br_status seq_rewriter::mk_seq_extract(expr* a, expr* b, expr* c, expr_ref& resu
|
||||||
unsigned i = offset;
|
unsigned i = offset;
|
||||||
for (; i < as.size() && str().is_unit(as.get(i)) && i - offset < _len; ++i);
|
for (; i < as.size() && str().is_unit(as.get(i)) && i - offset < _len; ++i);
|
||||||
if (i - offset == _len) {
|
if (i - offset == _len) {
|
||||||
result = str().mk_concat(_len, as.c_ptr() + offset, a->get_sort());
|
result = str().mk_concat(_len, as.data() + offset, a->get_sort());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
if (i == as.size()) {
|
if (i == as.size()) {
|
||||||
result = str().mk_concat(as.size() - offset, as.c_ptr() + offset, as[0]->get_sort());
|
result = str().mk_concat(as.size() - offset, as.data() + offset, as[0]->get_sort());
|
||||||
return BR_DONE;
|
return BR_DONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1225,7 +1225,7 @@ br_status seq_rewriter::mk_seq_extract(expr* a, expr* b, expr* c, expr_ref& resu
|
||||||
}
|
}
|
||||||
expr_ref position(m());
|
expr_ref position(m());
|
||||||
position = m_autil.mk_sub(b, m_autil.mk_int(offset));
|
position = m_autil.mk_sub(b, m_autil.mk_int(offset));
|
||||||
result = str().mk_concat(as.size() - offset, as.c_ptr() + offset, as[0]->get_sort());
|
result = str().mk_concat(as.size() - offset, as.data() + offset, as[0]->get_sort());
|
||||||
result = str().mk_substr(result, position, c);
|
result = str().mk_substr(result, position, c);
|
||||||
return BR_REWRITE3;
|
return BR_REWRITE3;
|
||||||
}
|
}
|
||||||
|
@ -1361,7 +1361,7 @@ br_status seq_rewriter::mk_seq_contains(expr* a, expr* b, expr_ref& result) {
|
||||||
}
|
}
|
||||||
if (offs > 0 || sz < as.size()) {
|
if (offs > 0 || sz < as.size()) {
|
||||||
SASSERT(sz > offs);
|
SASSERT(sz > offs);
|
||||||
result = str().mk_contains(str().mk_concat(sz-offs, as.c_ptr()+offs, a->get_sort()), b);
|
result = str().mk_contains(str().mk_concat(sz-offs, as.data()+offs, a->get_sort()), b);
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1496,7 +1496,7 @@ br_status seq_rewriter::mk_seq_at(expr* a, expr* b, expr_ref& result) {
|
||||||
for (expr* rhs : lens) {
|
for (expr* rhs : lens) {
|
||||||
pos = m_autil.mk_add(pos, str().mk_length(rhs));
|
pos = m_autil.mk_add(pos, str().mk_length(rhs));
|
||||||
}
|
}
|
||||||
result = str().mk_concat(m_lhs.size() - i , m_lhs.c_ptr() + i, sort_a);
|
result = str().mk_concat(m_lhs.size() - i , m_lhs.data() + i, sort_a);
|
||||||
result = str().mk_at(result, pos);
|
result = str().mk_at(result, pos);
|
||||||
return BR_REWRITE2;
|
return BR_REWRITE2;
|
||||||
}
|
}
|
||||||
|
@ -1658,7 +1658,7 @@ br_status seq_rewriter::mk_seq_index(expr* a, expr* b, expr* c, expr_ref& result
|
||||||
}
|
}
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
expr_ref a1(m());
|
expr_ref a1(m());
|
||||||
a1 = str().mk_concat(as.size() - i, as.c_ptr() + i, sort_a);
|
a1 = str().mk_concat(as.size() - i, as.data() + i, sort_a);
|
||||||
result = str().mk_index(a1, b, m_autil.mk_int(r));
|
result = str().mk_index(a1, b, m_autil.mk_int(r));
|
||||||
result = m().mk_ite(m_autil.mk_ge(result, zero()), m_autil.mk_add(m_autil.mk_int(i), result), minus_one());
|
result = m().mk_ite(m_autil.mk_ge(result, zero()), m_autil.mk_add(m_autil.mk_int(i), result), minus_one());
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
|
@ -1676,7 +1676,7 @@ br_status seq_rewriter::mk_seq_index(expr* a, expr* b, expr* c, expr_ref& result
|
||||||
}
|
}
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
result = str().mk_index(
|
result = str().mk_index(
|
||||||
str().mk_concat(as.size() - i, as.c_ptr() + i, sort_a), b, c);
|
str().mk_concat(as.size() - i, as.data() + i, sort_a), b, c);
|
||||||
result = m().mk_ite(m_autil.mk_ge(result, zero()), m_autil.mk_add(m_autil.mk_int(i), result), minus_one());
|
result = m().mk_ite(m_autil.mk_ge(result, zero()), m_autil.mk_add(m_autil.mk_int(i), result), minus_one());
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
|
@ -1698,7 +1698,7 @@ br_status seq_rewriter::mk_seq_index(expr* a, expr* b, expr* c, expr_ref& result
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (is_zero && !as.empty() && str().is_unit(as.get(0))) {
|
if (is_zero && !as.empty() && str().is_unit(as.get(0))) {
|
||||||
expr_ref a1(str().mk_concat(as.size() - 1, as.c_ptr() + 1, as[0]->get_sort()), m());
|
expr_ref a1(str().mk_concat(as.size() - 1, as.data() + 1, as[0]->get_sort()), m());
|
||||||
expr_ref b1(str().mk_index(a1, b, c), m());
|
expr_ref b1(str().mk_index(a1, b, c), m());
|
||||||
result = m().mk_ite(str().mk_prefix(b, a), zero(),
|
result = m().mk_ite(str().mk_prefix(b, a), zero(),
|
||||||
m().mk_ite(m_autil.mk_ge(b1, zero()), m_autil.mk_add(one(), b1), minus_one()));
|
m().mk_ite(m_autil.mk_ge(b1, zero()), m_autil.mk_add(one(), b1), minus_one()));
|
||||||
|
@ -1797,7 +1797,7 @@ br_status seq_rewriter::mk_seq_replace(expr* a, expr* b, expr* c, expr_ref& resu
|
||||||
// a := b + rest
|
// a := b + rest
|
||||||
if (m_lhs.get(0) == b) {
|
if (m_lhs.get(0) == b) {
|
||||||
m_lhs[0] = c;
|
m_lhs[0] = c;
|
||||||
result = str().mk_concat(m_lhs.size(), m_lhs.c_ptr(), sort_a);
|
result = str().mk_concat(m_lhs.size(), m_lhs.data(), sort_a);
|
||||||
return BR_REWRITE1;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1805,7 +1805,7 @@ br_status seq_rewriter::mk_seq_replace(expr* a, expr* b, expr* c, expr_ref& resu
|
||||||
if (str().is_string(b, s2) && str().is_string(c, s3) &&
|
if (str().is_string(b, s2) && str().is_string(c, s3) &&
|
||||||
str().is_string(m_lhs.get(0), s1) && s1.contains(s2) ) {
|
str().is_string(m_lhs.get(0), s1) && s1.contains(s2) ) {
|
||||||
m_lhs[0] = str().mk_string(s1.replace(s2, s3));
|
m_lhs[0] = str().mk_string(s1.replace(s2, s3));
|
||||||
result = str().mk_concat(m_lhs.size(), m_lhs.c_ptr(), sort_a);
|
result = str().mk_concat(m_lhs.size(), m_lhs.data(), sort_a);
|
||||||
return BR_REWRITE1;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
m_lhs.reset();
|
m_lhs.reset();
|
||||||
|
@ -1839,16 +1839,16 @@ br_status seq_rewriter::mk_seq_replace(expr* a, expr* b, expr* c, expr_ref& resu
|
||||||
if (cmp == l_false && str().is_unit(m_lhs.get(i)))
|
if (cmp == l_false && str().is_unit(m_lhs.get(i)))
|
||||||
continue;
|
continue;
|
||||||
if (cmp == l_true && m_lhs.size() < i + m_rhs.size()) {
|
if (cmp == l_true && m_lhs.size() < i + m_rhs.size()) {
|
||||||
expr_ref a1(str().mk_concat(i, m_lhs.c_ptr(), sort_a), m());
|
expr_ref a1(str().mk_concat(i, m_lhs.data(), sort_a), m());
|
||||||
expr_ref a2(str().mk_concat(m_lhs.size()-i, m_lhs.c_ptr()+i, sort_a), m());
|
expr_ref a2(str().mk_concat(m_lhs.size()-i, m_lhs.data()+i, sort_a), m());
|
||||||
result = m().mk_ite(m().mk_eq(a2, b), str().mk_concat(a1, c), a);
|
result = m().mk_ite(m().mk_eq(a2, b), str().mk_concat(a1, c), a);
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
if (cmp == l_true) {
|
if (cmp == l_true) {
|
||||||
expr_ref_vector es(m());
|
expr_ref_vector es(m());
|
||||||
es.append(i, m_lhs.c_ptr());
|
es.append(i, m_lhs.data());
|
||||||
es.push_back(c);
|
es.push_back(c);
|
||||||
es.append(m_lhs.size()-i-m_rhs.size(), m_lhs.c_ptr()+i+m_rhs.size());
|
es.append(m_lhs.size()-i-m_rhs.size(), m_lhs.data()+i+m_rhs.size());
|
||||||
result = str().mk_concat(es, sort_a);
|
result = str().mk_concat(es, sort_a);
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
|
@ -1856,8 +1856,8 @@ br_status seq_rewriter::mk_seq_replace(expr* a, expr* b, expr* c, expr_ref& resu
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
expr_ref a1(str().mk_concat(i, m_lhs.c_ptr(), sort_a), m());
|
expr_ref a1(str().mk_concat(i, m_lhs.data(), sort_a), m());
|
||||||
expr_ref a2(str().mk_concat(m_lhs.size()-i, m_lhs.c_ptr()+i, sort_a), m());
|
expr_ref a2(str().mk_concat(m_lhs.size()-i, m_lhs.data()+i, sort_a), m());
|
||||||
result = str().mk_concat(a1, str().mk_replace(a2, b, c));
|
result = str().mk_concat(a1, str().mk_replace(a2, b, c));
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
|
@ -1941,8 +1941,8 @@ br_status seq_rewriter::mk_seq_prefix(expr* a, expr* b, expr_ref& result) {
|
||||||
SASSERT(as.size() > 1);
|
SASSERT(as.size() > 1);
|
||||||
s2 = s2.extract(s1.length(), s2.length()-s1.length());
|
s2 = s2.extract(s1.length(), s2.length()-s1.length());
|
||||||
bs[0] = str().mk_string(s2);
|
bs[0] = str().mk_string(s2);
|
||||||
result = str().mk_prefix(str().mk_concat(as.size()-1, as.c_ptr()+1, sort_a),
|
result = str().mk_prefix(str().mk_concat(as.size()-1, as.data()+1, sort_a),
|
||||||
str().mk_concat(bs.size(), bs.c_ptr(), sort_a));
|
str().mk_concat(bs.size(), bs.data(), sort_a));
|
||||||
TRACE("seq", tout << s1 << " " << s2 << " " << result << "\n";);
|
TRACE("seq", tout << s1 << " " << s2 << " " << result << "\n";);
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
|
@ -1964,8 +1964,8 @@ br_status seq_rewriter::mk_seq_prefix(expr* a, expr* b, expr_ref& result) {
|
||||||
SASSERT(bs.size() > 1);
|
SASSERT(bs.size() > 1);
|
||||||
s1 = s1.extract(s2.length(), s1.length() - s2.length());
|
s1 = s1.extract(s2.length(), s1.length() - s2.length());
|
||||||
as[0] = str().mk_string(s1);
|
as[0] = str().mk_string(s1);
|
||||||
result = str().mk_prefix(str().mk_concat(as.size(), as.c_ptr(), sort_a),
|
result = str().mk_prefix(str().mk_concat(as.size(), as.data(), sort_a),
|
||||||
str().mk_concat(bs.size()-1, bs.c_ptr()+1, sort_a));
|
str().mk_concat(bs.size()-1, bs.data()+1, sort_a));
|
||||||
TRACE("seq", tout << s1 << " " << s2 << " " << result << "\n";);
|
TRACE("seq", tout << s1 << " " << s2 << " " << result << "\n";);
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
|
@ -2011,8 +2011,8 @@ br_status seq_rewriter::mk_seq_prefix(expr* a, expr* b, expr_ref& result) {
|
||||||
}
|
}
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
SASSERT(i < as.size() && i < bs.size());
|
SASSERT(i < as.size() && i < bs.size());
|
||||||
a = str().mk_concat(as.size() - i, as.c_ptr() + i, sort_a);
|
a = str().mk_concat(as.size() - i, as.data() + i, sort_a);
|
||||||
b = str().mk_concat(bs.size() - i, bs.c_ptr() + i, sort_a);
|
b = str().mk_concat(bs.size() - i, bs.data() + i, sort_a);
|
||||||
eqs.push_back(str().mk_prefix(a, b));
|
eqs.push_back(str().mk_prefix(a, b));
|
||||||
result = mk_and(eqs);
|
result = mk_and(eqs);
|
||||||
TRACE("seq", tout << result << "\n";);
|
TRACE("seq", tout << result << "\n";);
|
||||||
|
@ -2091,8 +2091,8 @@ br_status seq_rewriter::mk_seq_suffix(expr* a, expr* b, expr_ref& result) {
|
||||||
|
|
||||||
if (i > 1) {
|
if (i > 1) {
|
||||||
SASSERT(i <= sza && i <= szb);
|
SASSERT(i <= sza && i <= szb);
|
||||||
a = str().mk_concat(sza - i + 1, as.c_ptr(), sort_a);
|
a = str().mk_concat(sza - i + 1, as.data(), sort_a);
|
||||||
b = str().mk_concat(szb - i + 1, bs.c_ptr(), sort_a);
|
b = str().mk_concat(szb - i + 1, bs.data(), sort_a);
|
||||||
eqs.push_back(str().mk_suffix(a, b));
|
eqs.push_back(str().mk_suffix(a, b));
|
||||||
result = mk_and(eqs);
|
result = mk_and(eqs);
|
||||||
TRACE("seq", tout << result << "\n";);
|
TRACE("seq", tout << result << "\n";);
|
||||||
|
@ -2294,7 +2294,7 @@ br_status seq_rewriter::mk_str_stoi(expr* a, expr_ref& result) {
|
||||||
// if tail < 0 then tail else
|
// if tail < 0 then tail else
|
||||||
// if stoi(head) >= 0 and then stoi(head)*10+tail else -1
|
// if stoi(head) >= 0 and then stoi(head)*10+tail else -1
|
||||||
expr_ref tail(str().mk_stoi(as.back()), m());
|
expr_ref tail(str().mk_stoi(as.back()), m());
|
||||||
expr_ref head(str().mk_concat(as.size() - 1, as.c_ptr(), a->get_sort()), m());
|
expr_ref head(str().mk_concat(as.size() - 1, as.data(), a->get_sort()), m());
|
||||||
expr_ref stoi_head(str().mk_stoi(head), m());
|
expr_ref stoi_head(str().mk_stoi(head), m());
|
||||||
result = m().mk_ite(m_autil.mk_ge(stoi_head, m_autil.mk_int(0)),
|
result = m().mk_ite(m_autil.mk_ge(stoi_head, m_autil.mk_int(0)),
|
||||||
m_autil.mk_add(m_autil.mk_mul(m_autil.mk_int(10), stoi_head), tail),
|
m_autil.mk_add(m_autil.mk_mul(m_autil.mk_int(10), stoi_head), tail),
|
||||||
|
@ -2309,7 +2309,7 @@ br_status seq_rewriter::mk_str_stoi(expr* a, expr_ref& result) {
|
||||||
return BR_REWRITE_FULL;
|
return BR_REWRITE_FULL;
|
||||||
}
|
}
|
||||||
if (str().is_unit(as.get(0), u) && m_util.is_const_char(u, ch) && '0' == ch) {
|
if (str().is_unit(as.get(0), u) && m_util.is_const_char(u, ch) && '0' == ch) {
|
||||||
result = str().mk_concat(as.size() - 1, as.c_ptr() + 1, as[0]->get_sort());
|
result = str().mk_concat(as.size() - 1, as.data() + 1, as[0]->get_sort());
|
||||||
result = m().mk_ite(str().mk_is_empty(result),
|
result = m().mk_ite(str().mk_is_empty(result),
|
||||||
m_autil.mk_int(0),
|
m_autil.mk_int(0),
|
||||||
str().mk_stoi(result));
|
str().mk_stoi(result));
|
||||||
|
@ -4686,20 +4686,20 @@ bool seq_rewriter::reduce_contains(expr* a, expr* b, expr_ref_vector& disj) {
|
||||||
for (unsigned j = 0; j < sz; ++j) {
|
for (unsigned j = 0; j < sz; ++j) {
|
||||||
es.push_back(str().mk_unit(str().mk_char(s, j)));
|
es.push_back(str().mk_unit(str().mk_char(s, j)));
|
||||||
}
|
}
|
||||||
es.append(m_lhs.size() - i, m_lhs.c_ptr() + i);
|
es.append(m_lhs.size() - i, m_lhs.data() + i);
|
||||||
for (unsigned j = 0; j < sz; ++j) {
|
for (unsigned j = 0; j < sz; ++j) {
|
||||||
disj.push_back(str().mk_prefix(b, str().mk_concat(es.size() - j, es.c_ptr() + j, sort_a)));
|
disj.push_back(str().mk_prefix(b, str().mk_concat(es.size() - j, es.data() + j, sort_a)));
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (str().is_unit(e)) {
|
if (str().is_unit(e)) {
|
||||||
disj.push_back(str().mk_prefix(b, str().mk_concat(m_lhs.size() - i, m_lhs.c_ptr() + i, sort_a)));
|
disj.push_back(str().mk_prefix(b, str().mk_concat(m_lhs.size() - i, m_lhs.data() + i, sort_a)));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str().is_string(b, s)) {
|
if (str().is_string(b, s)) {
|
||||||
expr* all = re().mk_full_seq(re().mk_re(b->get_sort()));
|
expr* all = re().mk_full_seq(re().mk_re(b->get_sort()));
|
||||||
disj.push_back(re().mk_in_re(str().mk_concat(m_lhs.size() - i, m_lhs.c_ptr() + i, sort_a),
|
disj.push_back(re().mk_in_re(str().mk_concat(m_lhs.size() - i, m_lhs.data() + i, sort_a),
|
||||||
re().mk_concat(all, re().mk_concat(re().mk_to_re(b), all))));
|
re().mk_concat(all, re().mk_concat(re().mk_to_re(b), all))));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -4707,7 +4707,7 @@ bool seq_rewriter::reduce_contains(expr* a, expr* b, expr_ref_vector& disj) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
disj.push_back(str().mk_contains(str().mk_concat(m_lhs.size() - i, m_lhs.c_ptr() + i, sort_a), b));
|
disj.push_back(str().mk_contains(str().mk_concat(m_lhs.size() - i, m_lhs.data() + i, sort_a), b));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
disj.push_back(str().mk_is_empty(b));
|
disj.push_back(str().mk_is_empty(b));
|
||||||
|
@ -4882,7 +4882,7 @@ bool seq_rewriter::reduce_itos(expr_ref_vector& ls, expr_ref_vector& rs,
|
||||||
zstring s;
|
zstring s;
|
||||||
if (ls.size() == 1 &&
|
if (ls.size() == 1 &&
|
||||||
str().is_itos(ls.get(0), n) &&
|
str().is_itos(ls.get(0), n) &&
|
||||||
is_string(rs.size(), rs.c_ptr(), s)) {
|
is_string(rs.size(), rs.data(), s)) {
|
||||||
std::string s1 = s.encode();
|
std::string s1 = s.encode();
|
||||||
rational r(s1.c_str());
|
rational r(s1.c_str());
|
||||||
if (s1 == r.to_string()) {
|
if (s1 == r.to_string()) {
|
||||||
|
@ -4938,14 +4938,14 @@ bool seq_rewriter::reduce_by_length(expr_ref_vector& ls, expr_ref_vector& rs,
|
||||||
if (bounded2 && len2 < len1)
|
if (bounded2 && len2 < len1)
|
||||||
return false;
|
return false;
|
||||||
if (bounded1 && len1 == len2 && len1 > 0) {
|
if (bounded1 && len1 == len2 && len1 > 0) {
|
||||||
if (!set_empty(rs.size(), rs.c_ptr(), false, eqs))
|
if (!set_empty(rs.size(), rs.data(), false, eqs))
|
||||||
return false;
|
return false;
|
||||||
eqs.push_back(concat_non_empty(ls), concat_non_empty(rs));
|
eqs.push_back(concat_non_empty(ls), concat_non_empty(rs));
|
||||||
ls.reset();
|
ls.reset();
|
||||||
rs.reset();
|
rs.reset();
|
||||||
}
|
}
|
||||||
else if (bounded2 && len1 == len2 && len1 > 0) {
|
else if (bounded2 && len1 == len2 && len1 > 0) {
|
||||||
if (!set_empty(ls.size(), ls.c_ptr(), false, eqs))
|
if (!set_empty(ls.size(), ls.data(), false, eqs))
|
||||||
return false;
|
return false;
|
||||||
eqs.push_back(concat_non_empty(ls), concat_non_empty(rs));
|
eqs.push_back(concat_non_empty(ls), concat_non_empty(rs));
|
||||||
ls.reset();
|
ls.reset();
|
||||||
|
|
|
@ -165,7 +165,7 @@ class seq_rewriter {
|
||||||
|
|
||||||
|
|
||||||
length_comparison compare_lengths(expr_ref_vector const& as, expr_ref_vector const& bs) {
|
length_comparison compare_lengths(expr_ref_vector const& as, expr_ref_vector const& bs) {
|
||||||
return compare_lengths(as.size(), as.c_ptr(), bs.size(), bs.c_ptr());
|
return compare_lengths(as.size(), as.data(), bs.size(), bs.data());
|
||||||
}
|
}
|
||||||
length_comparison compare_lengths(unsigned sza, expr* const* as, unsigned szb, expr* const* bs);
|
length_comparison compare_lengths(unsigned sza, expr* const* as, unsigned szb, expr* const* bs);
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ public:
|
||||||
br_status mk_le_core(expr* lhs, expr* rhs, expr_ref& result);
|
br_status mk_le_core(expr* lhs, expr* rhs, expr_ref& result);
|
||||||
br_status mk_bool_app(func_decl* f, unsigned n, expr* const* args, expr_ref& result);
|
br_status mk_bool_app(func_decl* f, unsigned n, expr* const* args, expr_ref& result);
|
||||||
|
|
||||||
expr_ref mk_app(func_decl* f, expr_ref_vector const& args) { return mk_app(f, args.size(), args.c_ptr()); }
|
expr_ref mk_app(func_decl* f, expr_ref_vector const& args) { return mk_app(f, args.size(), args.data()); }
|
||||||
expr_ref mk_app(func_decl* f, unsigned n, expr* const* args) {
|
expr_ref mk_app(func_decl* f, unsigned n, expr* const* args) {
|
||||||
expr_ref result(m());
|
expr_ref result(m());
|
||||||
if (f->get_family_id() != u().get_family_id() ||
|
if (f->get_family_id() != u().get_family_id() ||
|
||||||
|
|
|
@ -198,6 +198,6 @@ expr_ref skolem::mk_step(expr* s, expr* idx, expr* re, unsigned i, unsigned j, e
|
||||||
args.push_back(a.mk_int(i));
|
args.push_back(a.mk_int(i));
|
||||||
args.push_back(a.mk_int(j));
|
args.push_back(a.mk_int(j));
|
||||||
args.push_back(t);
|
args.push_back(t);
|
||||||
return expr_ref(seq.mk_skolem(m_aut_step, args.size(), args.c_ptr(), m.mk_bool_sort()), m);
|
return expr_ref(seq.mk_skolem(m_aut_step, args.size(), args.data(), m.mk_bool_sort()), m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace seq {
|
||||||
}
|
}
|
||||||
return mk("seq.align.m", e1, e2, e3, e4);
|
return mk("seq.align.m", e1, e2, e3, e4);
|
||||||
}
|
}
|
||||||
expr_ref mk_accept(expr_ref_vector const& args) { return expr_ref(seq.mk_skolem(m_accept, args.size(), args.c_ptr(), m.mk_bool_sort()), m); }
|
expr_ref mk_accept(expr_ref_vector const& args) { return expr_ref(seq.mk_skolem(m_accept, args.size(), args.data(), m.mk_bool_sort()), m); }
|
||||||
expr_ref mk_accept(expr* s, expr* i, expr* r) { return mk(m_accept, s, i, r, nullptr, m.mk_bool_sort()); }
|
expr_ref mk_accept(expr* s, expr* i, expr* r) { return mk(m_accept, s, i, r, nullptr, m.mk_bool_sort()); }
|
||||||
expr_ref mk_is_non_empty(expr* r, expr* u, expr* n) { return mk(m_is_non_empty, r, u, n, m.mk_bool_sort(), false); }
|
expr_ref mk_is_non_empty(expr* r, expr* u, expr* n) { return mk(m_is_non_empty, r, u, n, m.mk_bool_sort(), false); }
|
||||||
expr_ref mk_is_empty(expr* r, expr* u, expr* n) { return mk(m_is_empty, r, u, n, m.mk_bool_sort(), false); }
|
expr_ref mk_is_empty(expr* r, expr* u, expr* n) { return mk(m_is_empty, r, u, n, m.mk_bool_sort(), false); }
|
||||||
|
|
|
@ -511,7 +511,7 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
|
||||||
if (args.size() == 1)
|
if (args.size() == 1)
|
||||||
c = args[0];
|
c = args[0];
|
||||||
else
|
else
|
||||||
c = m_a_util.mk_add(args.size(), args.c_ptr());
|
c = m_a_util.mk_add(args.size(), args.data());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -722,8 +722,8 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
|
||||||
|
|
||||||
q1 = m().mk_quantifier(old_q->get_kind(),
|
q1 = m().mk_quantifier(old_q->get_kind(),
|
||||||
sorts.size(),
|
sorts.size(),
|
||||||
sorts.c_ptr(),
|
sorts.data(),
|
||||||
names.c_ptr(),
|
names.data(),
|
||||||
nested_q->get_expr(),
|
nested_q->get_expr(),
|
||||||
std::min(old_q->get_weight(), nested_q->get_weight()),
|
std::min(old_q->get_weight(), nested_q->get_weight()),
|
||||||
old_q->get_qid(),
|
old_q->get_qid(),
|
||||||
|
@ -757,7 +757,7 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
|
||||||
apply_subst(new_patterns_buf);
|
apply_subst(new_patterns_buf);
|
||||||
|
|
||||||
q1 = m().update_quantifier(old_q,
|
q1 = m().update_quantifier(old_q,
|
||||||
new_patterns_buf.size(), new_patterns_buf.c_ptr(), new_no_patterns_buf.size(), new_no_patterns_buf.c_ptr(),
|
new_patterns_buf.size(), new_patterns_buf.data(), new_no_patterns_buf.size(), new_no_patterns_buf.data(),
|
||||||
new_body);
|
new_body);
|
||||||
m_pinned.reset();
|
m_pinned.reset();
|
||||||
TRACE("reduce_quantifier", tout << mk_ismt2_pp(old_q, m()) << "\n----->\n" << mk_ismt2_pp(q1, m()) << "\n";);
|
TRACE("reduce_quantifier", tout << mk_ismt2_pp(old_q, m()) << "\n----->\n" << mk_ismt2_pp(q1, m()) << "\n";);
|
||||||
|
|
|
@ -134,11 +134,11 @@ expr_ref unused_vars_eliminator::operator()(quantifier* q) {
|
||||||
// (VAR 0) should be in the last position of var_mapping.
|
// (VAR 0) should be in the last position of var_mapping.
|
||||||
// ...
|
// ...
|
||||||
// (VAR (var_mapping.size() - 1)) should be in the first position.
|
// (VAR (var_mapping.size() - 1)) should be in the first position.
|
||||||
std::reverse(var_mapping.c_ptr(), var_mapping.c_ptr() + var_mapping.size());
|
std::reverse(var_mapping.data(), var_mapping.data() + var_mapping.size());
|
||||||
|
|
||||||
expr_ref new_expr(m);
|
expr_ref new_expr(m);
|
||||||
|
|
||||||
new_expr = m_subst(q->get_expr(), var_mapping.size(), var_mapping.c_ptr());
|
new_expr = m_subst(q->get_expr(), var_mapping.size(), var_mapping.data());
|
||||||
|
|
||||||
if (num_removed == num_decls) {
|
if (num_removed == num_decls) {
|
||||||
result = new_expr;
|
result = new_expr;
|
||||||
|
@ -149,24 +149,24 @@ expr_ref unused_vars_eliminator::operator()(quantifier* q) {
|
||||||
expr_ref_buffer new_no_patterns(m);
|
expr_ref_buffer new_no_patterns(m);
|
||||||
|
|
||||||
for (unsigned i = 0; i < num_patterns; i++) {
|
for (unsigned i = 0; i < num_patterns; i++) {
|
||||||
new_patterns.push_back(m_subst(q->get_pattern(i), var_mapping.size(), var_mapping.c_ptr()));
|
new_patterns.push_back(m_subst(q->get_pattern(i), var_mapping.size(), var_mapping.data()));
|
||||||
}
|
}
|
||||||
for (unsigned i = 0; i < num_no_patterns; i++) {
|
for (unsigned i = 0; i < num_no_patterns; i++) {
|
||||||
new_no_patterns.push_back(m_subst(q->get_no_pattern(i), var_mapping.size(), var_mapping.c_ptr()));
|
new_no_patterns.push_back(m_subst(q->get_no_pattern(i), var_mapping.size(), var_mapping.data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
result = m.mk_quantifier(q->get_kind(),
|
result = m.mk_quantifier(q->get_kind(),
|
||||||
used_decl_sorts.size(),
|
used_decl_sorts.size(),
|
||||||
used_decl_sorts.c_ptr(),
|
used_decl_sorts.data(),
|
||||||
used_decl_names.c_ptr(),
|
used_decl_names.data(),
|
||||||
new_expr,
|
new_expr,
|
||||||
q->get_weight(),
|
q->get_weight(),
|
||||||
q->get_qid(),
|
q->get_qid(),
|
||||||
q->get_skid(),
|
q->get_skid(),
|
||||||
num_patterns,
|
num_patterns,
|
||||||
new_patterns.c_ptr(),
|
new_patterns.data(),
|
||||||
num_no_patterns,
|
num_no_patterns,
|
||||||
new_no_patterns.c_ptr());
|
new_no_patterns.data());
|
||||||
to_quantifier(result)->set_no_unused_vars();
|
to_quantifier(result)->set_no_unused_vars();
|
||||||
SASSERT(is_well_sorted(m, result));
|
SASSERT(is_well_sorted(m, result));
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -48,10 +48,10 @@ public:
|
||||||
Otherwise, (VAR 0) is stored in the first position, (VAR 1) in the second, and so on.
|
Otherwise, (VAR 0) is stored in the first position, (VAR 1) in the second, and so on.
|
||||||
*/
|
*/
|
||||||
expr_ref operator()(expr * n, unsigned num_args, expr * const * args);
|
expr_ref operator()(expr * n, unsigned num_args, expr * const * args);
|
||||||
inline expr_ref operator()(expr * n, expr_ref_vector const& args) { return (*this)(n, args.size(), args.c_ptr()); }
|
inline expr_ref operator()(expr * n, expr_ref_vector const& args) { return (*this)(n, args.size(), args.data()); }
|
||||||
inline expr_ref operator()(expr * n, var_ref_vector const& args) { return (*this)(n, args.size(), (expr*const*)args.c_ptr()); }
|
inline expr_ref operator()(expr * n, var_ref_vector const& args) { return (*this)(n, args.size(), (expr*const*)args.data()); }
|
||||||
inline expr_ref operator()(expr * n, app_ref_vector const& args) { return (*this)(n, args.size(), (expr*const*)args.c_ptr()); }
|
inline expr_ref operator()(expr * n, app_ref_vector const& args) { return (*this)(n, args.size(), (expr*const*)args.data()); }
|
||||||
inline expr_ref operator()(expr * n, ptr_vector<expr> const& args) { return (*this)(n, args.size(), args.c_ptr()); }
|
inline expr_ref operator()(expr * n, ptr_vector<expr> const& args) { return (*this)(n, args.size(), args.data()); }
|
||||||
void reset() { m_reducer.reset(); }
|
void reset() { m_reducer.reset(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public:
|
||||||
bool contains(unsigned idx) const { return idx < m_sorts.size() && m_sorts[idx] != 0; }
|
bool contains(unsigned idx) const { return idx < m_sorts.size() && m_sorts[idx] != 0; }
|
||||||
void set_default_sort(sort* s);
|
void set_default_sort(sort* s);
|
||||||
void reverse() { m_sorts.reverse(); }
|
void reverse() { m_sorts.reverse(); }
|
||||||
sort*const* c_ptr() const { return m_sorts.c_ptr(); }
|
sort*const* data() const { return m_sorts.data(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ public:
|
||||||
if (n == 0) return mk_empty(s);
|
if (n == 0) return mk_empty(s);
|
||||||
if (n == 1) return es[0];
|
if (n == 1) return es[0];
|
||||||
return m.mk_app(m_fid, OP_SEQ_CONCAT, n, es); }
|
return m.mk_app(m_fid, OP_SEQ_CONCAT, n, es); }
|
||||||
expr* mk_concat(expr_ref_vector const& es, sort* s) const { return mk_concat(es.size(), es.c_ptr(), s); }
|
expr* mk_concat(expr_ref_vector const& es, sort* s) const { return mk_concat(es.size(), es.data(), s); }
|
||||||
app* mk_length(expr* a) const { return m.mk_app(m_fid, OP_SEQ_LENGTH, 1, &a); }
|
app* mk_length(expr* a) const { return m.mk_app(m_fid, OP_SEQ_LENGTH, 1, &a); }
|
||||||
app* mk_at(expr* s, expr* i) const { expr* es[2] = { s, i }; return m.mk_app(m_fid, OP_SEQ_AT, 2, es); }
|
app* mk_at(expr* s, expr* i) const { expr* es[2] = { s, i }; return m.mk_app(m_fid, OP_SEQ_AT, 2, es); }
|
||||||
app* mk_nth(expr* s, expr* i) const { expr* es[2] = { s, i }; return m.mk_app(m_fid, OP_SEQ_NTH, 2, es); }
|
app* mk_nth(expr* s, expr* i) const { expr* es[2] = { s, i }; return m.mk_app(m_fid, OP_SEQ_NTH, 2, es); }
|
||||||
|
|
|
@ -159,7 +159,7 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
|
||||||
<< " --> " << mk_pp(e, m_manager) << "\n";);
|
<< " --> " << mk_pp(e, m_manager) << "\n";);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
expr * new_expr = m_manager.mk_app(to_app(e)->get_decl(), new_args.size(), new_args.c_ptr());
|
expr * new_expr = m_manager.mk_app(to_app(e)->get_decl(), new_args.size(), new_args.data());
|
||||||
m_new_exprs.push_back(new_expr);
|
m_new_exprs.push_back(new_expr);
|
||||||
m_apply_cache.insert(n, new_expr);
|
m_apply_cache.insert(n, new_expr);
|
||||||
TRACE("subst_bug", tout << "3. insert n: " << mk_pp(n.get_expr(), m_manager) << " : " << n.get_offset()
|
TRACE("subst_bug", tout << "3. insert n: " << mk_pp(n.get_expr(), m_manager) << " : " << n.get_offset()
|
||||||
|
@ -203,7 +203,7 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
|
||||||
no_pats.push_back(std::move(er));
|
no_pats.push_back(std::move(er));
|
||||||
}
|
}
|
||||||
subst.apply(num_actual_offsets, deltas, body, s1, t1, er);
|
subst.apply(num_actual_offsets, deltas, body, s1, t1, er);
|
||||||
er = m_manager.update_quantifier(q, pats.size(), pats.c_ptr(), no_pats.size(), no_pats.c_ptr(), er);
|
er = m_manager.update_quantifier(q, pats.size(), pats.data(), no_pats.size(), no_pats.data(), er);
|
||||||
m_todo.pop_back();
|
m_todo.pop_back();
|
||||||
m_apply_cache.insert(n, er);
|
m_apply_cache.insert(n, er);
|
||||||
m_new_exprs.push_back(std::move(er));
|
m_new_exprs.push_back(std::move(er));
|
||||||
|
|
|
@ -90,7 +90,7 @@ void substitution_tree::linearize(svector<subst> & result) {
|
||||||
sort * s = get_reg_value(oreg)->get_sort();
|
sort * s = get_reg_value(oreg)->get_sort();
|
||||||
new_args.push_back(m_manager.mk_var(oreg, s));
|
new_args.push_back(m_manager.mk_var(oreg, s));
|
||||||
}
|
}
|
||||||
new_app = m_manager.mk_app(to_app(n)->get_decl(), new_args.size(), new_args.c_ptr());
|
new_app = m_manager.mk_app(to_app(n)->get_decl(), new_args.size(), new_args.data());
|
||||||
new_args.reset();
|
new_args.reset();
|
||||||
}
|
}
|
||||||
push(result, subst(ireg, new_app));
|
push(result, subst(ireg, new_app));
|
||||||
|
|
|
@ -798,15 +798,15 @@ public:
|
||||||
unsigned arity = m_f->get_arity();
|
unsigned arity = m_f->get_arity();
|
||||||
for (unsigned i = 0; i < arity; i++) {
|
for (unsigned i = 0; i < arity; i++) {
|
||||||
array_sort_args.push_back(m_f->get_domain(i));
|
array_sort_args.push_back(m_f->get_domain(i));
|
||||||
domain.push_back(array_sort->instantiate(ctx.pm(), array_sort_args.size(), array_sort_args.c_ptr()));
|
domain.push_back(array_sort->instantiate(ctx.pm(), array_sort_args.size(), array_sort_args.data()));
|
||||||
array_sort_args.pop_back();
|
array_sort_args.pop_back();
|
||||||
}
|
}
|
||||||
sort_ref range(ctx.m());
|
sort_ref range(ctx.m());
|
||||||
array_sort_args.push_back(m_f->get_range());
|
array_sort_args.push_back(m_f->get_range());
|
||||||
range = array_sort->instantiate(ctx.pm(), array_sort_args.size(), array_sort_args.c_ptr());
|
range = array_sort->instantiate(ctx.pm(), array_sort_args.size(), array_sort_args.data());
|
||||||
parameter p[1] = { parameter(m_f) };
|
parameter p[1] = { parameter(m_f) };
|
||||||
func_decl_ref new_map(ctx.m());
|
func_decl_ref new_map(ctx.m());
|
||||||
new_map = ctx.m().mk_func_decl(get_array_fid(ctx), OP_ARRAY_MAP, 1, p, domain.size(), domain.c_ptr(), range.get());
|
new_map = ctx.m().mk_func_decl(get_array_fid(ctx), OP_ARRAY_MAP, 1, p, domain.size(), domain.data(), range.get());
|
||||||
if (new_map == 0)
|
if (new_map == 0)
|
||||||
throw cmd_exception("invalid array map operator");
|
throw cmd_exception("invalid array map operator");
|
||||||
ctx.insert(m_name, new_map);
|
ctx.insert(m_name, new_map);
|
||||||
|
@ -836,8 +836,8 @@ public:
|
||||||
void execute(cmd_context & ctx) override {
|
void execute(cmd_context & ctx) override {
|
||||||
ast_manager& m = ctx.m();
|
ast_manager& m = ctx.m();
|
||||||
expr_ref_vector assumptions(m), variables(m), consequences(m);
|
expr_ref_vector assumptions(m), variables(m), consequences(m);
|
||||||
assumptions.append(m_assumptions.size(), m_assumptions.c_ptr());
|
assumptions.append(m_assumptions.size(), m_assumptions.data());
|
||||||
variables.append(m_variables.size(), m_variables.c_ptr());
|
variables.append(m_variables.size(), m_variables.data());
|
||||||
ctx.get_consequences(assumptions, variables, consequences);
|
ctx.get_consequences(assumptions, variables, consequences);
|
||||||
ctx.regular_stream() << consequences << "\n";
|
ctx.regular_stream() << consequences << "\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,7 @@ func_decl * func_decls::find(ast_manager & m, unsigned num_args, expr * const *
|
||||||
return nullptr;
|
return nullptr;
|
||||||
sorts.push_back(args[i]->get_sort());
|
sorts.push_back(args[i]->get_sort());
|
||||||
}
|
}
|
||||||
return find(m, num_args, sorts.c_ptr(), range);
|
return find(m, num_args, sorts.data(), range);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned func_decls::get_num_entries() const {
|
unsigned func_decls::get_num_entries() const {
|
||||||
|
@ -982,7 +982,7 @@ void cmd_context::insert_rec_fun(func_decl* f, expr_ref_vector const& binding, s
|
||||||
|
|
||||||
recfun::promise_def d = p.get_promise_def(f);
|
recfun::promise_def d = p.get_promise_def(f);
|
||||||
recfun_replace replace(m());
|
recfun_replace replace(m());
|
||||||
p.set_definition(replace, d, vars.size(), vars.c_ptr(), rhs);
|
p.set_definition(replace, d, vars.size(), vars.data(), rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
func_decl * cmd_context::find_func_decl(symbol const & s) const {
|
func_decl * cmd_context::find_func_decl(symbol const & s) const {
|
||||||
|
@ -1060,7 +1060,7 @@ func_decl * cmd_context::find_func_decl(symbol const & s, unsigned num_indices,
|
||||||
buffer<parameter> ps;
|
buffer<parameter> ps;
|
||||||
for (unsigned i = 0; i < num_indices; i++)
|
for (unsigned i = 0; i < num_indices; i++)
|
||||||
ps.push_back(parameter(indices[i]));
|
ps.push_back(parameter(indices[i]));
|
||||||
f = m().mk_func_decl(fid, k, num_indices, ps.c_ptr(), arity, domain, range);
|
f = m().mk_func_decl(fid, k, num_indices, ps.data(), arity, domain, range);
|
||||||
}
|
}
|
||||||
if (f == nullptr)
|
if (f == nullptr)
|
||||||
throw cmd_exception("invalid function declaration reference, invalid builtin reference ", s);
|
throw cmd_exception("invalid function declaration reference, invalid builtin reference ", s);
|
||||||
|
@ -1873,7 +1873,7 @@ void cmd_context::complete_model(model_ref& md) const {
|
||||||
SASSERT(!v->has_var_params());
|
SASSERT(!v->has_var_params());
|
||||||
IF_VERBOSE(12, verbose_stream() << "(model.completion " << k << ")\n"; );
|
IF_VERBOSE(12, verbose_stream() << "(model.completion " << k << ")\n"; );
|
||||||
ptr_vector<sort> param_sorts(v->get_num_params(), m().mk_bool_sort());
|
ptr_vector<sort> param_sorts(v->get_num_params(), m().mk_bool_sort());
|
||||||
sort * srt = v->instantiate(*m_pmanager, param_sorts.size(), param_sorts.c_ptr());
|
sort * srt = v->instantiate(*m_pmanager, param_sorts.size(), param_sorts.data());
|
||||||
if (!md->has_uninterpreted_sort(srt)) {
|
if (!md->has_uninterpreted_sort(srt)) {
|
||||||
expr * singleton = m().get_some_value(srt);
|
expr * singleton = m().get_some_value(srt);
|
||||||
md->register_usort(srt, 1, &singleton);
|
md->register_usort(srt, 1, &singleton);
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
}
|
}
|
||||||
void execute(cmd_context & ctx) override {
|
void execute(cmd_context & ctx) override {
|
||||||
beta_reducer p(ctx.m());
|
beta_reducer p(ctx.m());
|
||||||
expr_ref r = p(m_source, m_subst.size(), m_subst.c_ptr());
|
expr_ref r = p(m_source, m_subst.size(), m_subst.data());
|
||||||
store_expr_ref(ctx, m_target, r.get());
|
store_expr_ref(ctx, m_target, r.get());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -304,7 +304,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void execute(cmd_context & ctx) override {
|
void execute(cmd_context & ctx) override {
|
||||||
expr_ref r = instantiate(ctx.m(), m_q, m_args.c_ptr());
|
expr_ref r = instantiate(ctx.m(), m_q, m_args.data());
|
||||||
ctx.display(ctx.regular_stream(), r);
|
ctx.display(ctx.regular_stream(), r);
|
||||||
ctx.regular_stream() << std::endl;
|
ctx.regular_stream() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@ class psort_app : public psort {
|
||||||
|
|
||||||
void finalize(pdecl_manager & m) override {
|
void finalize(pdecl_manager & m) override {
|
||||||
m.lazy_dec_ref(m_decl);
|
m.lazy_dec_ref(m_decl);
|
||||||
m.lazy_dec_ref(m_args.size(), m_args.c_ptr());
|
m.lazy_dec_ref(m_args.size(), m_args.data());
|
||||||
psort::finalize(m);
|
psort::finalize(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ class psort_app : public psort {
|
||||||
sort * a = m_args[i]->instantiate(m, n, s);
|
sort * a = m_args[i]->instantiate(m, n, s);
|
||||||
args_i.push_back(a);
|
args_i.push_back(a);
|
||||||
}
|
}
|
||||||
r = m_decl->instantiate(m, args_i.size(), args_i.c_ptr());
|
r = m_decl->instantiate(m, args_i.size(), args_i.data());
|
||||||
cache(m, s, r);
|
cache(m, s, r);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ sort * psort_user_decl::instantiate(pdecl_manager & m, unsigned n, sort * const
|
||||||
buffer<parameter> ps;
|
buffer<parameter> ps;
|
||||||
for (unsigned i = 0; i < n; i++)
|
for (unsigned i = 0; i < n; i++)
|
||||||
ps.push_back(parameter(s[i]));
|
ps.push_back(parameter(s[i]));
|
||||||
r = m.m().mk_uninterpreted_sort(m_name, ps.size(), ps.c_ptr());
|
r = m.m().mk_uninterpreted_sort(m_name, ps.size(), ps.data());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
r = m_def->instantiate(m, n, s);
|
r = m_def->instantiate(m, n, s);
|
||||||
|
@ -388,7 +388,7 @@ sort * psort_builtin_decl::instantiate(pdecl_manager & m, unsigned n, sort * con
|
||||||
buffer<parameter> params;
|
buffer<parameter> params;
|
||||||
for (unsigned i = 0; i < n; i++)
|
for (unsigned i = 0; i < n; i++)
|
||||||
params.push_back(parameter(s[i]));
|
params.push_back(parameter(s[i]));
|
||||||
sort * r = m.m().mk_sort(m_fid, m_kind, n, params.c_ptr());
|
sort * r = m.m().mk_sort(m_fid, m_kind, n, params.data());
|
||||||
m.save_info(r, this, n, s);
|
m.save_info(r, this, n, s);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -404,7 +404,7 @@ sort * psort_builtin_decl::instantiate(pdecl_manager & m, unsigned n, unsigned c
|
||||||
buffer<parameter> params;
|
buffer<parameter> params;
|
||||||
for (unsigned i = 0; i < n; i++)
|
for (unsigned i = 0; i < n; i++)
|
||||||
params.push_back(parameter(s[i]));
|
params.push_back(parameter(s[i]));
|
||||||
sort * r = m.m().mk_sort(m_fid, m_kind, n, params.c_ptr());
|
sort * r = m.m().mk_sort(m_fid, m_kind, n, params.data());
|
||||||
m.save_info(r, this, n, s);
|
m.save_info(r, this, n, s);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -488,7 +488,7 @@ pconstructor_decl::pconstructor_decl(unsigned id, unsigned num_params, pdecl_man
|
||||||
}
|
}
|
||||||
|
|
||||||
void pconstructor_decl::finalize(pdecl_manager & m) {
|
void pconstructor_decl::finalize(pdecl_manager & m) {
|
||||||
m.lazy_dec_ref(m_accessors.size(), m_accessors.c_ptr());
|
m.lazy_dec_ref(m_accessors.size(), m_accessors.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pconstructor_decl::has_missing_refs(symbol & missing) const {
|
bool pconstructor_decl::has_missing_refs(symbol & missing) const {
|
||||||
|
@ -511,7 +511,7 @@ constructor_decl * pconstructor_decl::instantiate_decl(pdecl_manager & m, unsign
|
||||||
ptr_buffer<accessor_decl> as;
|
ptr_buffer<accessor_decl> as;
|
||||||
for (paccessor_decl* a : m_accessors)
|
for (paccessor_decl* a : m_accessors)
|
||||||
as.push_back(a->instantiate_decl(m, n, s));
|
as.push_back(a->instantiate_decl(m, n, s));
|
||||||
return mk_constructor_decl(m_name, m_recogniser_name, as.size(), as.c_ptr());
|
return mk_constructor_decl(m_name, m_recogniser_name, as.size(), as.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void pconstructor_decl::display(std::ostream & out, pdatatype_decl const * const * dts) const {
|
void pconstructor_decl::display(std::ostream & out, pdatatype_decl const * const * dts) const {
|
||||||
|
@ -532,7 +532,7 @@ pdatatype_decl::pdatatype_decl(unsigned id, unsigned num_params, pdecl_manager &
|
||||||
}
|
}
|
||||||
|
|
||||||
void pdatatype_decl::finalize(pdecl_manager & m) {
|
void pdatatype_decl::finalize(pdecl_manager & m) {
|
||||||
m.lazy_dec_ref(m_constructors.size(), m_constructors.c_ptr());
|
m.lazy_dec_ref(m_constructors.size(), m_constructors.data());
|
||||||
psort_decl::finalize(m);
|
psort_decl::finalize(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -573,12 +573,12 @@ datatype_decl * pdatatype_decl::instantiate_decl(pdecl_manager & m, unsigned n,
|
||||||
cs.push_back(c->instantiate_decl(m, n, s));
|
cs.push_back(c->instantiate_decl(m, n, s));
|
||||||
}
|
}
|
||||||
datatype_util util(m.m());
|
datatype_util util(m.m());
|
||||||
return mk_datatype_decl(util, m_name, m_num_params, s, cs.size(), cs.c_ptr());
|
return mk_datatype_decl(util, m_name, m_num_params, s, cs.size(), cs.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
struct datatype_decl_buffer {
|
struct datatype_decl_buffer {
|
||||||
ptr_buffer<datatype_decl> m_buffer;
|
ptr_buffer<datatype_decl> m_buffer;
|
||||||
~datatype_decl_buffer() { del_datatype_decls(m_buffer.size(), m_buffer.c_ptr()); }
|
~datatype_decl_buffer() { del_datatype_decls(m_buffer.size(), m_buffer.data()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -603,7 +603,7 @@ sort * pdatatype_decl::instantiate(pdecl_manager & m, unsigned n, sort * const *
|
||||||
for (unsigned j = 0; j < util.get_datatype_num_parameter_sorts(rng); ++j) {
|
for (unsigned j = 0; j < util.get_datatype_num_parameter_sorts(rng); ++j) {
|
||||||
ps.push_back(util.get_datatype_parameter_sort(acc->get_range(), j));
|
ps.push_back(util.get_datatype_parameter_sort(acc->get_range(), j));
|
||||||
}
|
}
|
||||||
m.instantiate_datatype(p, p->get_name(), ps.size(), ps.c_ptr());
|
m.instantiate_datatype(p, p->get_name(), ps.size(), ps.data());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -641,10 +641,10 @@ bool pdatatype_decl::commit(pdecl_manager& m) {
|
||||||
ps.push_back(m.m().mk_uninterpreted_sort(symbol(i), 0, nullptr));
|
ps.push_back(m.m().mk_uninterpreted_sort(symbol(i), 0, nullptr));
|
||||||
}
|
}
|
||||||
datatype_decl_buffer dts;
|
datatype_decl_buffer dts;
|
||||||
dts.m_buffer.push_back(instantiate_decl(m, ps.size(), ps.c_ptr()));
|
dts.m_buffer.push_back(instantiate_decl(m, ps.size(), ps.data()));
|
||||||
datatype_decl * d_ptr = dts.m_buffer[0];
|
datatype_decl * d_ptr = dts.m_buffer[0];
|
||||||
sort_ref_vector sorts(m.m());
|
sort_ref_vector sorts(m.m());
|
||||||
bool is_ok = m.get_dt_plugin()->mk_datatypes(1, &d_ptr, m_num_params, ps.c_ptr(), sorts);
|
bool is_ok = m.get_dt_plugin()->mk_datatypes(1, &d_ptr, m_num_params, ps.data(), sorts);
|
||||||
if (is_ok && m_num_params == 0) {
|
if (is_ok && m_num_params == 0) {
|
||||||
m.notify_new_dt(sorts.get(0), this);
|
m.notify_new_dt(sorts.get(0), this);
|
||||||
}
|
}
|
||||||
|
@ -665,7 +665,7 @@ pdatatypes_decl::pdatatypes_decl(unsigned id, unsigned num_params, pdecl_manager
|
||||||
}
|
}
|
||||||
|
|
||||||
void pdatatypes_decl::finalize(pdecl_manager & m) {
|
void pdatatypes_decl::finalize(pdecl_manager & m) {
|
||||||
m.lazy_dec_ref(m_datatypes.size(), m_datatypes.c_ptr());
|
m.lazy_dec_ref(m_datatypes.size(), m_datatypes.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pdatatypes_decl::fix_missing_refs(symbol & missing) {
|
bool pdatatypes_decl::fix_missing_refs(symbol & missing) {
|
||||||
|
@ -694,7 +694,7 @@ sort* pdecl_manager::instantiate_datatype(psort_decl* p, symbol const& name, uns
|
||||||
for (unsigned i = 0; i < n; i++)
|
for (unsigned i = 0; i < n; i++)
|
||||||
ps.push_back(parameter(s[i]));
|
ps.push_back(parameter(s[i]));
|
||||||
datatype_util util(m.m());
|
datatype_util util(m.m());
|
||||||
r = m.m().mk_sort(util.get_family_id(), DATATYPE_SORT, ps.size(), ps.c_ptr());
|
r = m.m().mk_sort(util.get_family_id(), DATATYPE_SORT, ps.size(), ps.data());
|
||||||
p->cache(m, s, r);
|
p->cache(m, s, r);
|
||||||
m.save_info(r, p, n, s);
|
m.save_info(r, p, n, s);
|
||||||
notify_datatype(r, p, n, s);
|
notify_datatype(r, p, n, s);
|
||||||
|
@ -746,10 +746,10 @@ bool pdatatypes_decl::commit(pdecl_manager& m) {
|
||||||
for (unsigned i = 0; i < d->get_num_params(); ++i) {
|
for (unsigned i = 0; i < d->get_num_params(); ++i) {
|
||||||
ps.push_back(m.m().mk_uninterpreted_sort(symbol(i), 0, nullptr));
|
ps.push_back(m.m().mk_uninterpreted_sort(symbol(i), 0, nullptr));
|
||||||
}
|
}
|
||||||
dts.m_buffer.push_back(d->instantiate_decl(m, ps.size(), ps.c_ptr()));
|
dts.m_buffer.push_back(d->instantiate_decl(m, ps.size(), ps.data()));
|
||||||
}
|
}
|
||||||
sort_ref_vector sorts(m.m());
|
sort_ref_vector sorts(m.m());
|
||||||
bool is_ok = m.get_dt_plugin()->mk_datatypes(m_datatypes.size(), dts.m_buffer.c_ptr(), 0, nullptr, sorts);
|
bool is_ok = m.get_dt_plugin()->mk_datatypes(m_datatypes.size(), dts.m_buffer.data(), 0, nullptr, sorts);
|
||||||
if (is_ok) {
|
if (is_ok) {
|
||||||
for (unsigned i = 0; i < m_datatypes.size(); ++i) {
|
for (unsigned i = 0; i < m_datatypes.size(); ++i) {
|
||||||
pdatatype_decl* d = m_datatypes[i];
|
pdatatype_decl* d = m_datatypes[i];
|
||||||
|
@ -790,7 +790,7 @@ struct pdecl_manager::app_sort_info : public pdecl_manager::sort_info {
|
||||||
|
|
||||||
void finalize(pdecl_manager & m) override {
|
void finalize(pdecl_manager & m) override {
|
||||||
sort_info::finalize(m);
|
sort_info::finalize(m);
|
||||||
m.m().dec_array_ref(m_args.size(), m_args.c_ptr());
|
m.m().dec_array_ref(m_args.size(), m_args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(std::ostream & out, pdecl_manager const & m) const override {
|
void display(std::ostream & out, pdecl_manager const & m) const override {
|
||||||
|
|
|
@ -257,7 +257,7 @@ class pdatatypes_decl : public pdecl {
|
||||||
bool instantiate(pdecl_manager & m, sort * const * s);
|
bool instantiate(pdecl_manager & m, sort * const * s);
|
||||||
~pdatatypes_decl() override {}
|
~pdatatypes_decl() override {}
|
||||||
public:
|
public:
|
||||||
pdatatype_decl const * const * children() const { return m_datatypes.c_ptr(); }
|
pdatatype_decl const * const * children() const { return m_datatypes.data(); }
|
||||||
pdatatype_decl * const * begin() const { return m_datatypes.begin(); }
|
pdatatype_decl * const * begin() const { return m_datatypes.begin(); }
|
||||||
pdatatype_decl * const * end() const { return m_datatypes.end(); }
|
pdatatype_decl * const * end() const { return m_datatypes.end(); }
|
||||||
// commit declaration
|
// commit declaration
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue