Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/z3prover/z3
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Jan 4, 2023
2 parents 6f95c77 + e448191 commit 8d0d6d8
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 22 deletions.
7 changes: 5 additions & 2 deletions src/ast/rewriter/array_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,17 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
}
return true;
};
expr *array = to_app(args[0])->get_arg(0);
bool is_leaf = m_util.is_const(array);
bool should_expand =
m_blast_select_store ||
is_leaf ||
are_values() ||
(m_expand_select_store && to_app(args[0])->get_arg(0)->get_ref_count() == 1);
(m_expand_select_store && array->get_ref_count() == 1);
if (should_expand) {
// select(store(a, I, v), J) --> ite(I=J, v, select(a, J))
ptr_buffer<expr> new_args;
new_args.push_back(to_app(args[0])->get_arg(0));
new_args.push_back(array);
new_args.append(num_args-1, args+1);
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);
Expand Down
2 changes: 1 addition & 1 deletion src/ast/rewriter/bit_blaster/bit_blaster_tpl_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Revision History:

template<typename Cfg>
void bit_blaster_tpl<Cfg>::checkpoint() {
if (memory::get_allocation_size() > m_max_memory)
if (memory::get_allocation_size() > m_max_memory || memory::above_high_watermark())
throw rewriter_exception(Z3_MAX_MEMORY_MSG);
if (!m().inc())
throw rewriter_exception(m().limit().get_cancel_msg());
Expand Down
4 changes: 2 additions & 2 deletions src/math/lp/mps_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ class mps_reader {
} else {
fail:
set_m_ok_to_false();
*m_message_stream << "cannot understand this line" << std::endl;
*m_message_stream << "line = " << m_line << ", line number is " << m_line_number << std::endl;
*m_message_stream << "cannot understand this line\n"
"line = " << m_line << ", line number is " << m_line_number << std::endl;
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/params/bit_blaster_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ struct bit_blaster_params {
#endif

void display(std::ostream & out) const {
out << "m_bb_ext_gates=" << m_bb_ext_gates << std::endl;
out << "m_bb_quantifiers=" << m_bb_quantifiers << std::endl;
out << "m_bb_ext_gates=" << m_bb_ext_gates << '\n';
out << "m_bb_quantifiers=" << m_bb_quantifiers << '\n';
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/params/pattern_inference_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void pattern_inference_params::updt_params(params_ref const & _p) {
m_pi_warnings = p.warnings();
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void pattern_inference_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_pi_max_multi_patterns);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/dyn_ack_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void dyn_ack_params::updt_params(params_ref const & _p) {
m_dack_gc_inv_decay = p.dack_gc_inv_decay();
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void dyn_ack_params::display(std::ostream & out) const {
DISPLAY_PARAM((unsigned)m_dack);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/preprocessor_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void preprocessor_params::updt_params(params_ref const & p) {
updt_local_params(p);
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void preprocessor_params::display(std::ostream & out) const {
pattern_inference_params::display(out);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/qi_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void qi_params::updt_params(params_ref const & _p) {
m_qi_quick_checker = static_cast<quick_checker_mode>(p.qi_quick_checker());
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void qi_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_qi_cost);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/smt_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void smt_params::updt_params(context_params const & p) {
m_model = p.m_model;
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void smt_params::display(std::ostream & out) const {
preprocessor_params::display(out);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/theory_arith_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void theory_arith_params::updt_params(params_ref const & _p) {
}


#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void theory_arith_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_arith_eq2ineq);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/theory_array_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void theory_array_params::updt_params(params_ref const & _p) {
m_array_extensional = p.array_extensional();
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void theory_array_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_array_mode);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/theory_bv_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void theory_bv_params::updt_params(params_ref const & _p) {
m_bv_size_reduce = p.bv_size_reduce();
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void theory_bv_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_bv_mode);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/theory_datatype_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct theory_datatype_params {
m_dt_lazy_splits = p.dt_lazy_splits();
}

void display(std::ostream & out) const { out << "m_dt_lazy_splits=" << m_dt_lazy_splits << std::endl; }
void display(std::ostream & out) const { out << "m_dt_lazy_splits=" << m_dt_lazy_splits << '\n'; }
};


Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/theory_pb_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void theory_pb_params::updt_params(params_ref const & _p) {
m_pb_learn_complements = p.pb_learn_complements();
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void theory_pb_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_pb_conflict_frequency);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/params/theory_str_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void theory_str_params::updt_params(params_ref const & _p) {
m_FixedLengthNaiveCounterexamples = p.str_fixed_length_naive_cex();
}

#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
#define DISPLAY_PARAM(X) out << #X"=" << X << '\n';

void theory_str_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_StrongArrangements);
Expand Down
6 changes: 3 additions & 3 deletions src/tactic/core/collect_statistics_tactic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ class collect_statistics_tactic : public tactic {
for (unsigned i = 0; i < sz; i++)
for_each_expr(cp, visited, g->form(i));

std::cout << "(" << std::endl;
std::cout << "(\n";
for (auto const& kv : m_stats)
std::cout << " :" << kv.first << " " << kv.second << std::endl;
std::cout << ")" << std::endl;
std::cout << " :" << kv.first << " " << kv.second << '\n';
std::cout << ")\n";

g->inc_depth();
result.push_back(g.get());
Expand Down
2 changes: 1 addition & 1 deletion src/tactic/smtlogics/smt_tactic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Module Name:

tactic * mk_smt_tactic(ast_manager & m, params_ref const & p) {
sat_params sp(p);
if (sp.smt())
if (sp.smt())
return mk_solver2tactic(mk_smt2_solver(m, p));
if (sp.euf())
return mk_sat_tactic(m, p);
Expand Down

0 comments on commit 8d0d6d8

Please sign in to comment.