3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-01-22 10:04:45 +00:00

Standardize for-loop increments to prefix form (++i) (#8199)

* Initial plan

* Convert postfix to prefix increment in for loops

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Fix member variable increment conversion bug

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Update API generator to produce prefix increments

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2026-01-14 19:55:31 -08:00 committed by GitHub
parent 1bf463d77a
commit 2436943794
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
475 changed files with 3237 additions and 3237 deletions

View file

@ -981,9 +981,9 @@ def mk_log_result_macro(file, name, result, params):
cap = param_array_capacity_pos(p)
sz = param_array_size_pos(p)
if cap == sz:
file.write("for (unsigned i = 0; i < Z3ARG%s; i++) { SetAO(Z3ARG%s[i], %s, i); } " % (sz, i, i))
file.write("for (unsigned i = 0; i < Z3ARG%s; ++i) { SetAO(Z3ARG%s[i], %s, i); } " % (sz, i, i))
else:
file.write("for (unsigned i = 0; Z3ARG%s && i < *Z3ARG%s; i++) { SetAO(Z3ARG%s[i], %s, i); } " % (sz, sz, i, i))
file.write("for (unsigned i = 0; Z3ARG%s && i < *Z3ARG%s; ++i) { SetAO(Z3ARG%s[i], %s, i); } " % (sz, sz, i, i))
if kind == OUT or kind == INOUT:
file.write("SetO((Z3ARG%s == 0 ? 0 : *Z3ARG%s), %s); " % (i, i, i))
i = i + 1
@ -1099,7 +1099,7 @@ def def_API(name, result, params):
error("unsupported parameter for %s, %s" % (name, p))
elif kind == IN_ARRAY or kind == INOUT_ARRAY:
sz = param_array_capacity_pos(p)
log_c.write(" for (unsigned i = 0; i < a%s; i++) { " % sz)
log_c.write(" for (unsigned i = 0; i < a%s; ++i) { " % sz)
if is_obj(ty):
log_c.write("P(a%s[i]);" % i)
log_c.write(" }\n")
@ -1136,7 +1136,7 @@ def def_API(name, result, params):
sz_e = ("(*a%s)" % sz)
else:
sz_e = ("a%s" % sz)
log_c.write(" for (unsigned i = 0; i < %s; i++) { " % sz_e)
log_c.write(" for (unsigned i = 0; i < %s; ++i) { " % sz_e)
if is_obj(ty):
log_c.write("P(0);")
log_c.write(" }\n")
@ -1158,7 +1158,7 @@ def def_API(name, result, params):
sz_e = ("(*a%s)" % sz)
else:
sz_e = ("a%s" % sz)
log_c.write(" for (unsigned i = 0; i < %s; i++) { " % sz_e)
log_c.write(" for (unsigned i = 0; i < %s; ++i) { " % sz_e)
log_c.write("P(0);")
log_c.write(" }\n")
log_c.write(" Ap(%s);\n" % sz_e)
@ -1629,7 +1629,7 @@ def mk_z3native_stubs_c(ml_src_dir, ml_output_dir): # C interface
t = param_type(param)
ts = type2str(t)
ml_wrapper.write(' _iter = a' + str(i) + ';\n')
ml_wrapper.write(' for (_i = 0; _i < _a%s; _i++) {\n' % param_array_capacity_pos(param))
ml_wrapper.write(' for (_i = 0; _i < _a%s; ++_i) {\n' % param_array_capacity_pos(param))
ml_wrapper.write(' assert(_iter != Val_emptylist);\n')
ml_wrapper.write(' _a%s[_i] = %s;\n' % (i, ml_unwrap(t, ts, 'Field(_iter, 0)')))
ml_wrapper.write(' _iter = Field(_iter, 1);\n')

View file

@ -39,7 +39,7 @@ public:
ptr_vector<expr> flas;
const unsigned sz = g->size();
for (unsigned i = 0; i < sz; i++) flas.push_back(g->form(i));
for (unsigned i = 0; i < sz; ++i) flas.push_back(g->form(i));
lackr lackr(m, m_p, m_st, flas, nullptr);
// mk result

View file

@ -64,7 +64,7 @@ public:
proc p(g.m());
unsigned sz = g.size();
expr_fast_mark1 visited;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
for_each_expr_core<proc, expr_fast_mark1, true, true>(p, visited, g.form(i));
}
p.prune_non_select();

View file

@ -103,7 +103,7 @@ void ackr_model_converter::convert_constants(model * source, model * destination
evaluator.set_model_completion(true);
array_util autil(m);
for (unsigned i = 0; i < source->get_num_constants(); i++) {
for (unsigned i = 0; i < source->get_num_constants(); ++i) {
func_decl * const c = source->get_constant(i);
app * const term = info->find_term(c);
expr * value = source->get_const_interp(c);

View file

@ -47,7 +47,7 @@ public:
//
bool check() {
bool retv = true;
for (unsigned i = 0; i < m_abstr_model->get_num_constants(); i++) {
for (unsigned i = 0; i < m_abstr_model->get_num_constants(); ++i) {
func_decl * const c = m_abstr_model->get_constant(i);
app * const _term = m_info->find_term(c);
expr * const term = _term ? _term : m.mk_const(c);
@ -58,13 +58,13 @@ public:
void make_model(model_ref& destination) {
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);
ptr_vector<expr> u = m_abstr_model->get_universe(s);
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) {
func_decl * const fd = m_abstr_model->get_function(i);
func_interp * const fi = m_abstr_model->get_func_interp(fd);
destination->register_decl(fd, fi);

View file

@ -325,7 +325,7 @@ extern "C" {
static bool to_anum_vector(Z3_context c, unsigned n, Z3_ast a[], scoped_anum_vector & as) {
algebraic_numbers::manager & _am = am(c);
scoped_anum tmp(_am);
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
if (is_rational(c, a[i])) {
_am.set(tmp, get_rational(c, a[i]).to_mpq());
as.push_back(tmp);
@ -378,7 +378,7 @@ extern "C" {
}
Z3_ast_vector_ref* result = alloc(Z3_ast_vector_ref, *mk_c(c), mk_c(c)->m());
mk_c(c)->save_object(result);
for (unsigned i = 0; i < roots.size(); i++) {
for (unsigned i = 0; i < roots.size(); ++i) {
result->m_ast_vector.push_back(au(c).mk_numeral(_am, roots.get(i), false));
}
RETURN_Z3(of_ast_vector(result));

View file

@ -901,7 +901,7 @@ extern "C" {
expr * const * from = to_exprs(num_exprs, _from);
expr * const * to = to_exprs(num_exprs, _to);
expr * r = nullptr;
for (unsigned i = 0; i < num_exprs; i++) {
for (unsigned i = 0; i < num_exprs; ++i) {
if (from[i]->get_sort() != to[i]->get_sort()) {
SET_ERROR_CODE(Z3_SORT_ERROR, nullptr);
RETURN_Z3(of_expr(nullptr));
@ -910,7 +910,7 @@ extern "C" {
SASSERT(to[i]->get_ref_count() > 0);
}
expr_safe_replace subst(m);
for (unsigned i = 0; i < num_exprs; i++) {
for (unsigned i = 0; i < num_exprs; ++i) {
subst.insert(from[i], to[i]);
}
expr_ref new_a(m);
@ -940,7 +940,7 @@ extern "C" {
obj_map<func_decl, expr*> rep;
obj_map<expr, expr*> cache;
for (unsigned i = 0; i < num_funs; i++) {
for (unsigned i = 0; i < num_funs; ++i) {
if (from[i]->get_range() != to[i]->get_sort()) {
SET_ERROR_CODE(Z3_SORT_ERROR, nullptr);
RETURN_Z3(of_expr(nullptr));

View file

@ -112,7 +112,7 @@ extern "C" {
Z3_ast_vector_ref * new_v = alloc(Z3_ast_vector_ref, *mk_c(t), mk_c(t)->m());
mk_c(t)->save_object(new_v);
unsigned sz = to_ast_vector_ref(v).size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
ast * new_ast = translator(to_ast_vector_ref(v).get(i));
new_v->m_ast_vector.push_back(new_ast);
}
@ -127,7 +127,7 @@ extern "C" {
std::ostringstream buffer;
buffer << "(ast-vector";
unsigned sz = to_ast_vector_ref(v).size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
buffer << "\n " << mk_ismt2_pp(to_ast_vector_ref(v).get(i), mk_c(c)->m(), 2);
}
buffer << ")";

View file

@ -77,7 +77,7 @@ extern "C" {
// Create projections
ptr_vector<func_decl> const & _accs = *dt_util.get_constructor_accessors(decl);
SASSERT(_accs.size() == num_fields);
for (unsigned i = 0; i < _accs.size(); i++) {
for (unsigned i = 0; i < _accs.size(); ++i) {
mk_c(c)->save_multiple_ast_trail(_accs[i]);
proj_decls[i] = of_func_decl(_accs[i]);
}

View file

@ -141,7 +141,7 @@ extern "C" {
Z3_TRY;
LOG_Z3_optimize_check(c, o, num_assumptions, assumptions);
RESET_ERROR_CODE();
for (unsigned i = 0; i < num_assumptions; i++) {
for (unsigned i = 0; i < num_assumptions; ++i) {
if (!is_expr(to_ast(assumptions[i]))) {
SET_ERROR_CODE(Z3_INVALID_ARG, "assumption is not an expression");
return Z3_L_UNDEF;
@ -432,7 +432,7 @@ extern "C" {
unsigned n = to_optimize_ptr(o)->num_objectives();
Z3_ast_vector_ref * v = alloc(Z3_ast_vector_ref, *mk_c(c), mk_c(c)->m());
mk_c(c)->save_object(v);
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
v->m_ast_vector.push_back(to_optimize_ptr(o)->get_objective(i));
}
RETURN_Z3(of_ast_vector(v));

View file

@ -202,7 +202,7 @@ extern "C" {
std::ostringstream buffer;
buffer << "(";
unsigned sz = to_param_descrs_ptr(p)->size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (i > 0)
buffer << ", ";
buffer << to_param_descrs_ptr(p)->get_param_name(i);

View file

@ -56,7 +56,7 @@ extern "C" {
scoped_timer timer(mk_c(c)->params().m_timeout, &eh);
pm.psc_chain(_p, _q, v_x, rs);
}
for (unsigned i = 0; i < rs.size(); i++) {
for (unsigned i = 0; i < rs.size(); ++i) {
r = rs.get(i);
converter.to_expr(r, true, _r);
result->m_ast_vector.push_back(_r);

View file

@ -73,7 +73,7 @@ extern "C" {
expr * const* no_ps = reinterpret_cast<expr * const*>(no_patterns);
symbol qid = to_symbol(quantifier_id);
pattern_validator v(mk_c(c)->m());
for (unsigned i = 0; i < num_patterns; i++) {
for (unsigned i = 0; i < num_patterns; ++i) {
if (!v(num_decls, ps[i], 0, 0)) {
SET_ERROR_CODE(Z3_INVALID_PATTERN, nullptr);
return nullptr;

View file

@ -115,7 +115,7 @@ extern "C" {
reset_rcf_cancel(c);
rcnumeral_vector av;
unsigned rz = 0;
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
if (!rcfm(c).is_zero(to_rcnumeral(a[i])))
rz = i + 1;
av.push_back(to_rcnumeral(a[i]));
@ -129,7 +129,7 @@ extern "C" {
rcnumeral_vector rs;
rcfm(c).isolate_roots(av.size(), av.data(), rs);
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]);
}
RETURN_Z3_rcf_mk_roots num_roots;

View file

@ -558,7 +558,7 @@ extern "C" {
Z3_ast_vector_ref * v = alloc(Z3_ast_vector_ref, *mk_c(c), mk_c(c)->m());
mk_c(c)->save_object(v);
unsigned sz = to_solver_ref(s)->get_num_assertions();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
v->m_ast_vector.push_back(to_solver_ref(s)->get_assertion(i));
}
RETURN_Z3(of_ast_vector(v));
@ -638,7 +638,7 @@ extern "C" {
#define TOSTRING(x) STRINGIFY(x)
static Z3_lbool _solver_check(Z3_context c, Z3_solver s, unsigned num_assumptions, Z3_ast const assumptions[]) {
for (unsigned i = 0; i < num_assumptions; i++) {
for (unsigned i = 0; i < num_assumptions; ++i) {
if (!is_expr(to_ast(assumptions[i]))) {
SET_ERROR_CODE(Z3_INVALID_ARG, "assumption is not an expression");
return Z3_L_UNDEF;

View file

@ -140,7 +140,7 @@ extern "C" {
LOG_Z3_tactic_par_or(c, num, ts);
RESET_ERROR_CODE();
ptr_buffer<tactic> _ts;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
_ts.push_back(to_tactic_ref(ts[i]));
}
tactic * new_t = par(num, _ts.data());
@ -496,7 +496,7 @@ extern "C" {
std::ostringstream buffer;
buffer << "(goals\n";
unsigned sz = to_apply_result(r)->m_subgoals.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
to_apply_result(r)->m_subgoals[i]->display(buffer);
}
buffer << ')';

View file

@ -1263,7 +1263,7 @@ namespace z3 {
expr_vector args() const {
expr_vector vec(ctx());
unsigned argCnt = num_args();
for (unsigned i = 0; i < argCnt; i++)
for (unsigned i = 0; i < argCnt; ++i)
vec.push_back(arg(i));
return vec;
}
@ -2394,7 +2394,7 @@ namespace z3 {
template<typename T>
template<typename T2>
array<T>::array(ast_vector_tpl<T2> const & v):m_array(new T[v.size()]), m_size(v.size()) {
for (unsigned i = 0; i < m_size; i++) {
for (unsigned i = 0; i < m_size; ++i) {
m_array[i] = v[i];
}
}
@ -2925,7 +2925,7 @@ namespace z3 {
check_result check() { Z3_lbool r = Z3_solver_check(ctx(), m_solver); check_error(); return to_check_result(r); }
check_result check(unsigned n, expr * const assumptions) {
array<Z3_ast> _assumptions(n);
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
check_context(*this, assumptions[i]);
_assumptions[i] = assumptions[i];
}
@ -2936,7 +2936,7 @@ namespace z3 {
check_result check(expr_vector const& assumptions) {
unsigned n = assumptions.size();
array<Z3_ast> _assumptions(n);
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
check_context(*this, assumptions[i]);
_assumptions[i] = assumptions[i];
}
@ -3167,7 +3167,7 @@ namespace z3 {
return operator[](0u);
else {
array<Z3_ast> args(n);
for (unsigned i = 0; i < n; i++)
for (unsigned i = 0; i < n; ++i)
args[i] = operator[](i);
return expr(ctx(), Z3_mk_and(ctx(), n, args.ptr()));
}
@ -3496,7 +3496,7 @@ namespace z3 {
check_result check(expr_vector const& asms) {
unsigned n = asms.size();
array<Z3_ast> _asms(n);
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
check_context(*this, asms[i]);
_asms[i] = asms[i];
}
@ -3637,25 +3637,25 @@ namespace z3 {
}
inline sort context::enumeration_sort(char const * name, unsigned n, char const * const * enum_names, func_decl_vector & cs, func_decl_vector & ts) {
array<Z3_symbol> _enum_names(n);
for (unsigned i = 0; i < n; i++) { _enum_names[i] = Z3_mk_string_symbol(*this, enum_names[i]); }
for (unsigned i = 0; i < n; ++i) { _enum_names[i] = Z3_mk_string_symbol(*this, enum_names[i]); }
array<Z3_func_decl> _cs(n);
array<Z3_func_decl> _ts(n);
Z3_symbol _name = Z3_mk_string_symbol(*this, name);
sort s = to_sort(*this, Z3_mk_enumeration_sort(*this, _name, n, _enum_names.ptr(), _cs.ptr(), _ts.ptr()));
check_error();
for (unsigned i = 0; i < n; i++) { cs.push_back(func_decl(*this, _cs[i])); ts.push_back(func_decl(*this, _ts[i])); }
for (unsigned i = 0; i < n; ++i) { cs.push_back(func_decl(*this, _cs[i])); ts.push_back(func_decl(*this, _ts[i])); }
return s;
}
inline func_decl context::tuple_sort(char const * name, unsigned n, char const * const * names, sort const* sorts, func_decl_vector & projs) {
array<Z3_symbol> _names(n);
array<Z3_sort> _sorts(n);
for (unsigned i = 0; i < n; i++) { _names[i] = Z3_mk_string_symbol(*this, names[i]); _sorts[i] = sorts[i]; }
for (unsigned i = 0; i < n; ++i) { _names[i] = Z3_mk_string_symbol(*this, names[i]); _sorts[i] = sorts[i]; }
array<Z3_func_decl> _projs(n);
Z3_symbol _name = Z3_mk_string_symbol(*this, name);
Z3_func_decl tuple;
sort _ignore_s = to_sort(*this, Z3_mk_tuple_sort(*this, _name, n, _names.ptr(), _sorts.ptr(), &tuple, _projs.ptr()));
check_error();
for (unsigned i = 0; i < n; i++) { projs.push_back(func_decl(*this, _projs[i])); }
for (unsigned i = 0; i < n; ++i) { projs.push_back(func_decl(*this, _projs[i])); }
return func_decl(*this, tuple);
}
@ -3778,7 +3778,7 @@ namespace z3 {
inline func_decl context::function(symbol const & name, unsigned arity, sort const * domain, sort const & range) {
array<Z3_sort> args(arity);
for (unsigned i = 0; i < arity; i++) {
for (unsigned i = 0; i < arity; ++i) {
check_context(domain[i], range);
args[i] = domain[i];
}
@ -3793,7 +3793,7 @@ namespace z3 {
inline func_decl context::function(symbol const& name, sort_vector const& domain, sort const& range) {
array<Z3_sort> args(domain.size());
for (unsigned i = 0; i < domain.size(); i++) {
for (unsigned i = 0; i < domain.size(); ++i) {
check_context(domain[i], range);
args[i] = domain[i];
}
@ -3849,7 +3849,7 @@ namespace z3 {
inline func_decl context::recfun(symbol const & name, unsigned arity, sort const * domain, sort const & range) {
array<Z3_sort> args(arity);
for (unsigned i = 0; i < arity; i++) {
for (unsigned i = 0; i < arity; ++i) {
check_context(domain[i], range);
args[i] = domain[i];
}
@ -3973,7 +3973,7 @@ namespace z3 {
inline expr func_decl::operator()(unsigned n, expr const * args) const {
array<Z3_ast> _args(n);
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
check_context(*this, args[i]);
_args[i] = args[i];
}
@ -3984,7 +3984,7 @@ namespace z3 {
}
inline expr func_decl::operator()(expr_vector const& args) const {
array<Z3_ast> _args(args.size());
for (unsigned i = 0; i < args.size(); i++) {
for (unsigned i = 0; i < args.size(); ++i) {
check_context(*this, args[i]);
_args[i] = args[i];
}
@ -4963,7 +4963,7 @@ namespace z3 {
std::vector<Z3_rcf_num> a(n);
std::vector<Z3_rcf_num> roots(n);
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
a[i] = coeffs[i];
}
@ -4971,7 +4971,7 @@ namespace z3 {
std::vector<rcf_num> result;
result.reserve(num_roots);
for (unsigned i = 0; i < num_roots; i++) {
for (unsigned i = 0; i < num_roots; ++i) {
result.push_back(rcf_num(c, roots[i]));
}

View file

@ -402,7 +402,7 @@ JLCXX_MODULE define_julia_module(jlcxx::Module &m)
.method("trail", [](solver &s, jlcxx::ArrayRef<unsigned> levels) {
int sz = levels.size();
z3::array<unsigned> _levels(sz);
for (int i = 0; i < sz; i++) {
for (int i = 0; i < sz; ++i) {
_levels[i] = levels[i];
}
return s.trail(_levels);
@ -631,7 +631,7 @@ JLCXX_MODULE define_julia_module(jlcxx::Module &m)
[](context& c, char const * name, jlcxx::ArrayRef<jl_value_t*,1> names, func_decl_vector &cs, func_decl_vector &ts) {
int sz = names.size();
std::vector<const char *> _names;
for (int i = 0; i < sz; i++) {
for (int i = 0; i < sz; ++i) {
const char *x = jl_string_data(names[i]);
_names.push_back(x);
}
@ -642,7 +642,7 @@ JLCXX_MODULE define_julia_module(jlcxx::Module &m)
int sz = names.size();
std::vector<sort> _sorts;
std::vector<const char *> _names;
for (int i = 0; i < sz; i++) {
for (int i = 0; i < sz; ++i) {
const sort &x = jlcxx::unbox<sort&>(sorts[i]);
const char *y = jl_string_data(names[i]);
_sorts.push_back(x);

View file

@ -155,7 +155,7 @@ struct z3_replayer::imp {
}
void display_args(std::ostream & out) const {
for (unsigned i = 0; i < m_args.size(); i++) {
for (unsigned i = 0; i < m_args.size(); ++i) {
if (i > 0) out << " ";
display_arg(out, m_args[i]);
}
@ -348,7 +348,7 @@ struct z3_replayer::imp {
throw z3_replayer_exception("invalid array size");
uint64_t aidx;
value_kind nk;
for (unsigned i = asz - sz; i < asz; i++) {
for (unsigned i = asz - sz; i < asz; ++i) {
if (m_args[i].m_kind != k)
throw z3_replayer_exception("invalid array: mixed value types");
}
@ -357,7 +357,7 @@ struct z3_replayer::imp {
nk = UINT_ARRAY;
m_unsigned_arrays.push_back(unsigned_vector());
unsigned_vector & v = m_unsigned_arrays.back();
for (unsigned i = asz - sz; i < asz; i++) {
for (unsigned i = asz - sz; i < asz; ++i) {
v.push_back(static_cast<unsigned>(m_args[i].m_uint));
}
}
@ -366,7 +366,7 @@ struct z3_replayer::imp {
nk = INT_ARRAY;
m_int_arrays.push_back(svector<int>());
svector<int> & v = m_int_arrays.back();
for (unsigned i = asz - sz; i < asz; i++) {
for (unsigned i = asz - sz; i < asz; ++i) {
v.push_back(static_cast<int>(m_args[i].m_int));
}
}
@ -375,7 +375,7 @@ struct z3_replayer::imp {
nk = SYMBOL_ARRAY;
m_sym_arrays.push_back(svector<Z3_symbol>());
svector<Z3_symbol> & v = m_sym_arrays.back();
for (unsigned i = asz - sz; i < asz; i++) {
for (unsigned i = asz - sz; i < asz; ++i) {
v.push_back(reinterpret_cast<Z3_symbol>(const_cast<char*>(m_args[i].m_str)));
}
}
@ -383,14 +383,14 @@ struct z3_replayer::imp {
TRACE(z3_replayer_bug,
tout << "args: "; display_args(tout); tout << "\n";
tout << "push_back, sz: " << sz << ", m_obj_arrays.size(): " << m_obj_arrays.size() << "\n";
for (unsigned i = asz - sz; i < asz; i++) {
for (unsigned i = asz - sz; i < asz; ++i) {
tout << "pushing: " << m_args[i].m_obj << "\n";
});
aidx = m_obj_arrays.size();
nk = OBJECT_ARRAY;
m_obj_arrays.push_back(ptr_vector<void>());
ptr_vector<void> & v = m_obj_arrays.back();
for (unsigned i = asz - sz; i < asz; i++) {
for (unsigned i = asz - sz; i < asz; ++i) {
v.push_back(m_args[i].m_obj);
}
}
@ -658,7 +658,7 @@ struct z3_replayer::imp {
unsigned idx = static_cast<unsigned>(m_args[pos].m_uint);
ptr_vector<void> const & v = m_obj_arrays[idx];
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.data();
}

View file

@ -58,7 +58,7 @@ void act_cache::compress_queue() {
SASSERT(m_qhead > 0);
unsigned sz = m_queue.size();
unsigned j = 0;
for (unsigned i = m_qhead; i < sz; i++, j++) {
for (unsigned i = m_qhead; i < sz; ++i, ++j) {
m_queue[j] = m_queue[i];
}
m_queue.shrink(j);

View file

@ -490,14 +490,14 @@ static bool use_coercion(decl_kind k) {
}
static bool has_real_arg(unsigned arity, sort * const * domain, sort * real_sort) {
for (unsigned i = 0; i < arity; i++)
for (unsigned i = 0; i < arity; ++i)
if (domain[i] == real_sort)
return true;
return false;
}
static bool has_real_arg(ast_manager * m, unsigned num_args, expr * const * args, sort * real_sort) {
for (unsigned i = 0; i < num_args; i++)
for (unsigned i = 0; i < num_args; ++i)
if (args[i]->get_sort() == real_sort)
return true;
return false;

View file

@ -56,7 +56,7 @@ sort * array_decl_plugin::mk_sort(decl_kind k, unsigned num_parameters, paramete
return nullptr;
}
for (unsigned i = 0; i < num_parameters; i++) {
for (unsigned i = 0; i < num_parameters; ++i) {
if (!parameters[i].is_ast() || !is_sort(parameters[i].get_ast())) {
m_manager->raise_exception("invalid array sort definition, parameter is not a sort");
return nullptr;
@ -70,7 +70,7 @@ sort * array_decl_plugin::mk_sort(decl_kind k, unsigned num_parameters, paramete
}
bool is_infinite = false;
bool is_very_big = false;
for (unsigned i = 0; i < num_parameters; i++) {
for (unsigned i = 0; i < num_parameters; ++i) {
sort * s = to_sort(parameters[i].get_ast());
if (s->is_infinite()) {
is_infinite = true;
@ -89,7 +89,7 @@ sort * array_decl_plugin::mk_sort(decl_kind k, unsigned num_parameters, paramete
else {
rational domain_sz(1);
rational num_elements;
for (unsigned i = 0; i < num_parameters - 1; i++) {
for (unsigned i = 0; i < num_parameters - 1; ++i) {
domain_sz *= rational(to_sort(parameters[i].get_ast())->get_num_elements().size(),rational::ui64());
}
if (domain_sz <= rational(128)) {
@ -443,7 +443,7 @@ func_decl * array_decl_plugin::mk_set_subset(unsigned arity, sort * const * doma
func_decl * array_decl_plugin::mk_as_array(func_decl * f) {
vector<parameter> parameters;
for (unsigned i = 0; i < f->get_arity(); i++) {
for (unsigned i = 0; i < f->get_arity(); ++i) {
parameters.push_back(parameter(f->get_domain(i)));
}
parameters.push_back(parameter(f->get_range()));
@ -570,7 +570,7 @@ expr * array_decl_plugin::get_some_value(sort * s) {
bool array_decl_plugin::is_fully_interp(sort * s) const {
SASSERT(s->is_sort_of(m_family_id, ARRAY_SORT));
unsigned sz = get_array_arity(s);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (!m_manager->is_fully_interp(get_array_domain(s, i)))
return false;
}

View file

@ -199,7 +199,7 @@ bool decl_info::operator==(decl_info const & info) const {
std::ostream & operator<<(std::ostream & out, decl_info const & info) {
out << ":fid " << info.get_family_id() << " :decl-kind " << info.get_decl_kind() << " :parameters (";
for (unsigned i = 0; i < info.get_num_parameters(); i++) {
for (unsigned i = 0; i < info.get_num_parameters(); ++i) {
if (i > 0) out << " ";
out << info.get_parameter(i);
}
@ -315,7 +315,7 @@ app::app(func_decl * decl, unsigned num_args, expr * const * args):
expr(AST_APP),
m_decl(decl),
m_num_args(num_args) {
for (unsigned i = 0; i < num_args; i++)
for (unsigned i = 0; i < num_args; ++i)
m_args[i] = args[i];
}
@ -634,7 +634,7 @@ bool decl_plugin::log_constant_meaning_prelude(app * a) {
func_decl * decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, parameter const * parameters,
unsigned num_args, expr * const * args, sort * range) {
ptr_buffer<sort> sorts;
for (unsigned i = 0; i < num_args; i++) {
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.data(), range);
@ -652,7 +652,7 @@ bool basic_decl_plugin::check_proof_sorts(basic_op_kind k, unsigned arity, sort
if (arity == 0)
return false;
else {
for (unsigned i = 0; i < arity - 1; i++)
for (unsigned i = 0; i < arity - 1; ++i)
if (domain[i] != m_proof_sort)
return false;
#define is_array(_x_) true
@ -666,7 +666,7 @@ bool basic_decl_plugin::check_proof_args(basic_op_kind k, unsigned num_args, exp
if (num_args == 0)
return false;
else {
for (unsigned i = 0; i < num_args - 1; i++)
for (unsigned i = 0; i < num_args - 1; ++i)
if (args[i]->get_sort() != m_proof_sort)
return false;
return
@ -679,7 +679,7 @@ bool basic_decl_plugin::check_proof_args(basic_op_kind k, unsigned num_args, exp
func_decl * basic_decl_plugin::mk_bool_op_decl(char const * name, basic_op_kind k, unsigned num_args, bool assoc, bool comm, bool idempotent,
bool flat_associative, bool chainable) {
ptr_buffer<sort> domain;
for (unsigned i = 0; i < num_args; i++)
for (unsigned i = 0; i < num_args; ++i)
domain.push_back(m_bool_sort);
func_decl_info info(m_family_id, k);
info.set_associative(assoc);
@ -705,7 +705,7 @@ func_decl * basic_decl_plugin::mk_proof_decl(
char const * name, basic_op_kind k,
unsigned num_parameters, parameter const* params, unsigned num_parents) {
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_bool_sort);
func_decl_info info(m_family_id, k, num_parameters, params);
@ -714,7 +714,7 @@ func_decl * basic_decl_plugin::mk_proof_decl(
func_decl * basic_decl_plugin::mk_proof_decl(char const * name, basic_op_kind k, unsigned num_parents, bool inc_ref) {
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_bool_sort);
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));
@ -724,7 +724,7 @@ func_decl * basic_decl_plugin::mk_proof_decl(char const * name, basic_op_kind k,
func_decl * basic_decl_plugin::mk_compressed_proof_decl(char const * name, basic_op_kind k, unsigned num_parents) {
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);
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);
@ -1049,7 +1049,7 @@ func_decl * basic_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters
func_decl_info info(m_family_id, OP_DISTINCT);
info.set_pairwise();
ptr_buffer<sort> sorts;
for (unsigned i = 1; i < arity; i++) {
for (unsigned i = 1; i < arity; ++i) {
if (domain[i] != domain[0]) {
sort* srt = join(arity, domain);
for (unsigned j = 0; j < arity; ++j)
@ -1144,7 +1144,7 @@ func_decl * label_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters
m_manager->raise_exception("invalid label declaration");
return nullptr;
}
for (unsigned i = 2; i < num_parameters; i++) {
for (unsigned i = 2; i < num_parameters; ++i) {
if (!parameters[i].is_symbol()) {
m_manager->raise_exception("invalid label declaration");
return nullptr;
@ -1159,7 +1159,7 @@ func_decl * label_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters
m_manager->raise_exception("invalid label literal declaration");
return nullptr;
}
for (unsigned i = 0; i < num_parameters; i++) {
for (unsigned i = 0; i < num_parameters; ++i) {
if (!parameters[i].is_symbol()) {
m_manager->raise_exception("invalid label literal declaration");
return nullptr;
@ -1355,13 +1355,13 @@ void ast_manager::init() {
template<typename T>
static void mark_array_ref(ast_mark& mark, unsigned sz, T * const * a) {
for(unsigned i = 0; i < sz; i++) {
for(unsigned i = 0; i < sz; ++i) {
mark.mark(a[i], true);
}
}
static void mark_array_ref(ast_mark& mark, unsigned sz, parameter const * a) {
for(unsigned i = 0; i < sz; i++) {
for(unsigned i = 0; i < sz; ++i) {
if (a[i].is_ast()) {
mark.mark(a[i].get_ast(), true);
}
@ -1508,14 +1508,14 @@ std::ostream& ast_manager::display(std::ostream& out, parameter const& p) {
void ast_manager::copy_families_plugins(ast_manager const & from) {
TRACE(copy_families_plugins,
tout << "target:\n";
for (family_id fid = 0; m_family_manager.has_family(fid); fid++) {
for (family_id fid = 0; m_family_manager.has_family(fid); ++fid) {
tout << "fid: " << fid << " fidname: " << get_family_name(fid) << "\n";
});
ast_translation trans(const_cast<ast_manager&>(from), *this, false);
// Inheriting plugins can create new family ids. Since new family ids are
// assigned in the order that they are created, this can result in differing
// family ids. To avoid this, we first assign all family ids and only then inherit plugins.
for (family_id fid = 0; from.m_family_manager.has_family(fid); fid++) {
for (family_id fid = 0; from.m_family_manager.has_family(fid); ++fid) {
symbol fid_name = from.get_family_name(fid);
if (!m_family_manager.has_family(fid)) {
family_id new_fid = mk_family_id(fid_name);
@ -1523,7 +1523,7 @@ void ast_manager::copy_families_plugins(ast_manager const & from) {
TRACE(copy_families_plugins, tout << "new target fid created: " << new_fid << " fid_name: " << fid_name << "\n";);
}
}
for (family_id fid = 0; from.m_family_manager.has_family(fid); fid++) {
for (family_id fid = 0; from.m_family_manager.has_family(fid); ++fid) {
SASSERT(from.is_builtin_family_id(fid) == is_builtin_family_id(fid));
SASSERT(!from.is_builtin_family_id(fid) || m_family_manager.has_family(fid));
symbol fid_name = from.get_family_name(fid);
@ -1747,7 +1747,7 @@ ast * ast_manager::register_node_core(ast * n) {
if (is_label(t))
f->m_has_labels = true;
unsigned depth = 0;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = t->get_arg(i);
inc_ref(arg);
unsigned arg_depth = 0;
@ -2019,7 +2019,7 @@ void ast_manager::check_sort(func_decl const * decl, unsigned num_args, expr * c
if (decl->is_associative()) {
sort * expected = decl->get_domain(0);
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
sort * given = args[i]->get_sort();
if (!compatible_sorts(expected, given)) {
std::ostringstream buff;
@ -2034,7 +2034,7 @@ void ast_manager::check_sort(func_decl const * decl, unsigned num_args, expr * c
if (decl->get_arity() != num_args) {
throw ast_exception("invalid function application, wrong number of arguments");
}
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
sort * expected = decl->get_domain(i);
sort * given = args[i]->get_sort();
if (!compatible_sorts(expected, given)) {
@ -2099,7 +2099,7 @@ bool ast_manager::coercion_needed(func_decl * decl, unsigned num_args, expr * co
if (decl->is_associative()) {
sort * d = decl->get_domain(0);
if (d->get_family_id() == arith_family_id) {
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
if (d != args[i]->get_sort())
return true;
}
@ -2111,7 +2111,7 @@ bool ast_manager::coercion_needed(func_decl * decl, unsigned num_args, expr * co
// So, there is no point in coercing the input arguments.
return false;
}
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
sort * d = decl->get_domain(i);
if (d->get_family_id() == arith_family_id && d != args[i]->get_sort())
return true;
@ -2148,7 +2148,7 @@ app * ast_manager::mk_app_core(func_decl * decl, unsigned num_args, expr * const
try {
if (m_int_real_coercions && coercion_needed(decl, num_args, args)) {
expr_ref_buffer new_args(*this);
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
sort * d = decl->is_associative() ? decl->get_domain(0) : decl->get_domain(i);
new_args.push_back(coerce_to(args[i], d));
}
@ -2178,7 +2178,7 @@ app * ast_manager::mk_app_core(func_decl * decl, unsigned num_args, expr * const
ast_ll_pp(*m_trace_stream, *this, r);
else {
*m_trace_stream << r->get_decl()->get_name();
for (unsigned i = 0; i < r->get_num_args(); i++)
for (unsigned i = 0; i < r->get_num_args(); ++i)
*m_trace_stream << " #" << r->get_arg(i)->get_id();
*m_trace_stream << "\n";
}
@ -2193,7 +2193,7 @@ app * ast_manager::mk_app_core(func_decl * decl, unsigned num_args, expr * const
}
void ast_manager::check_args(func_decl* f, unsigned n, expr* const* es) {
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
sort * actual_sort = es[i]->get_sort();
sort * expected_sort = f->is_associative() ? f->get_domain(0) : f->get_domain(i);
if (expected_sort != actual_sort) {
@ -2246,14 +2246,14 @@ app * ast_manager::mk_app(func_decl * decl, unsigned num_args, expr * const * ar
}
else if (decl->is_left_associative()) {
r = mk_app_core(decl, args[0], args[1]);
for (unsigned i = 2; i < num_args; i++) {
for (unsigned i = 2; i < num_args; ++i) {
r = mk_app_core(decl, r, args[i]);
}
}
else if (decl->is_chainable()) {
TRACE(chainable, tout << "chainable...\n";);
ptr_buffer<expr> new_args;
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]));
}
r = mk_and(new_args.size(), new_args.data());
@ -2336,7 +2336,7 @@ app * ast_manager::mk_label(bool pos, unsigned num_names, symbol const * names,
SASSERT(n->get_sort() == m_bool_sort);
buffer<parameter> p;
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]));
return mk_app(label_family_id, OP_LABEL, p.size(), p.data(), 1, &n);
}
@ -2351,7 +2351,7 @@ bool ast_manager::is_label(expr const * n, bool & pos, buffer<symbol> & names) c
}
func_decl const * decl = to_app(n)->get_decl();
pos = decl->get_parameter(0).get_int() != 0;
for (unsigned i = 1; i < decl->get_num_parameters(); i++)
for (unsigned i = 1; i < decl->get_num_parameters(); ++i)
names.push_back(decl->get_parameter(i).get_symbol());
return true;
}
@ -2359,7 +2359,7 @@ bool ast_manager::is_label(expr const * n, bool & pos, buffer<symbol> & names) c
app * ast_manager::mk_label_lit(unsigned num_names, symbol const * names) {
SASSERT(num_names > 0);
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]));
return mk_app(label_family_id, OP_LABEL_LIT, p.size(), p.data(), 0, nullptr);
}
@ -2473,7 +2473,7 @@ quantifier * ast_manager::mk_lambda(unsigned num_decls, sort * const * decl_sort
static bool same_patterns(quantifier * q, unsigned num_patterns, expr * const * patterns) {
if (num_patterns != q->get_num_patterns())
return false;
for (unsigned i = 0; i < num_patterns; i++)
for (unsigned i = 0; i < num_patterns; ++i)
if (q->get_pattern(i) != patterns[i])
return false;
return true;
@ -2483,7 +2483,7 @@ static bool same_patterns(quantifier * q, unsigned num_patterns, expr * const *
static bool same_no_patterns(quantifier * q, unsigned num_no_patterns, expr * const * no_patterns) {
if (num_no_patterns != q->get_num_no_patterns())
return false;
for (unsigned i = 0; i < num_no_patterns; i++)
for (unsigned i = 0; i < num_no_patterns; ++i)
if (q->get_no_pattern(i) != no_patterns[i])
return false;
return true;
@ -2602,9 +2602,9 @@ app * ast_manager::mk_distinct_expanded(unsigned num_args, expr * const * args)
if (num_args == 2)
return mk_not(mk_eq(args[0], args[1]));
ptr_buffer<expr> new_args;
for (unsigned i = 0; i < num_args - 1; i++) {
for (unsigned i = 0; i < num_args - 1; ++i) {
expr * a1 = args[i];
for (unsigned j = i + 1; j < num_args; j++) {
for (unsigned j = i + 1; j < num_args; ++j) {
expr * a2 = args[j];
new_args.push_back(mk_not(mk_eq(a1, a2)));
}
@ -2629,7 +2629,7 @@ expr_dependency * ast_manager::mk_leaf(expr * t) {
expr_dependency * ast_manager::mk_join(unsigned n, expr * const * ts) {
expr_dependency * d = nullptr;
for (unsigned i = 0; i < n; i++)
for (unsigned i = 0; i < n; ++i)
d = mk_join(d, mk_leaf(ts[i]));
return d;
}
@ -2897,7 +2897,7 @@ proof * ast_manager::mk_transitivity(proof * p1, proof * p2, proof * p3, proof *
proof * ast_manager::mk_transitivity(unsigned num_proofs, proof * const * proofs) {
SASSERT(num_proofs > 0);
proof * r = proofs[0];
for (unsigned i = 1; i < num_proofs; i++)
for (unsigned i = 1; i < num_proofs; ++i)
r = mk_transitivity(r, proofs[i]);
return r;
}
@ -2908,7 +2908,7 @@ proof * ast_manager::mk_transitivity(unsigned num_proofs, proof * const * proofs
if (num_proofs == 1)
return proofs[0];
DEBUG_CODE({
for (unsigned i = 0; i < num_proofs; i++) {
for (unsigned i = 0; i < num_proofs; ++i) {
SASSERT(proofs[i]);
SASSERT(!is_reflexivity(proofs[i]));
}
@ -3050,7 +3050,7 @@ proof * ast_manager::mk_def_axiom(expr * ax) {
proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * proofs) {
SASSERT(num_proofs >= 2);
DEBUG_CODE(for (unsigned i = 0; i < num_proofs; i++) SASSERT(has_fact(proofs[i])););
DEBUG_CODE(for (unsigned i = 0; i < num_proofs; ++i) SASSERT(has_fact(proofs[i])););
ptr_buffer<expr> args;
expr * fact;
expr * f1 = get_fact(proofs[0]);
@ -3091,10 +3091,10 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro
bool_vector found;
#endif
ast_mark mark;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
bool found_complement = false;
expr * lit = cls->get_arg(i);
for (unsigned j = 1; j < num_proofs; j++) {
for (unsigned j = 1; j < num_proofs; ++j) {
expr const * _fact = get_fact(proofs[j]);
if (is_complement(lit, _fact)) {
found_complement = true;
@ -3110,9 +3110,9 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro
}
}
DEBUG_CODE({
for (unsigned i = 1; proofs_enabled() && i < num_proofs; i++) {
for (unsigned i = 1; proofs_enabled() && i < num_proofs; ++i) {
CTRACE(mk_unit_resolution_bug, !found.get(i, false),
for (unsigned j = 0; j < num_proofs; j++) {
for (unsigned j = 0; j < num_proofs; ++j) {
if (j == i) tout << "Index " << i << " was not found:\n";
tout << mk_ll_pp(get_fact(proofs[j]), *this);
});
@ -3140,7 +3140,7 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro
proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * proofs, expr * new_fact) {
TRACE(unit_bug,
for (unsigned i = 0; i < num_proofs; i++) tout << mk_pp(get_fact(proofs[i]), *this) << "\n";
for (unsigned i = 0; i < num_proofs; ++i) tout << mk_pp(get_fact(proofs[i]), *this) << "\n";
tout << "===>\n";
tout << mk_pp(new_fact, *this) << "\n";);
@ -3158,7 +3158,7 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro
app * cls = to_app(f1);
unsigned cls_sz = cls->get_num_args();
CTRACE(unit_bug, !(num_proofs == cls_sz || (num_proofs == cls_sz + 1 && is_false(new_fact))),
for (unsigned i = 0; i < num_proofs; i++) tout << mk_pp(get_fact(proofs[i]), *this) << "\n";
for (unsigned i = 0; i < num_proofs; ++i) tout << mk_pp(get_fact(proofs[i]), *this) << "\n";
tout << "===>\n";
tout << mk_pp(new_fact, *this) << "\n";);
//
@ -3166,10 +3166,10 @@ proof * ast_manager::mk_unit_resolution(unsigned num_proofs, proof * const * pro
// but formula could have repeated literals that are merged in the clausal representation.
//
unsigned num_matches = 0, num_occ = 0;
for (unsigned i = 0; i < cls_sz; i++) {
for (unsigned i = 0; i < cls_sz; ++i) {
expr * lit = cls->get_arg(i);
unsigned j = 1;
for (; j < num_proofs; j++) {
for (; j < num_proofs; ++j) {
if (is_complement(lit, get_fact(proofs[j]))) {
num_matches++;
break;
@ -3231,7 +3231,7 @@ proof * ast_manager::mk_iff_oeq(proof * p) {
}
bool ast_manager::check_nnf_proof_parents(unsigned num_proofs, proof * const * proofs) const {
for (unsigned i = 0; i < num_proofs; i++) {
for (unsigned i = 0; i < num_proofs; ++i) {
if (!has_fact(proofs[i]))
return false;
if (!is_oeq(get_fact(proofs[i])))

View file

@ -1668,14 +1668,14 @@ public:
template<typename T>
void inc_array_ref(unsigned sz, T * const * a) {
for(unsigned i = 0; i < sz; i++) {
for(unsigned i = 0; i < sz; ++i) {
inc_ref(a[i]);
}
}
template<typename T>
void dec_array_ref(unsigned sz, T * const * a) {
for(unsigned i = 0; i < sz; i++) {
for(unsigned i = 0; i < sz; ++i) {
dec_ref(a[i]);
}
}
@ -2406,7 +2406,7 @@ private:
template<typename T>
void push_dec_array_ref(unsigned sz, T * const * a) {
for(unsigned i = 0; i < sz; i++) {
for(unsigned i = 0; i < sz; ++i) {
push_dec_ref(a[i]);
}
}

View file

@ -91,7 +91,7 @@ class ll_printer {
template<typename T>
void display_children(unsigned num_children, T * const * children) {
for (unsigned i = 0; i < num_children; i++) {
for (unsigned i = 0; i < num_children; ++i) {
if (i > 0) {
m_out << " ";
}
@ -213,7 +213,7 @@ public:
m_out << n->get_decl()->get_parameter(i);
}
unsigned num_parents = m_manager.get_num_parents(n);
for (unsigned i = 0; i < num_parents; i++) {
for (unsigned i = 0; i < num_parents; ++i) {
m_out << " ";
display_child(m_manager.get_parent(n, i));
}
@ -256,7 +256,7 @@ public:
m_out << "(" << (n->get_kind() == forall_k ? "forall" : (n->get_kind() == exists_k ? "exists" : "lambda")) << " ";
unsigned num_decls = n->get_num_decls();
m_out << "(vars ";
for (unsigned i = 0; i < num_decls; i++) {
for (unsigned i = 0; i < num_decls; ++i) {
if (i > 0) {
m_out << " ";
}
@ -307,7 +307,7 @@ public:
m_out << "(";
display_name(to_app(n)->get_decl());
display_params(to_app(n)->get_decl());
for (unsigned i = 0; i < num_args && i < 16; i++) {
for (unsigned i = 0; i < num_args && i < 16; ++i) {
m_out << " ";
display(to_app(n)->get_arg(i), depth-1);
}

View file

@ -67,7 +67,7 @@ bool lt(ast * n1, ast * n2) {
check_value(to_sort(n1)->get_num_parameters(), to_sort(n2)->get_num_parameters());
num = to_sort(n1)->get_num_parameters();
SASSERT(num > 0);
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
const parameter &p1 = to_sort(n1)->get_parameter(i);
const parameter &p2 = to_sort(n2)->get_parameter(i);
check_parameter(p1, p2);
@ -79,13 +79,13 @@ bool lt(ast * n1, ast * n2) {
check_value(to_func_decl(n1)->get_arity(), to_func_decl(n2)->get_arity());
check_value(to_func_decl(n1)->get_num_parameters(), to_func_decl(n2)->get_num_parameters());
num = to_func_decl(n1)->get_num_parameters();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
const parameter &p1 = to_func_decl(n1)->get_parameter(i);
const parameter &p2 = to_func_decl(n2)->get_parameter(i);
check_parameter(p1, p2);
}
num = to_func_decl(n1)->get_arity();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
ast * d1 = to_func_decl(n1)->get_domain(i);
ast * d2 = to_func_decl(n2)->get_domain(i);
check_ast(d1, d2);
@ -98,7 +98,7 @@ bool lt(ast * n1, ast * n2) {
check_value(to_app(n1)->get_depth(), to_app(n2)->get_depth());
check_ast(to_app(n1)->get_decl(), to_app(n2)->get_decl());
num = to_app(n1)->get_num_args();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * arg1 = to_app(n1)->get_arg(i);
expr * arg2 = to_app(n2)->get_arg(i);
check_ast(arg1, arg2);
@ -112,16 +112,16 @@ bool lt(ast * n1, ast * n2) {
check_value(to_quantifier(n1)->get_num_no_patterns(), to_quantifier(n2)->get_num_no_patterns());
check_value(to_quantifier(n1)->get_weight(), to_quantifier(n2)->get_weight());
num = to_quantifier(n1)->get_num_decls();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
check_symbol(to_quantifier(n1)->get_decl_name(i), to_quantifier(n2)->get_decl_name(i));
check_ast(to_quantifier(n1)->get_decl_sort(i), to_quantifier(n2)->get_decl_sort(i));
}
num = to_quantifier(n1)->get_num_patterns();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
check_ast(to_quantifier(n1)->get_pattern(i), to_quantifier(n2)->get_pattern(i));
}
num = to_quantifier(n1)->get_num_no_patterns();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
check_ast(to_quantifier(n1)->get_no_pattern(i), to_quantifier(n2)->get_no_pattern(i));
}
n1 = to_quantifier(n1)->get_expr();
@ -139,7 +139,7 @@ bool lt(ast * n1, ast * n2) {
}
bool is_sorted(unsigned num, expr * const * ns) {
for (unsigned i = 1; i < num; i++) {
for (unsigned i = 1; i < num; ++i) {
ast * prev = ns[i-1];
ast * curr = ns[i];
if (lt(curr, prev))

View file

@ -79,7 +79,7 @@ bool smt2_pp_environment::is_indexed_fdecl(func_decl * f) const {
return false;
unsigned num = f->get_num_parameters();
unsigned i;
for (i = 0; i < num; i++) {
for (i = 0; i < num; ++i) {
if (f->get_parameter(i).is_int())
continue;
if (f->get_parameter(i).is_rational())
@ -111,7 +111,7 @@ format * smt2_pp_environment::pp_fdecl_params(format * fname, func_decl * f) {
unsigned num = f->get_num_parameters();
ptr_buffer<format> fs;
fs.push_back(fname);
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
SASSERT(f->get_parameter(i).is_int() ||
f->get_parameter(i).is_rational() ||
(f->get_parameter(i).is_ast() && is_func_decl(f->get_parameter(i).get_ast())));
@ -149,7 +149,7 @@ format * smt2_pp_environment::pp_signature(format * f_name, func_decl * f) {
f_name = pp_fdecl_params(f_name, f);
}
ptr_buffer<format> f_domain;
for (unsigned i = 0; i < f->get_arity(); i++)
for (unsigned i = 0; i < f->get_arity(); ++i)
f_domain.push_back(pp_sort(f->get_domain(i)));
ptr_buffer<format> args;
args.push_back(f_name);
@ -417,7 +417,7 @@ format_ns::format * smt2_pp_environment::pp_sort(sort * s) {
if (get_arutil().is_array(s)) {
ptr_buffer<format> fs;
unsigned sz = get_array_arity(s);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
fs.push_back(pp_sort(get_array_domain(s, i)));
}
fs.push_back(pp_sort(get_array_range(s)));
@ -443,7 +443,7 @@ format_ns::format * smt2_pp_environment::pp_sort(sort * s) {
unsigned sz = get_dtutil().get_datatype_num_parameter_sorts(s);
if (sz > 0) {
ptr_buffer<format> fs;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
fs.push_back(pp_sort(get_dtutil().get_datatype_parameter_sort(s, i)));
}
return mk_seq1(m, fs.begin(), fs.end(), f2f(), name);
@ -804,7 +804,7 @@ class smt2_printer {
if (old_sz == sz)
return f;
vector<ptr_vector<format> > decls;
for (unsigned i = old_sz; i < sz; i++) {
for (unsigned i = old_sz; i < sz; ++i) {
unsigned lvl = m_aliased_lvls_names[i].first;
symbol f_name = m_aliased_lvls_names[i].second;
format * f_def[1] = { m_aliased_pps.get(i) };
@ -828,7 +828,7 @@ class smt2_printer {
if (num_op == 0)
return 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(), ")"));
return mk_compose(m(), buf.size(), buf.data());
}
@ -869,7 +869,7 @@ class smt2_printer {
void register_var_names(quantifier * q) {
unsigned num_decls = q->get_num_decls();
for (unsigned i = 0; i < num_decls; i++) {
for (unsigned i = 0; i < num_decls; ++i) {
symbol name = ensure_quote_sym(q->get_decl_name(i));
if (name.is_numerical()) {
unsigned idx = 1;
@ -887,7 +887,7 @@ class smt2_printer {
void register_var_names(unsigned n) {
unsigned idx = 1;
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
symbol name = next_name("x", idx);
SASSERT(!m_var_names_set.contains(name));
m_var_names.push_back(name);
@ -900,7 +900,7 @@ class smt2_printer {
}
void unregister_var_names(unsigned num_decls) {
for (unsigned i = 0; i < num_decls; i++) {
for (unsigned i = 0; i < num_decls; ++i) {
symbol s = m_var_names.back();
m_var_names.pop_back();
m_var_names_set.erase(s);
@ -911,7 +911,7 @@ class smt2_printer {
ptr_buffer<format> buf;
SASSERT(num_decls <= m_var_names.size());
symbol * it = m_var_names.end() - num_decls;
for (unsigned i = 0; i < num_decls; i++, it++) {
for (unsigned i = 0; i < num_decls; ++i, ++it) {
format * fs[1] = { m_env.pp_sort(srts[i]) };
std::string var_name;
if (is_smt2_quoted_symbol (*it)) {
@ -1110,7 +1110,7 @@ public:
var_prefix = "_a";
}
unsigned idx = 0;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
symbol name = next_name(var_prefix, idx);
name = ensure_quote_sym(name);
var_names.push_back(name);
@ -1136,7 +1136,7 @@ public:
format * args[3];
args[0] = fname;
ptr_buffer<format> buf;
for (unsigned i = 0; i < arity; i++) {
for (unsigned i = 0; i < arity; ++i) {
buf.push_back(m_env.pp_sort(f->get_domain(i)));
}
args[1] = mk_seq5<format**, f2f>(m(), buf.begin(), buf.end(), f2f());

View file

@ -57,7 +57,7 @@ void ast_translation::cache(ast * s, ast * t) {
void ast_translation::collect_decl_extra_children(decl * d) {
unsigned num_params = d->get_num_parameters();
for (unsigned i = 0; i < num_params; i++) {
for (unsigned i = 0; i < num_params; ++i) {
parameter const & p = d->get_parameter(i);
if (p.is_ast())
m_extra_children_stack.push_back(p.get_ast());
@ -102,7 +102,7 @@ bool ast_translation::visit(ast * n) {
void ast_translation::copy_params(decl * d, unsigned rpos, buffer<parameter> & ps) {
unsigned num = d->get_num_parameters();
unsigned j = rpos;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
parameter const & p = d->get_parameter(i);
if (p.is_ast()) {
ps.push_back(parameter(m_result_stack[j]));
@ -365,7 +365,7 @@ expr_dependency * expr_dependency_translation::operator()(expr_dependency * d) {
m_translation.from().linearize(d, m_buffer);
unsigned sz = m_buffer.size();
SASSERT(sz >= 1);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
m_buffer[i] = m_translation(m_buffer[i]);
}
return m_translation.to().mk_join(sz, m_buffer.data());

View file

@ -232,8 +232,8 @@ expr_ref push_not(const expr_ref& e, unsigned limit) {
expr * expand_distinct(ast_manager & m, unsigned num_args, expr * const * args) {
expr_ref_buffer new_diseqs(m);
for (unsigned i = 0; i < num_args; i++) {
for (unsigned j = i + 1; j < num_args; j++)
for (unsigned i = 0; i < num_args; ++i) {
for (unsigned j = i + 1; j < num_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.data());

View file

@ -27,7 +27,7 @@ void remove_duplicates(C & v) {
if (!v.empty()) {
unsigned sz = v.size();
unsigned j = 0;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
auto curr = v.get(i);
if (!visited.is_marked(curr)) {
visited.mark(curr);
@ -47,7 +47,7 @@ bool is_well_formed_vars(ptr_vector<sort>& bound, expr* n);
inline bool args_are_vars(app const * n) {
unsigned sz = n->get_num_args();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (!is_var(n->get_arg(i)))
return false;
}
@ -56,7 +56,7 @@ inline bool args_are_vars(app const * n) {
inline bool depth_leq_one(app * n) {
unsigned sz = n->get_num_args();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr * arg = n->get_arg(i);
if (is_app(arg) && to_app(arg)->get_num_args() > 0)
return false;

View file

@ -44,7 +44,7 @@ bv_decl_plugin::bv_decl_plugin():
void bv_decl_plugin::set_manager(ast_manager * m, family_id id) {
decl_plugin::set_manager(m, id);
for (unsigned i = 1; i <= 64; i++)
for (unsigned i = 1; i <= 64; ++i)
mk_bv_sort(i);
m_bit0 = m->mk_const_decl(symbol("bit0"), get_bv_sort(1), func_decl_info(m_family_id, OP_BIT0));
@ -407,7 +407,7 @@ inline bool bv_decl_plugin::get_bv_size(expr * t, int & result) {
bool bv_decl_plugin::get_concat_size(unsigned arity, sort * const * domain, int & result) {
result = 0;
for (unsigned i = 0; i < arity; i++) {
for (unsigned i = 0; i < arity; ++i) {
int sz;
if (!get_bv_size(domain[i], sz)) {
return false;
@ -500,7 +500,7 @@ func_decl * bv_decl_plugin::mk_bit2bool(unsigned bv_size, unsigned num_parameter
}
func_decl * bv_decl_plugin::mk_mkbv(unsigned arity, sort * const * domain) {
for (unsigned i = 0; i < arity; i++) {
for (unsigned i = 0; i < arity; ++i) {
if (!m_manager->is_bool(domain[i])) {
m_manager->raise_exception("invalid mkbv operator");
return nullptr;

View file

@ -90,7 +90,7 @@ protected:
public:
concat_star_converter(T * c1, unsigned num, T * const * c2s, unsigned * szs):
m_c1(c1) {
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
T * c2 = c2s[i];
if (c2)
c2->inc_ref();

View file

@ -183,7 +183,7 @@ public:
return false;
unsigned i;
expr* v = nullptr;
for (i = 0; i < num; i++) {
for (i = 0; i < num; ++i) {
expr* arg = args[i];
if (uncnstr(arg)) {
v = arg;
@ -196,7 +196,7 @@ public:
if (!m_mc)
return true;
ptr_buffer<expr> new_args;
for (unsigned j = 0; j < num; j++)
for (unsigned j = 0; j < num; ++j)
if (j != i)
new_args.push_back(args[j]);
@ -270,7 +270,7 @@ class bv_expr_inverter : public iexpr_inverter {
return false;
unsigned i;
expr* v = nullptr;
for (i = 0; i < num; i++) {
for (i = 0; i < num; ++i) {
expr* arg = args[i];
if (uncnstr(arg)) {
v = arg;
@ -283,7 +283,7 @@ class bv_expr_inverter : public iexpr_inverter {
if (!m_mc)
return true;
ptr_buffer<expr> new_args;
for (unsigned j = 0; j < num; j++)
for (unsigned j = 0; j < num; ++j)
if (j != i)
new_args.push_back(args[j]);
@ -648,7 +648,7 @@ public:
if (m.is_uninterp(get_array_range(s)))
return false;
unsigned arity = get_array_arity(s);
for (unsigned i = 0; i < arity; i++)
for (unsigned i = 0; i < arity; ++i)
if (m.is_uninterp(get_array_domain(s, i)))
return false;
// building
@ -657,7 +657,7 @@ public:
// and d is a term different from (select t i1 ... in)
expr_ref_vector new_args(m);
new_args.push_back(t);
for (unsigned i = 0; i < arity; i++)
for (unsigned i = 0; i < arity; ++i)
new_args.push_back(m.get_some_value(get_array_domain(s, i)));
expr_ref sel(m);
sel = a.mk_select(new_args);
@ -692,13 +692,13 @@ public:
return true;
}
func_decl* c = dt.get_accessor_constructor(f);
for (unsigned i = 0; i < c->get_arity(); i++)
for (unsigned i = 0; i < c->get_arity(); ++i)
if (!m.is_fully_interp(c->get_domain(i)))
return false;
mk_fresh_uncnstr_var_for(f, r);
ptr_vector<func_decl> const& accs = *dt.get_constructor_accessors(c);
ptr_buffer<expr> new_args;
for (unsigned i = 0; i < accs.size(); i++) {
for (unsigned i = 0; i < accs.size(); ++i) {
if (accs[i] == f)
new_args.push_back(r);
else
@ -719,7 +719,7 @@ public:
for (func_decl* constructor : constructors) {
unsigned num = constructor->get_arity();
unsigned target = UINT_MAX;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
sort* s_arg = constructor->get_domain(i);
if (s == s_arg) {
target = i;
@ -732,7 +732,7 @@ public:
continue;
// use the constructor the distinct term constructor(...,t,...)
ptr_buffer<expr> new_args;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
if (i == target)
new_args.push_back(t);
else
@ -924,7 +924,7 @@ expr_inverter::~expr_inverter() {
bool iexpr_inverter::uncnstr(unsigned num, expr * const * args) const {
for (unsigned i = 0; i < num; i++)
for (unsigned i = 0; i < num; ++i)
if (!m_is_var(args[i]))
return false;
return true;
@ -956,7 +956,7 @@ void iexpr_inverter::add_defs(unsigned num, expr* const* args, expr* u, expr* id
if (!m_mc)
return;
add_def(args[0], u);
for (unsigned i = 1; i < num; i++)
for (unsigned i = 1; i < num; ++i)
add_def(args[i], identity);
}
@ -979,7 +979,7 @@ bool expr_inverter::operator()(func_decl* f, unsigned num, expr* const* args, ex
if (num == 0)
return false;
for (unsigned i = 0; i < num; i++)
for (unsigned i = 0; i < num; ++i)
if (!is_ground(args[i]))
return false;

View file

@ -90,7 +90,7 @@ proof_ref apply(ast_manager & m, proof_converter_ref & pc1, proof_converter_ref_
SASSERT(pc1);
proof_ref_buffer prs(m);
unsigned sz = pc2s.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
proof_ref pr(m);
SASSERT(pc2s[i]); // proof production is enabled
pr = pc2s[i]->operator()(m, 0, nullptr);

View file

@ -710,7 +710,7 @@ namespace datatype {
SASSERT(u().is_datatype(s));
func_decl * c = u().get_non_rec_constructor(s);
ptr_buffer<expr> args;
for (unsigned i = 0; i < c->get_arity(); i++) {
for (unsigned i = 0; i < c->get_arity(); ++i) {
args.push_back(m_manager->get_some_value(c->get_domain(i)));
}
return m_manager->mk_app(c, args);
@ -964,7 +964,7 @@ namespace datatype {
ptr_vector<sort> subsorts;
do {
changed = false;
for (unsigned tid = 0; tid < num_types; tid++) {
for (unsigned tid = 0; tid < num_types; ++tid) {
if (well_founded[tid])
continue;
sort* s = sorts[tid];
@ -1003,11 +1003,11 @@ namespace datatype {
ast_mark mark;
ptr_vector<sort> subsorts;
for (unsigned tid = 0; tid < num_types; tid++) {
for (unsigned tid = 0; tid < num_types; ++tid) {
mark.mark(sorts[tid], true);
}
for (unsigned tid = 0; tid < num_types; tid++) {
for (unsigned tid = 0; tid < num_types; ++tid) {
sort* s = sorts[tid];
def const& d = get_def(s);
for (constructor const* c : d) {
@ -1314,7 +1314,7 @@ namespace datatype {
unsigned j = 0;
unsigned max_depth = 0;
unsigned start2 = rand();
for (; j < num_args; j++) {
for (; j < num_args; ++j) {
unsigned i = (start2 + j) % num_args;
sort * T_i = autil.get_array_range_rec(c->get_domain(i));
TRACE(util_bug, tout << "c: " << i << " " << sort_ref(T_i, m) << "\n";);

View file

@ -32,7 +32,7 @@ void decl_collector::visit_sort(sort * n) {
m_todo.push_back(cnstr);
ptr_vector<func_decl> const & cnstr_acc = *m_dt_util.get_constructor_accessors(cnstr);
unsigned num_cas = cnstr_acc.size();
for (unsigned j = 0; j < num_cas; j++)
for (unsigned j = 0; j < num_cas; ++j)
m_todo.push_back(cnstr_acc.get(j));
}
}
@ -163,7 +163,7 @@ void decl_collector::collect_deps(sort* s, sort_set& set) {
for (unsigned i = 0; i < num_sorts; ++i)
set.insert(m_dt_util.get_datatype_parameter_sort(s, i));
unsigned num_cnstr = m_dt_util.get_datatype_num_constructors(s);
for (unsigned i = 0; i < num_cnstr; i++) {
for (unsigned i = 0; i < num_cnstr; ++i) {
func_decl * cnstr = m_dt_util.get_datatype_constructors(s)->get(i);
set.insert(cnstr->get_range());
for (unsigned j = 0; j < cnstr->get_arity(); ++j) {

View file

@ -45,7 +45,7 @@ struct dimacs_pp {
num_lits = 1;
lits = &f;
}
for (unsigned j = 0; j < num_lits; j++) {
for (unsigned j = 0; j < num_lits; ++j) {
expr * l = lits[j];
if (m.is_false(l))
continue;
@ -78,7 +78,7 @@ struct dimacs_pp {
num_lits = 1;
lits = &f;
}
for (unsigned j = 0; j < num_lits; j++) {
for (unsigned j = 0; j < num_lits; ++j) {
expr * l = lits[j];
if (m.is_not(l))
l = to_app(l)->get_arg(0);
@ -101,7 +101,7 @@ struct dimacs_pp {
num_lits = 1;
lits = &f;
}
for (unsigned j = 0; j < num_lits; j++) {
for (unsigned j = 0; j < num_lits; ++j) {
expr * l = lits[j];
if (m.is_false(l))
continue;

View file

@ -55,7 +55,7 @@ namespace euf {
if (num != n2->num_args()) {
return false;
}
for (unsigned i = 0; i < num; i++)
for (unsigned i = 0; i < num; ++i)
if (get_root(n1, i) != get_root(n2, i))
return false;
return true;

View file

@ -115,7 +115,7 @@ namespace euf {
void display(std::ostream & out) const {
out << "lbl-hasher:\n";
bool first = true;
for (unsigned i = 0; i < m_lbl2hash.size(); i++) {
for (unsigned i = 0; i < m_lbl2hash.size(); ++i) {
if (m_lbl2hash[i] != -1) {
if (first)
first = false;
@ -282,14 +282,14 @@ namespace euf {
out << "(GET_CGR";
display_num_args(out, c.m_num_args);
out << " " << c.m_label->get_name() << " " << c.m_oreg;
for (unsigned i = 0; i < c.m_num_args; i++)
for (unsigned i = 0; i < c.m_num_args; ++i)
out << " " << c.m_iregs[i];
out << ")";
}
void display_is_cgr(std::ostream & out, const is_cgr & c) {
out << "(IS_CGR " << c.m_label->get_name() << " " << c.m_ireg;
for (unsigned i = 0; i < c.m_num_args; i++)
for (unsigned i = 0; i < c.m_num_args; ++i)
out << " " << c.m_iregs[i];
out << ")";
}
@ -298,14 +298,14 @@ namespace euf {
out << "(YIELD";
display_num_args(out, y.m_num_bindings);
out << " #" << y.m_qa->get_id();
for (unsigned i = 0; i < y.m_num_bindings; i++) {
for (unsigned i = 0; i < y.m_num_bindings; ++i) {
out << " " << y.m_bindings[i];
}
out << ")";
}
void display_joints(std::ostream & out, unsigned num_joints, enode * const * joints) {
for (unsigned i = 0; i < num_joints; i++) {
for (unsigned i = 0; i < num_joints; ++i) {
if (i > 0)
out << " ";
enode * bare = joints[i];
@ -425,7 +425,7 @@ namespace euf {
friend class code_tree_manager;
void spaces(std::ostream& out, unsigned indent) const {
for (unsigned i = 0; i < indent; i++)
for (unsigned i = 0; i < indent; ++i)
out << " ";
}
@ -888,7 +888,7 @@ namespace euf {
app * p = to_app(mp->get_arg(first_idx));
SASSERT(t->get_root_lbl() == p->get_decl());
unsigned num_args = p->get_num_args();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
set_register(i+1, p->get_arg(i));
m_todo.push_back(i+1);
}
@ -896,7 +896,7 @@ namespace euf {
if (num_decls > m_vars.size()) {
m_vars.resize(num_decls, -1);
}
for (unsigned j = 0; j < num_decls; j++) {
for (unsigned j = 0; j < num_decls; ++j) {
m_vars[j] = -1;
}
}
@ -1044,7 +1044,7 @@ namespace euf {
if (IS_CGR_SUPPORT && all_args_are_bound_vars(first_app)) {
// use IS_CGR instead of BIND
sbuffer<unsigned> iregs;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = to_app(first_app)->get_arg(i);
SASSERT(is_var(arg));
SASSERT(m_vars[to_var(arg)->get_idx()] != -1);
@ -1056,7 +1056,7 @@ namespace euf {
// Generate a BIND operation for this application.
unsigned oreg = m_tree->m_num_regs;
m_tree->m_num_regs += num_args;
for (unsigned j = 0; j < num_args; j++) {
for (unsigned j = 0; j < num_args; ++j) {
set_register(oreg + j, first_app->get_arg(j));
m_aux.push_back(oreg + j);
}
@ -1137,13 +1137,13 @@ namespace euf {
void linearise_multi_pattern(unsigned first_idx) {
unsigned num_args = m_mp->get_num_args();
// multi_pattern support
for (unsigned i = 1; i < num_args; i++) {
for (unsigned i = 1; i < num_args; ++i) {
// select the pattern with the biggest number of bound variables
app * best = nullptr;
unsigned best_num_bvars = 0;
unsigned best_j = 0;
bool found_bounded_mp = false;
for (unsigned j = 0; j < m_mp->get_num_args(); j++) {
for (unsigned j = 0; j < m_mp->get_num_args(); ++j) {
if (m_mp_already_processed[j])
continue;
app * p = to_app(m_mp->get_arg(j));
@ -1179,7 +1179,7 @@ namespace euf {
m_tree->m_num_regs += num_args;
ptr_buffer<enode> joints;
bool has_depth1_joint = false; // VAR_TAG or GROUND_TERM_TAG
for (unsigned j = 0; j < num_args; j++) {
for (unsigned j = 0; j < num_args; ++j) {
expr * curr = p->get_arg(j);
SASSERT(!is_quantifier(curr));
set_register(oreg + j, curr);
@ -1223,7 +1223,7 @@ namespace euf {
}
unsigned num_args2 = to_app(curr)->get_num_args();
unsigned k = 0;
for (; k < num_args2; k++) {
for (; k < num_args2; ++k) {
expr * arg = to_app(curr)->get_arg(k);
if (!is_var(arg))
continue;
@ -1262,7 +1262,7 @@ namespace euf {
m_mp_already_processed[first_idx] = true;
linearise_multi_pattern(first_idx);
}
for (unsigned i = 0; i < m_qa->get_num_decls(); i++)
for (unsigned i = 0; i < m_qa->get_num_decls(); ++i)
if (m_vars[i] == -1)
return;
@ -1447,7 +1447,7 @@ namespace euf {
bool is_compatible(cont * instr) const {
unsigned oreg = instr->m_oreg;
for (unsigned i = 0; i < instr->m_num_args; i++)
for (unsigned i = 0; i < instr->m_num_args; ++i)
if (m_registers[oreg + i] != 0)
return false;
return true;
@ -1481,7 +1481,7 @@ namespace euf {
unsigned oreg = static_cast<bind*>(curr)->m_oreg;
unsigned num_args = static_cast<bind*>(curr)->m_num_args;
SASSERT(n->get_num_args() == num_args);
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
set_register(oreg + i, n->get_arg(i));
m_to_reset.push_back(oreg + i);
}
@ -1542,7 +1542,7 @@ namespace euf {
app * app = to_app(m_registers[ireg]);
unsigned oreg = bnd->m_oreg;
unsigned num_args = bnd->m_num_args;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
set_register(oreg + i, app->get_arg(i));
m_todo.push_back(oreg + i);
}
@ -1982,12 +1982,12 @@ namespace euf {
return false;
default: {
m_args.reserve(num_args+1, 0);
for (unsigned i = 0; i < num_args; i++)
for (unsigned i = 0; i < num_args; ++i)
m_args[i] = m_registers[pc->m_iregs[i]]->get_root();
for (enode* n : euf::enode_class(r)) {
if (n->get_decl() == f && num_args == n->num_args()) {
unsigned i = 0;
for (; i < num_args; i++) {
for (; i < num_args; ++i) {
if (n->get_arg(i)->get_root() != m_args[i])
break;
}
@ -2142,7 +2142,7 @@ namespace euf {
unsigned short num_args = c->m_num_args;
enode * r;
// quick filter... check if any of the joint points have zero parents...
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
void * bare = c->m_joints[i];
enode * n = nullptr;
switch (GET_TAG(bare)) {
@ -2167,7 +2167,7 @@ namespace euf {
}
// traverse each joint and select the best one.
enode_vector * best_v = nullptr;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
enode * bare = c->m_joints[i];
enode_vector * curr_v = nullptr;
switch (GET_TAG(bare)) {
@ -2264,7 +2264,7 @@ namespace euf {
display_reg(out, static_cast<const filter *>(instr)->m_reg);
break;
case YIELD1: case YIELD2: case YIELD3: case YIELD4: case YIELD5: case YIELD6: case YIELDN:
for (unsigned i = 0; i < static_cast<const yield *>(instr)->m_num_bindings; i++) {
for (unsigned i = 0; i < static_cast<const yield *>(instr)->m_num_bindings; ++i) {
display_reg(out, static_cast<const yield *>(instr)->m_bindings[i]);
}
break;
@ -2450,7 +2450,7 @@ namespace euf {
m_num_args = m_app->num_args();
if (m_num_args != static_cast<const initn *>(m_pc)->m_num_args)
goto backtrack;
for (unsigned i = 0; i < m_num_args; i++)
for (unsigned i = 0; i < m_num_args; ++i)
m_registers[i+1] = m_app->get_arg(i);
m_pc = m_pc->m_next;
goto main_loop;
@ -2617,7 +2617,7 @@ namespace euf {
case BINDN:
BIND_COMMON();
m_num_args = static_cast<const bind *>(m_pc)->m_num_args;
for (unsigned i = 0; i < m_num_args; i++)
for (unsigned i = 0; i < m_num_args; ++i)
m_registers[m_oreg+i] = m_app->get_arg(i);
m_pc = m_pc->m_next;
goto main_loop;
@ -2681,7 +2681,7 @@ namespace euf {
case YIELDN:
m_num_args = static_cast<const yield *>(m_pc)->m_num_bindings;
for (unsigned i = 0; i < m_num_args; i++)
for (unsigned i = 0; i < m_num_args; ++i)
m_bindings[i] = m_registers[static_cast<const yield *>(m_pc)->m_bindings[m_num_args - i - 1]];
ON_MATCH(m_num_args);
goto backtrack;
@ -2740,7 +2740,7 @@ namespace euf {
case GET_CGRN:
m_num_args = static_cast<const get_cgr *>(m_pc)->m_num_args;
m_args.reserve(m_num_args, 0);
for (unsigned i = 0; i < m_num_args; i++)
for (unsigned i = 0; i < m_num_args; ++i)
m_args[i] = m_registers[static_cast<const get_cgr *>(m_pc)->m_iregs[i]];
goto cgr_common;
@ -2758,7 +2758,7 @@ namespace euf {
goto backtrack;
m_pattern_instances.push_back(m_app);
TRACE(mam_int, tout << "continue candidate:\n" << mk_ll_pp(m_app->get_expr(), m););
for (unsigned i = 0; i < m_num_args; i++)
for (unsigned i = 0; i < m_num_args; ++i)
m_registers[m_oreg+i] = m_app->get_arg(i);
m_pc = m_pc->m_next;
goto main_loop;
@ -2884,7 +2884,7 @@ namespace euf {
case BINDN:
BBIND_COMMON();
m_num_args = m_b->m_num_args;
for (unsigned i = 0; i < m_num_args; i++)
for (unsigned i = 0; i < m_num_args; ++i)
m_registers[m_oreg+i] = m_app->get_arg(i);
m_pc = m_b->m_next;
goto main_loop;
@ -2920,7 +2920,7 @@ namespace euf {
TRACE(mam_int, tout << "continue next candidate:\n" << mk_ll_pp(m_app->get_expr(), m););
m_num_args = c->m_num_args;
m_oreg = c->m_oreg;
for (unsigned i = 0; i < m_num_args; i++)
for (unsigned i = 0; i < m_num_args; ++i)
m_registers[m_oreg+i] = m_app->get_arg(i);
m_pc = c->m_next;
goto main_loop;
@ -3156,7 +3156,7 @@ namespace euf {
void display(std::ostream & out, unsigned indent) {
path_tree * curr = this;
while (curr != nullptr) {
for (unsigned i = 0; i < indent; i++) out << " ";
for (unsigned i = 0; i < indent; ++i) out << " ";
out << curr->m_label->get_name() << ":" << curr->m_arg_idx;
if (curr->m_ground_arg)
out << ":#" << curr->m_ground_arg->get_expr_id() << ":" << curr->m_ground_arg_idx;
@ -3290,7 +3290,7 @@ namespace euf {
void update_children_plbls(enode * app, unsigned char elem) {
unsigned num_args = app->num_args();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
enode * c = app->get_arg(i);
approx_set & r_plbls = c->get_root()->get_plbls();
if (!r_plbls.may_contain(elem)) {
@ -3326,8 +3326,8 @@ namespace euf {
}
void reset_pp_pc() {
for (unsigned i = 0; i < APPROX_SET_CAPACITY; i++) {
for (unsigned j = 0; j < APPROX_SET_CAPACITY; j++) {
for (unsigned i = 0; i < APPROX_SET_CAPACITY; ++i) {
for (unsigned j = 0; j < APPROX_SET_CAPACITY; ++j) {
m_pp[i][j].first = 0;
m_pp[i][j].second = 0;
m_pc[i][j] = nullptr;
@ -3494,7 +3494,7 @@ namespace euf {
enode * get_ground_arg(app * pat, quantifier * qa, unsigned & pos) {
pos = 0;
unsigned num_args = pat->get_num_args();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = pat->get_arg(i);
if (is_ground(arg)) {
pos = i;
@ -3514,7 +3514,7 @@ namespace euf {
unsigned ground_arg_pos = 0;
enode * ground_arg = get_ground_arg(pat, qa, ground_arg_pos);
func_decl * plbl = pat->get_decl();
for (unsigned short i = 0; i < num_args; i++) {
for (unsigned short i = 0; i < num_args; ++i) {
expr * child = pat->get_arg(i);
path * new_path = new (m_tmp_region) path(plbl, i, ground_arg_pos, ground_arg, pat_idx, p);
@ -3556,7 +3556,7 @@ namespace euf {
unsigned num_vars = qa->get_num_decls();
if (num_vars >= m_var_paths.size())
m_var_paths.resize(num_vars+1);
for (unsigned i = 0; i <= num_vars; i++)
for (unsigned i = 0; i <= num_vars; ++i)
m_var_paths[i].reset();
m_tmp_region.reset();
// Given a multi-pattern (p_1, ..., p_n)
@ -3566,15 +3566,15 @@ namespace euf {
// ...
// (p_n, p_2, ..., p_1)
unsigned num_patterns = mp->get_num_args();
for (unsigned i = 0; i < num_patterns; i++) {
for (unsigned i = 0; i < num_patterns; ++i) {
app * pat = to_app(mp->get_arg(i));
update_filters(pat, nullptr, qa, mp, i);
}
}
void display_filter_info(std::ostream & out) {
for (unsigned i = 0; i < APPROX_SET_CAPACITY; i++) {
for (unsigned j = 0; j < APPROX_SET_CAPACITY; j++) {
for (unsigned i = 0; i < APPROX_SET_CAPACITY; ++i) {
for (unsigned j = 0; j < APPROX_SET_CAPACITY; ++j) {
if (m_pp[i][j].first) {
out << "pp[" << i << "][" << j << "]:\n";
m_pp[i][j].first->display(out, 1);
@ -3902,7 +3902,7 @@ namespace euf {
// e-matching. So, for a multi-pattern [ p_1, ..., p_n ],
// we have to make n insertions. In the i-th insertion,
// the pattern p_i is assumed to be the first one.
for (unsigned i = 0; i < mp->get_num_args(); i++)
for (unsigned i = 0; i < mp->get_num_args(); ++i)
m_trees.add_pattern(qa, mp, i);
}

View file

@ -255,11 +255,11 @@ struct expr2polynomial::imp {
polynomial::scoped_numeral d(nm());
polynomial::scoped_numeral d_aux(nm());
d = 1;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
nm().lcm(d, d_args[i], d);
}
p = pm().mk_zero();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
checkpoint();
nm().div(d, d_args[i], d_aux);
p_aux = pm().mul(d_aux, p_args[i]);
@ -291,7 +291,7 @@ struct expr2polynomial::imp {
polynomial::scoped_numeral d(nm());
p = pm().mk_const(rational(1));
d = 1;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
checkpoint();
p = pm().mul(p, p_args[i]);
d = d * d_args[i];
@ -388,10 +388,10 @@ struct expr2polynomial::imp {
bool is_int_poly(polynomial::polynomial_ref const & p) {
unsigned sz = size(p);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
polynomial::monomial * m = pm().get_monomial(p, i);
unsigned msz = pm().size(m);
for (unsigned j = 0; j < msz; j++) {
for (unsigned j = 0; j < msz; ++j) {
polynomial::var x = pm().get_var(m, j);
if (!m_wrapper.is_int(x))
return false;
@ -406,7 +406,7 @@ struct expr2polynomial::imp {
unsigned sz = size(p);
bool is_int = is_int_poly(p);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
margs.reset();
polynomial::monomial * _m = pm().get_monomial(p, i);
polynomial::numeral const & a = pm().coeff(p, i);
@ -414,7 +414,7 @@ struct expr2polynomial::imp {
margs.push_back(m_autil.mk_numeral(rational(a), is_int));
}
unsigned msz = pm().size(_m);
for (unsigned j = 0; j < msz; j++) {
for (unsigned j = 0; j < msz; ++j) {
polynomial::var x = pm().get_var(_m, j);
expr * t;
if (m_use_var_idxs) {
@ -431,7 +431,7 @@ struct expr2polynomial::imp {
margs.push_back(m_autil.mk_power(t, m_autil.mk_numeral(rational(d), is_int)));
}
else {
for (unsigned k = 0; k < d; k++)
for (unsigned k = 0; k < d; ++k)
margs.push_back(t);
}
}

View file

@ -34,7 +34,7 @@ unsigned get_num_nodes(ast * n) {
bool for_each_parameter(ptr_vector<ast> & stack, ast_mark & visited, unsigned num_args, parameter const * params) {
bool result = true;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
parameter const& p = params[i];
if (p.is_ast() && !visited.is_marked(p.get_ast())) {
stack.push_back(p.get_ast());

View file

@ -25,7 +25,7 @@ Revision History:
template<typename T>
bool for_each_ast_args(ptr_vector<ast> & stack, ast_mark & visited, unsigned num_args, T * const * args) {
bool result = true;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
T * arg = args[i];
if (!visited.is_marked(arg)) {
stack.push_back(arg);

View file

@ -106,7 +106,7 @@ void for_each_expr_core(ForEachProc & proc, ExprMark & visited, expr * n) {
template<typename T>
bool for_each_expr_args(ptr_vector<expr> & stack, expr_mark & visited, unsigned num_args, T * const * args) {
bool result = true;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
T * arg = args[i];
if (!visited.is_marked(arg)) {
stack.push_back(arg);

View file

@ -242,7 +242,7 @@ bv2fpa_converter::array_model bv2fpa_converter::convert_array_func_interp(model_
if (as_arr_mdl == 0) return am;
TRACE(bv2fpa, tout << "arity=0 func_interp for " << mk_ismt2_pp(f, m) << " := " << mk_ismt2_pp(as_arr_mdl, m) << std::endl;);
SASSERT(arr_util.is_as_array(as_arr_mdl));
for (unsigned i = 0; i < arity; i++)
for (unsigned i = 0; i < arity; ++i)
array_domain.push_back(to_sort(f->get_range()->get_parameter(i).get_ast()));
sort * rng = to_sort(f->get_range()->get_parameter(arity).get_ast());
@ -268,12 +268,12 @@ func_interp * bv2fpa_converter::convert_func_interp(model_core * mc, func_decl *
if (bv_fi) {
fpa_rewriter rw(m);
for (unsigned i = 0; i < bv_fi->num_entries(); i++) {
for (unsigned i = 0; i < bv_fi->num_entries(); ++i) {
func_entry const * bv_fe = bv_fi->get_entry(i);
expr * const * bv_args = bv_fe->get_args();
expr_ref_buffer new_args(m);
for (unsigned j = 0; j < arity; j++) {
for (unsigned j = 0; j < arity; ++j) {
sort * ft_dj = dmn[j];
expr * bv_aj = bv_args[j];
expr_ref ai = rebuild_floats(mc, ft_dj, to_app(bv_aj));
@ -288,12 +288,12 @@ func_interp * bv2fpa_converter::convert_func_interp(model_core * mc, func_decl *
TRACE(bv2fpa,
tout << "func_interp entry #" << i << ":" << std::endl;
tout << "(" << bv_f->get_name();
for (unsigned i = 0; i < bv_f->get_arity(); i++)
for (unsigned i = 0; i < bv_f->get_arity(); ++i)
tout << " " << mk_ismt2_pp(bv_args[i], m);
tout << ") = " << mk_ismt2_pp(bv_fres, m) << std::endl;
tout << " --> " << std::endl;
tout << "(" << f->get_name();
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(ft_fres, m) << std::endl;);
func_entry * fe = result->get_entry(new_args.data());

View file

@ -135,8 +135,8 @@ void fpa2bv_converter::mk_distinct(func_decl * f, unsigned num, expr * const * a
// equal, thus (distinct NaN NaN) is false, even if the two NaNs have
// different bitwise representations (see also mk_eq).
result = m.mk_true();
for (unsigned i = 0; i < num; i++) {
for (unsigned j = i+1; j < num; j++) {
for (unsigned i = 0; i < num; ++i) {
for (unsigned j = i+1; j < num; ++j) {
expr_ref eq(m), neq(m);
mk_eq(args[i], args[j], eq);
neq = m.mk_not(eq);
@ -260,7 +260,7 @@ expr_ref fpa2bv_converter::extra_quantify(expr * e) {
subst_map.resize(nv);
unsigned j = 0;
for (unsigned i = 0; i < nv; i++) {
for (unsigned i = 0; i < nv; ++i) {
if (uv.contains(i)) {
TRACE(fpa2bv, tout << "uv[" << i << "] = " << mk_ismt2_pp(uv.get(i), m) << std::endl; );
sort * s = uv.get(i);
@ -1900,7 +1900,7 @@ void fpa2bv_converter::mk_sqrt(func_decl * f, unsigned num, expr * const * args,
R = m_bv_util.mk_bv_sub(m_bv_util.mk_concat(sig_prime, m_bv_util.mk_numeral(0, 4)), Q);
S = Q;
for (unsigned i = 0; i < sbits + 3; i++) {
for (unsigned i = 0; i < sbits + 3; ++i) {
dbg_decouple("fpa2bv_sqrt_Q", Q);
dbg_decouple("fpa2bv_sqrt_R", R);
@ -2437,7 +2437,7 @@ void fpa2bv_converter::mk_is_positive(func_decl * f, unsigned num, expr * const
}
void fpa2bv_converter::mk_to_fp(func_decl * f, unsigned num, expr * const * args, expr_ref & result) {
TRACE(fpa2bv_to_fp, for (unsigned i=0; i < num; i++)
TRACE(fpa2bv_to_fp, for (unsigned i=0; i < num; ++i)
tout << "arg" << i << " = " << mk_ismt2_pp(args[i], m) << std::endl; );
if (num == 1 &&
@ -2910,7 +2910,7 @@ void fpa2bv_converter::mk_to_fp_real_int(func_decl * f, unsigned num, expr * con
}
void fpa2bv_converter::mk_to_real(func_decl * f, unsigned num, expr * const * args, expr_ref & result) {
TRACE(fpa2bv_to_real, for (unsigned i = 0; i < num; i++)
TRACE(fpa2bv_to_real, for (unsigned i = 0; i < num; ++i)
tout << "arg" << i << " = " << mk_ismt2_pp(args[i], m) << std::endl;);
SASSERT(num == 1);
SASSERT(f->get_num_parameters() == 0);
@ -3003,7 +3003,7 @@ void fpa2bv_converter::mk_to_real(func_decl * f, unsigned num, expr * const * ar
}
void fpa2bv_converter::mk_to_fp_signed(func_decl * f, unsigned num, expr * const * args, expr_ref & result) {
TRACE(fpa2bv_to_fp_signed, for (unsigned i = 0; i < num; i++)
TRACE(fpa2bv_to_fp_signed, for (unsigned i = 0; i < num; ++i)
tout << "arg" << i << " = " << mk_ismt2_pp(args[i], m) << std::endl;);
// This is a conversion from signed bitvector to float:
@ -3146,7 +3146,7 @@ void fpa2bv_converter::mk_to_fp_signed(func_decl * f, unsigned num, expr * const
}
void fpa2bv_converter::mk_to_fp_unsigned(func_decl * f, unsigned num, expr * const * args, expr_ref & result) {
TRACE(fpa2bv_to_fp_unsigned, for (unsigned i = 0; i < num; i++)
TRACE(fpa2bv_to_fp_unsigned, for (unsigned i = 0; i < num; ++i)
tout << "arg" << i << " = " << mk_ismt2_pp(args[i], m) << std::endl;);
// This is a conversion from unsigned bitvector to float:
@ -3333,7 +3333,7 @@ void fpa2bv_converter::mk_to_ieee_bv_i(func_decl * f, unsigned num, expr * const
}
void fpa2bv_converter::mk_to_bv(func_decl * f, unsigned num, expr * const * args, bool is_signed, expr_ref & result) {
TRACE(fpa2bv_to_bv, for (unsigned i = 0; i < num; i++)
TRACE(fpa2bv_to_bv, for (unsigned i = 0; i < num; ++i)
tout << "arg" << i << " = " << mk_ismt2_pp(args[i], m) << std::endl;);
SASSERT(num == 2);
@ -3503,13 +3503,13 @@ void fpa2bv_converter::mk_to_bv(func_decl * f, unsigned num, expr * const * args
}
void fpa2bv_converter::mk_to_ubv(func_decl * f, unsigned num, expr * const * args, expr_ref & result) {
TRACE(fpa2bv_to_ubv, for (unsigned i = 0; i < num; i++)
TRACE(fpa2bv_to_ubv, for (unsigned i = 0; i < num; ++i)
tout << "arg" << i << " = " << mk_ismt2_pp(args[i], m) << std::endl;);
mk_to_bv(f, num, args, false, result);
}
void fpa2bv_converter::mk_to_sbv(func_decl * f, unsigned num, expr * const * args, expr_ref & result) {
TRACE(fpa2bv_to_sbv, for (unsigned i = 0; i < num; i++)
TRACE(fpa2bv_to_sbv, for (unsigned i = 0; i < num; ++i)
tout << "arg" << i << " = " << mk_ismt2_pp(args[i], m) << std::endl;);
mk_to_bv(f, num, args, true, result);
}

View file

@ -56,7 +56,7 @@ bool fpa2bv_rewriter_cfg::max_steps_exceeded(unsigned num_steps) const {
br_status fpa2bv_rewriter_cfg::reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
TRACE(fpa2bv_rw, tout << "func: " << f->get_name() << std::endl;
tout << "args: " << std::endl;
for (unsigned i = 0; i < num; i++)
for (unsigned i = 0; i < num; ++i)
tout << mk_ismt2_pp(args[i], m()) << std::endl;);
if (num == 0 && f->get_family_id() == null_family_id && m_conv.is_float(f->get_range())) {
@ -159,7 +159,7 @@ br_status fpa2bv_rewriter_cfg::reduce_app(func_decl * f, unsigned num, expr * co
default:
TRACE(fpa2bv, tout << "unsupported operator: " << f->get_name() << "\n";
for (unsigned i = 0; i < num; i++) tout << mk_ismt2_pp(args[i], m()) << std::endl;);
for (unsigned i = 0; i < num; ++i) tout << mk_ismt2_pp(args[i], m()) << std::endl;);
NOT_IMPLEMENTED_YET();
}
}
@ -183,7 +183,7 @@ bool fpa2bv_rewriter_cfg::pre_visit(expr * t)
quantifier * q = to_quantifier(t);
TRACE(fpa2bv, tout << "pre_visit quantifier [" << q->get_id() << "]: " << mk_ismt2_pp(q->get_expr(), m()) << std::endl;);
sort_ref_vector new_bindings(m_manager);
for (unsigned i = 0 ; i < q->get_num_decls(); i++)
for (unsigned i = 0 ; i < q->get_num_decls(); ++i)
new_bindings.push_back(q->get_decl_sort(i));
SASSERT(new_bindings.size() == q->get_num_decls());
m_bindings.append(new_bindings);
@ -209,7 +209,7 @@ bool fpa2bv_rewriter_cfg::reduce_quantifier(
string_buffer<> name_buffer;
ptr_buffer<sort> new_decl_sorts;
sbuffer<symbol> new_decl_names;
for (unsigned i = 0; i < num_decls; i++) {
for (unsigned i = 0; i < num_decls; ++i) {
symbol const & n = old_q->get_decl_name(i);
sort * s = old_q->get_decl_sort(i);
if (m_conv.is_float(s)) {

View file

@ -1010,7 +1010,7 @@ bool fpa_util::contains_floats(ast * a) {
if (contains_floats(aa->get_decl()))
return true;
else
for (unsigned i = 0; i < aa->get_num_args(); i++)
for (unsigned i = 0; i < aa->get_num_args(); ++i)
if (contains_floats(aa->get_arg(i)))
return true;
break;
@ -1020,10 +1020,10 @@ bool fpa_util::contains_floats(ast * a) {
break;
case AST_QUANTIFIER: {
quantifier * q = to_quantifier(a);
for (unsigned i = 0; i < q->get_num_children(); i++)
for (unsigned i = 0; i < q->get_num_children(); ++i)
if (contains_floats(q->get_child(i)))
return true;
for (unsigned i = 0; i < q->get_num_decls(); i++)
for (unsigned i = 0; i < q->get_num_decls(); ++i)
if (contains_floats(q->get_decl_sort(i)))
return true;
if (contains_floats(q->get_expr()))
@ -1035,7 +1035,7 @@ bool fpa_util::contains_floats(ast * a) {
if (is_float(s) || is_rm(s))
return true;
else {
for (unsigned i = 0; i < s->get_num_parameters(); i++) {
for (unsigned i = 0; i < s->get_num_parameters(); ++i) {
parameter const & pi = s->get_parameter(i);
if (pi.is_ast() && contains_floats(pi.get_ast()))
return true;
@ -1045,12 +1045,12 @@ bool fpa_util::contains_floats(ast * a) {
}
case AST_FUNC_DECL: {
func_decl * f = to_func_decl(a);
for (unsigned i = 0; i < f->get_arity(); i++)
for (unsigned i = 0; i < f->get_arity(); ++i)
if (contains_floats(f->get_domain(i)))
return true;
if (contains_floats(f->get_range()))
return true;
for (unsigned i = 0; i < f->get_num_parameters(); i++) {
for (unsigned i = 0; i < f->get_num_parameters(); ++i) {
parameter const & pi = f->get_parameter(i);
if (pi.is_ast() && contains_floats(pi.get_ast()))
return true;

View file

@ -276,7 +276,7 @@ bool macro_finder::expand_macros(expr_ref_vector const& exprs, proof_ref_vector
unsigned num = exprs.size();
bool deps_valid = deps.size() == exprs.size();
SASSERT(deps_valid || deps.empty());
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * n = exprs[i];
proof * pr = m.proofs_enabled() ? prs[i] : nullptr;
expr_dependency * dep = deps.get(i, nullptr);
@ -345,7 +345,7 @@ bool macro_finder::expand_macros(unsigned num, justified_expr const * fmls, vect
TRACE(macro_finder, tout << "starting expand_macros:\n";
m_macro_manager.display(tout););
bool found_new_macro = false;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * n = fmls[i].fml();
proof * pr = m.proofs_enabled() ? fmls[i].pr() : nullptr;
expr_ref new_n(m), def(m);

View file

@ -58,7 +58,7 @@ void macro_manager::pop_scope(unsigned num_scopes) {
void macro_manager::restore_decls(unsigned old_sz) {
unsigned sz = m_decls.size();
for (unsigned i = old_sz; i < sz; i++) {
for (unsigned i = old_sz; i < sz; ++i) {
m_decl2macro.erase(m_decls.get(i));
m_deps.erase(m_decls.get(i));
if (m.proofs_enabled())
@ -74,7 +74,7 @@ void macro_manager::restore_decls(unsigned old_sz) {
void macro_manager::restore_forbidden(unsigned old_sz) {
unsigned sz = m_forbidden.size();
for (unsigned i = old_sz; i < sz; i++)
for (unsigned i = old_sz; i < sz; ++i)
m_forbidden_set.erase(m_forbidden.get(i));
m_forbidden.shrink(old_sz);
}
@ -176,7 +176,7 @@ namespace macro_manager_ns {
void macro_manager::mark_forbidden(unsigned n, justified_expr const * exprs) {
expr_mark visited;
macro_manager_ns::proc p(m_forbidden_set, m_forbidden);
for (unsigned i = 0; i < n; i++)
for (unsigned i = 0; i < n; ++i)
for_each_expr(p, visited, exprs[i].fml());
}
@ -203,7 +203,7 @@ void macro_manager::get_head_def(quantifier * q, func_decl * d, app * & head, ex
void macro_manager::display(std::ostream & out) {
unsigned sz = m_decls.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
func_decl * f = m_decls.get(i);
quantifier * q = nullptr;
m_decl2macro.find(f, q);
@ -267,11 +267,11 @@ struct macro_manager::macro_expander_cfg : public default_rewriter_cfg {
// So, I'm just erasing them.
bool erase_patterns = false;
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_patterns(); i++) {
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_patterns(); ++i) {
if (old_q->get_pattern(i) != new_patterns[i])
erase_patterns = true;
}
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_no_patterns(); i++) {
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_no_patterns(); ++i) {
if (old_q->get_no_pattern(i) != new_no_patterns[i])
erase_patterns = true;
}
@ -301,7 +301,7 @@ struct macro_manager::macro_expander_cfg : public default_rewriter_cfg {
TRACE(macro_manager, tout << "expanding: " << mk_pp(n, m) << "\n" << mk_pp(head, m) << " " << mk_pp(def, m) << "\n";);
ptr_buffer<expr> subst_args;
subst_args.resize(num, 0);
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
var * v = to_var(head->get_arg(i));
if (v->get_idx() >= num)
return false;

View file

@ -143,7 +143,7 @@ bool macro_util::is_macro_head(expr * n, unsigned num_decls) const {
to_app(n)->get_num_args() == num_decls) {
sbuffer<int> var2pos;
var2pos.resize(num_decls, -1);
for (unsigned i = 0; i < num_decls; i++) {
for (unsigned i = 0; i < num_decls; ++i) {
expr * c = to_app(n)->get_arg(i);
if (!is_var(c))
return false;
@ -252,7 +252,7 @@ bool macro_util::poly_contains_head(expr * n, func_decl * f, expr * exception) c
num_args = 1;
args = &n;
}
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (arg != exception && occurs(f, arg))
return true;
@ -283,7 +283,7 @@ bool macro_util::is_arith_macro(expr * n, unsigned num_decls, app_ref & head, ex
lhs_num_args = 1;
lhs_args = &lhs;
}
for (unsigned i = 0; i < lhs_num_args; i++) {
for (unsigned i = 0; i < lhs_num_args; ++i) {
expr * arg = lhs_args[i];
expr * neg_arg;
if (h == nullptr &&
@ -392,7 +392,7 @@ bool macro_util::is_quasi_macro_head(expr * n, unsigned num_decls) const {
sbuffer<bool> found_vars;
found_vars.resize(num_decls, false);
unsigned num_found_vars = 0;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = to_app(n)->get_arg(i);
if (is_var(arg)) {
unsigned idx = to_var(arg)->get_idx();
@ -429,7 +429,7 @@ bool macro_util::is_quasi_macro_ok(expr * n, unsigned num_decls, expr * def) con
}
if (def)
fv.accumulate(def);
for (unsigned i = 0; i < fv.size(); i++) {
for (unsigned i = 0; i < fv.size(); ++i) {
if (i >= num_decls || !fv.contains(i))
continue; // Quasi-macros may have new variables.
if (found_vars[i] == false) {
@ -453,7 +453,7 @@ void macro_util::quasi_macro_head_to_macro_head(app * qhead, unsigned & num_decl
ptr_buffer<expr> new_args;
ptr_buffer<expr> new_conds;
unsigned next_var_idx = num_decls;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = qhead->get_arg(i);
if (is_var(arg)) {
unsigned idx = to_var(arg)->get_idx();
@ -508,7 +508,7 @@ void macro_util::normalize_expr(app * head, unsigned num_decls, expr * t, expr_r
TRACE(macro_util,
tout << "head: " << mk_pp(head, m) << "\n";
tout << "applying substitution to:\n" << mk_bounded_pp(t, m) << "\n";);
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
var * v = to_var(head->get_arg(i));
unsigned vi = v->get_idx();
SASSERT(vi < num_decls);
@ -527,7 +527,7 @@ void macro_util::normalize_expr(app * head, unsigned num_decls, expr * t, expr_r
TRACE(macro_util,
tout << "head: " << mk_pp(head, m) << "\n";
tout << "applying substitution to:\n" << mk_ll_pp(t, m) << "\nsubstitution:\n";
for (unsigned i = 0; i < var_mapping.size(); i++) {
for (unsigned i = 0; i < var_mapping.size(); ++i) {
if (var_mapping[i] != 0)
tout << "#" << i << " -> " << mk_ll_pp(var_mapping[i], m);
});
@ -652,7 +652,7 @@ bool macro_util::is_poly_hint(expr * n, app * head, expr * exception) {
num_args = 1;
args = &n;
}
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (arg != exception && (occurs(f, arg) || !vars_of_is_subset(arg, vars))) {
TRACE(macro_util, tout << "failed because of:\n" << mk_pp(arg, m) << "\n";);
@ -744,7 +744,7 @@ bool macro_util::rest_contains_decl(func_decl * f, expr * except_lit) {
return false;
SASSERT(is_clause(m, m_curr_clause));
unsigned num_lits = get_clause_num_literals(m, m_curr_clause);
for (unsigned i = 0; i < num_lits; i++) {
for (unsigned i = 0; i < num_lits; ++i) {
expr * l = get_clause_literal(m, m_curr_clause, i);
if (l != except_lit && occurs(f, l))
return true;
@ -758,7 +758,7 @@ void macro_util::get_rest_clause_as_cond(expr * except_lit, expr_ref & extra_con
SASSERT(is_clause(m, m_curr_clause));
expr_ref_buffer neg_other_lits(m);
unsigned num_lits = get_clause_num_literals(m, m_curr_clause);
for (unsigned i = 0; i < num_lits; i++) {
for (unsigned i = 0; i < num_lits; ++i) {
expr * l = get_clause_literal(m, m_curr_clause, i);
if (l != except_lit) {
expr_ref neg_l(m);
@ -783,7 +783,7 @@ void macro_util::collect_poly_args(expr * n, expr * exception, ptr_buffer<expr>
num_args = 1;
_args = &n;
}
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = _args[i];
if (arg != exception)
args.push_back(arg);
@ -811,7 +811,7 @@ void macro_util::collect_arith_macro_candidates(expr * lhs, expr * rhs, expr * a
lhs_num_args = 1;
lhs_args = &lhs;
}
for (unsigned i = 0; i < lhs_num_args; i++) {
for (unsigned i = 0; i < lhs_num_args; ++i) {
expr * arg = lhs_args[i];
expr * neg_arg;
if (!is_app(arg))
@ -967,7 +967,7 @@ void macro_util::collect_macro_candidates(quantifier * q, macro_candidates & r)
if (is_clause(m, n)) {
m_curr_clause = n;
unsigned num_lits = get_clause_num_literals(m, n);
for (unsigned i = 0; i < num_lits; i++)
for (unsigned i = 0; i < num_lits; ++i)
collect_macro_candidates_core(get_clause_literal(m, n, i), num_decls, r);
m_curr_clause = nullptr;
}

View file

@ -36,7 +36,7 @@ void quantifier_macro_info::collect_macro_candidates(quantifier* q) {
qa = m.update_quantifier(q, quantifier_kind::forall_k, m.mk_not(q->get_expr()));
mutil.collect_macro_candidates(qa, candidates);
unsigned num_candidates = candidates.size();
for (unsigned i = 0; i < num_candidates; i++) {
for (unsigned i = 0; i < num_candidates; ++i) {
cond_macro* mc = alloc(cond_macro, m, candidates.get_f(i), candidates.get_def(i), candidates.get_cond(i),
candidates.ineq(i), candidates.satisfy_atom(i), candidates.hint(i), q->get_weight());
insert_macro(mc);

View file

@ -89,7 +89,7 @@ public:
void operator()(quantifier * n) {}
void operator()(app * n) {}
bool all_used() {
for (unsigned i = 0; i < m_bitset.size() ; i++)
for (unsigned i = 0; i < m_bitset.size() ; ++i)
if (!m_bitset.get(i))
return false;
return true;
@ -111,7 +111,7 @@ bool quasi_macros::fully_depends_on(app * a, quantifier * q) const {
if (is_var(arg))
bitset.set(to_var(arg)->get_idx(), true);
for (unsigned i = 0; i < bitset.size() ; i++)
for (unsigned i = 0; i < bitset.size() ; ++i)
if (!bitset.get(i))
return false;
@ -249,7 +249,7 @@ bool quasi_macros::quasi_macro_to_macro(quantifier * q, app * a, expr * t, quant
}
// We want to keep all the old variables [already reversed]
for (unsigned i = 0 ; i < q->get_num_decls() ; i++) {
for (unsigned i = 0 ; i < q->get_num_decls() ; ++i) {
new_var_names_rev.push_back(q->get_decl_name(i));
new_qsorts_rev.push_back(q->get_decl_sort(i));
}
@ -274,14 +274,14 @@ bool quasi_macros::quasi_macro_to_macro(quantifier * q, app * a, expr * t, quant
bool quasi_macros::find_macros(unsigned n, expr * const * exprs) {
TRACE(quasi_macros, tout << "Finding quasi-macros in: " << std::endl;
for (unsigned i = 0 ; i < n ; i++)
for (unsigned i = 0 ; i < n ; ++i)
tout << i << ": " << mk_pp(exprs[i], m) << std::endl; );
bool res = false;
m_occurrences.reset();
// Find out how many non-ground appearances for each uninterpreted function there are
for (unsigned i = 0 ; i < n ; i++)
for (unsigned i = 0 ; i < n ; ++i)
find_occurrences(exprs[i]);
TRACE(quasi_macros,
@ -290,7 +290,7 @@ bool quasi_macros::find_macros(unsigned n, expr * const * exprs) {
tout << kd.m_key->get_name() << ": " << kd.m_value << std::endl; );
// Find all macros
for (unsigned i = 0 ; i < n ; i++) {
for (unsigned i = 0 ; i < n ; ++i) {
app_ref a(m);
expr_ref t(m);
quantifier_ref macro(m);
@ -312,14 +312,14 @@ bool quasi_macros::find_macros(unsigned n, expr * const * exprs) {
bool quasi_macros::find_macros(unsigned n, justified_expr const * exprs) {
TRACE(quasi_macros, tout << "Finding quasi-macros in: " << std::endl;
for (unsigned i = 0; i < n; i++)
for (unsigned i = 0; i < n; ++i)
tout << i << ": " << mk_pp(exprs[i].fml(), m) << std::endl; );
bool res = false;
m_occurrences.reset();
// Find out how many non-ground appearances for each uninterpreted function there are
for (unsigned i = 0 ; i < n ; i++)
for (unsigned i = 0 ; i < n ; ++i)
find_occurrences(exprs[i].fml());
TRACE(quasi_macros, tout << "Occurrences: " << std::endl;
@ -327,7 +327,7 @@ bool quasi_macros::find_macros(unsigned n, justified_expr const * exprs) {
tout << kv.m_key->get_name() << ": " << kv.m_value << std::endl; );
// Find all macros
for (unsigned i = 0 ; i < n ; i++) {
for (unsigned i = 0 ; i < n ; ++i) {
app_ref a(m);
expr_ref t(m);
quantifier_ref macro(m);
@ -348,7 +348,7 @@ bool quasi_macros::find_macros(unsigned n, justified_expr const * exprs) {
void quasi_macros::apply_macros(expr_ref_vector & exprs, proof_ref_vector & prs, expr_dependency_ref_vector& deps) {
unsigned n = exprs.size();
for (unsigned i = 0 ; i < n ; i++ ) {
for (unsigned i = 0 ; i < n ; ++i ) {
expr_ref r(m), rr(m);
proof_ref pr(m), prr(m);
expr_dependency_ref dep(m);
@ -374,7 +374,7 @@ bool quasi_macros::operator()(expr_ref_vector & exprs, proof_ref_vector & prs, e
}
void quasi_macros::apply_macros(unsigned n, justified_expr const* fmls, vector<justified_expr>& new_fmls) {
for (unsigned i = 0 ; i < n ; i++) {
for (unsigned i = 0 ; i < n ; ++i) {
expr_ref r(m), rr(m);
proof_ref pr(m), prr(m);
proof * p = m.proofs_enabled() ? fmls[i].pr() : nullptr;
@ -394,7 +394,7 @@ bool quasi_macros::operator()(unsigned n, justified_expr const* fmls, vector<jus
}
else {
// just copy them over
for (unsigned i = 0 ; i < n ; i++ ) {
for (unsigned i = 0 ; i < n ; ++i ) {
new_fmls.push_back(fmls[i]);
}
return false;

View file

@ -103,7 +103,7 @@ app * defined_names::impl::gen_name(expr * e, sort_ref_buffer & var_sorts, buffe
unsigned num_vars = uv.get_max_found_var_idx_plus_1();
ptr_buffer<expr> new_args;
ptr_buffer<sort> domain;
for (unsigned i = 0; i < num_vars; i++) {
for (unsigned i = 0; i < num_vars; ++i) {
sort * s = uv.get(i);
if (s) {
domain.push_back(s);

View file

@ -91,7 +91,7 @@ class skolemizer {
unsigned sz = m_uv.get_max_found_var_idx_plus_1();
ptr_buffer<sort> sorts;
expr_ref_vector args(m);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
sort * s = m_uv.get(i);
if (s != nullptr) {
sorts.push_back(s);
@ -114,7 +114,7 @@ class skolemizer {
// (VAR 0) is in the first position of substitution.
// (VAR num_decls-1) is in the last position.
//
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
sort * s = m_uv.get(i);
if (s != nullptr)
substitution.push_back(m.mk_var(i, s));
@ -272,7 +272,7 @@ struct nnf::imp {
m_result_pr_stack(m),
m_skolemizer(m) {
updt_params(p);
for (unsigned i = 0; i < 4; i++) {
for (unsigned i = 0; i < 4; ++i) {
if (proofs_enabled())
m_cache_pr[i] = alloc(act_cache, m);
}
@ -283,7 +283,7 @@ struct nnf::imp {
bool proofs_enabled() const { return m.proofs_enabled(); }
~imp() {
for (unsigned i = 0; i < 4; i++) {
for (unsigned i = 0; i < 4; ++i) {
if (proofs_enabled())
dealloc(m_cache_pr[i]);
}
@ -323,7 +323,7 @@ struct nnf::imp {
}
void reset_cache() {
for (unsigned i = 0; i < 4; i++) {
for (unsigned i = 0; i < 4; ++i) {
m_cache[i].reset();
if (proofs_enabled())
m_cache_pr[i]->reset();
@ -783,7 +783,7 @@ struct nnf::imp {
if (is_forall(q) == fr.m_pol) {
// collect non sk_hack patterns
unsigned num_patterns = q->get_num_patterns();
for (unsigned i = 0; i < num_patterns; i++) {
for (unsigned i = 0; i < num_patterns; ++i) {
expr * pat = q->get_pattern(i);
if (!m_skolemizer.is_sk_hack(pat))
new_patterns.push_back(pat);
@ -899,7 +899,7 @@ struct nnf::imp {
unsigned old_sz1 = new_defs.size();
unsigned old_sz2 = new_def_proofs.size();
for (unsigned i = 0; i < m_todo_defs.size(); i++) {
for (unsigned i = 0; i < m_todo_defs.size(); ++i) {
expr_ref dr(m);
proof_ref dpr(m);
process(m_todo_defs.get(i), dr, dpr);

View file

@ -62,7 +62,7 @@ struct pull_quant::imp {
bool found_quantifier = false;
bool forall_children = false;
for (unsigned i = 0; i < num_children; i++) {
for (unsigned i = 0; i < num_children; ++i) {
expr * child = children[i];
if (is_quantifier(child) && !is_lambda(child)) {
@ -99,7 +99,7 @@ struct pull_quant::imp {
unsigned num_decls = var_sorts.size();
unsigned shift_amount = 0;
TRACE(pull_quant, tout << "Result num decls:" << num_decls << "\n";);
for (unsigned i = 0; i < num_children; i++) {
for (unsigned i = 0; i < num_children; ++i) {
expr * child = children[i];
if (!is_quantifier(child)) {
// increment the free variables in child by num_decls because

View file

@ -72,7 +72,7 @@ void num_occurs::operator()(expr * t) {
void num_occurs::operator()(unsigned num, expr * const * ts) {
expr_fast_mark1 visited;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
process(ts[i], visited);
}
}

View file

@ -56,7 +56,7 @@ bool smaller_pattern::process(expr * p1, expr * p2) {
unsigned num1 = app1->get_num_args();
if (num1 != app2->get_num_args() || app1->get_decl() != app2->get_decl())
return false;
for (unsigned i = 0; i < num1; i++)
for (unsigned i = 0; i < num1; ++i)
save(app1->get_arg(i), app2->get_arg(i));
break;
}
@ -84,7 +84,7 @@ bool smaller_pattern::process(expr * p1, expr * p2) {
bool smaller_pattern::operator()(unsigned num_bindings, expr * p1, expr * p2) {
m_bindings.resize(num_bindings);
for (unsigned i = 0; i < num_bindings; i++)
for (unsigned i = 0; i < num_bindings; ++i)
m_bindings[i] = 0;
return process(p1, p2);
}
@ -212,7 +212,7 @@ void pattern_inference_cfg::collect::save_candidate(expr * n, unsigned delta) {
uint_set free_vars;
unsigned size = 1;
unsigned num = c->get_num_args();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * child = c->get_arg(i);
info * child_info = nullptr;
#ifdef Z3DEBUG
@ -269,7 +269,7 @@ void pattern_inference_cfg::collect::reset() {
}
void pattern_inference_cfg::add_candidate(app * n, uint_set const & free_vars, unsigned size) {
for (unsigned i = 0; i < m_num_no_patterns; i++) {
for (unsigned i = 0; i < m_num_no_patterns; ++i) {
if (n == m_no_patterns[i])
return;
}
@ -287,14 +287,14 @@ void pattern_inference_cfg::add_candidate(app * n, uint_set const & free_vars, u
*/
void pattern_inference_cfg::filter_looping_patterns(ptr_vector<app> & result) {
unsigned num = m_candidates.size();
for (unsigned i1 = 0; i1 < num; i1++) {
for (unsigned i1 = 0; i1 < num; ++i1) {
app * n1 = m_candidates.get(i1);
expr2info::obj_map_entry * e1 = m_candidates_info.find_core(n1);
SASSERT(e1);
uint_set const & s1 = e1->get_data().m_value.m_free_vars;
if (m_block_loop_patterns) {
bool smaller = false;
for (unsigned i2 = 0; i2 < num; i2++) {
for (unsigned i2 = 0; i2 < num; ++i2) {
if (i1 != i2) {
app * n2 = m_candidates.get(i2);
expr2info::obj_map_entry * e2 = m_candidates_info.find_core(n2);
@ -358,7 +358,7 @@ bool pattern_inference_cfg::contains_subpattern::operator()(expr * n) {
}
}
num = to_app(curr)->get_num_args();
for (unsigned i = 0; i < num; i++)
for (unsigned i = 0; i < num; ++i)
save(to_app(curr)->get_arg(i));
break;
case AST_VAR:
@ -481,7 +481,7 @@ void pattern_inference_cfg::candidates2multi_patterns(unsigned max_num_patterns,
m_pre_patterns.push_back(alloc(pre_pattern));
unsigned sz = candidate_patterns.size();
unsigned num_splits = 0;
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];
if (curr->m_free_vars.num_elems() == m_num_bindings) {
app * new_pattern = m.mk_pattern(curr->m_exprs.size(), curr->m_exprs.data());
@ -574,7 +574,7 @@ void pattern_inference_cfg::mk_patterns(unsigned num_bindings,
tout << mk_pp(n, m);
tout << "\ncandidates:\n";
unsigned num = m_candidates.size();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
tout << mk_pp(m_candidates.get(i), m) << "\n";
});
@ -637,7 +637,7 @@ bool pattern_inference_cfg::reduce_quantifier(
m_database.initialize(g_pattern_database);
unsigned new_weight;
if (m_database.match_quantifier(q, new_patterns, new_weight)) {
DEBUG_CODE(for (unsigned i = 0; i < new_patterns.size(); i++) { SASSERT(is_well_sorted(m, new_patterns.get(i))); });
DEBUG_CODE(for (unsigned i = 0; i < new_patterns.size(); ++i) { SASSERT(is_well_sorted(m, new_patterns.get(i))); });
if (q->get_num_patterns() > 0) {
// just update the weight...
TRACE(pattern_inference, tout << "updating weight to: " << new_weight << "\n" << mk_pp(q, m) << "\n";);
@ -760,7 +760,7 @@ bool pattern_inference_cfg::reduce_quantifier(
IF_VERBOSE(10,
verbose_stream() << "(smt.inferred-patterns :qid " << q->get_qid() << "\n";
for (unsigned i = 0; i < new_patterns.size(); i++)
for (unsigned i = 0; i < new_patterns.size(); ++i)
verbose_stream() << " " << mk_ismt2_pp(new_patterns[i], m, 2) << "\n";
verbose_stream() << ")\n"; );

View file

@ -239,7 +239,7 @@ public:
expr_ref & result,
proof_ref & result_pr);
void register_preferred(unsigned num, func_decl * const * fs) { for (unsigned i = 0; i < num; i++) register_preferred(fs[i]); }
void register_preferred(unsigned num, func_decl * const * fs) { for (unsigned i = 0; i < num; ++i) register_preferred(fs[i]); }
bool is_forbidden(func_decl const * decl) const {
family_id fid = decl->get_family_id();

View file

@ -33,7 +33,7 @@ static std::pair<unsigned, bool> space_upto_line_break(ast_manager & m, format *
return space_upto_line_break(m, to_app(f->get_arg(0)));
case OP_COMPOSE:
r = 0;
for (unsigned i = 0; i < f->get_num_args(); i++) {
for (unsigned i = 0; i < f->get_num_args(); ++i) {
std::pair<unsigned, bool> pair = space_upto_line_break(m, to_app(f->get_arg(i)));
r += pair.first;
if (pair.second)
@ -122,7 +122,7 @@ void pp(std::ostream & out, format * f, ast_manager & m, params_ref const & _p)
line++;
if (line < max_num_lines) {
out << "\n";
for (unsigned i = 0; i < indent; i++)
for (unsigned i = 0; i < indent; ++i)
out << " ";
}
else

View file

@ -577,7 +577,7 @@ bool proof_checker::check1_basic(proof* p, expr_ref_vector& side_conditions) {
if (!found) {
TRACE(pr_unit_bug,
tout << "Parents:\n";
for (unsigned i = 0; i < proofs.size(); i++) {
for (unsigned i = 0; i < proofs.size(); ++i) {
expr* p = nullptr;
match_fact(proofs.get(i), p);
tout << mk_pp(p, m) << "\n";
@ -1236,7 +1236,7 @@ void proof_checker::dump_proof(proof const* pr) {
expr * consequent = m.get_fact(pr);
unsigned num = m.get_num_parents(pr);
ptr_buffer<expr> antecedents;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
proof * a = m.get_parent(pr, i);
SASSERT(m.has_fact(a));
antecedents.push_back(m.get_fact(a));
@ -1252,7 +1252,7 @@ void proof_checker::dump_proof(unsigned num_antecedents, expr * const * antecede
pp.set_benchmark_name("lemma");
pp.set_status("unsat");
pp.set_logic(symbol(m_logic.c_str()));
for (unsigned i = 0; i < num_antecedents; i++)
for (unsigned i = 0; i < num_antecedents; ++i)
pp.add_assumption(antecedents[i]);
expr_ref n(m);
n = m.mk_not(consequent);
@ -1389,7 +1389,7 @@ bool proof_checker::check_arith_proof(proof* p) {
}
unsigned num_parents = m.get_num_parents(p);
for (unsigned i = 0; i < num_parents; i++) {
for (unsigned i = 0; i < num_parents; ++i) {
proof * a = m.get_parent(p, i);
SASSERT(m.has_fact(a));
if (!check_arith_literal(true, to_app(m.get_fact(a)), coeffs[offset++], sum, is_strict)) {
@ -1397,7 +1397,7 @@ bool proof_checker::check_arith_proof(proof* p) {
}
}
TRACE(proof_checker,
for (unsigned i = 0; i < num_parents; i++)
for (unsigned i = 0; i < num_parents; ++i)
tout << coeffs[i] << " * " << mk_bounded_pp(m.get_fact(m.get_parent(p, i)), m) << "\n";
tout << "fact:" << mk_bounded_pp(fact, m) << "\n";);

View file

@ -35,16 +35,16 @@ bool recurse_expr<T, Visitor, IgnorePatterns, CallDestructors>::visit_children(e
switch (n->get_kind()) {
case AST_APP:
num = to_app(n)->get_num_args();
for (unsigned j = 0; j < num; j++)
for (unsigned j = 0; j < num; ++j)
visit(to_app(n)->get_arg(j), visited);
break;
case AST_QUANTIFIER:
if (!IgnorePatterns) {
num = to_quantifier(n)->get_num_patterns();
for (unsigned j = 0; j < num; j++)
for (unsigned j = 0; j < num; ++j)
visit(to_quantifier(n)->get_pattern(j), visited);
num = to_quantifier(n)->get_num_no_patterns();
for (unsigned j = 0; j < num; j++)
for (unsigned j = 0; j < num; ++j)
visit(to_quantifier(n)->get_no_pattern(j), visited);
}
visit(to_quantifier(n)->get_expr(), visited);
@ -62,7 +62,7 @@ void recurse_expr<T, Visitor, IgnorePatterns, CallDestructors>::process(expr * n
case AST_APP:
m_results1.reset();
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)));
cache_result(n, this->Visitor::visit(to_app(n), m_results1.data()));
break;
@ -77,10 +77,10 @@ void recurse_expr<T, Visitor, IgnorePatterns, CallDestructors>::process(expr * n
m_results1.reset();
m_results2.reset();
num = to_quantifier(n)->get_num_patterns();
for (unsigned j = 0; j < num; j++)
for (unsigned j = 0; j < num; ++j)
m_results1.push_back(get_cached(to_quantifier(n)->get_pattern(j)));
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)));
cache_result(n, this->Visitor::visit(to_quantifier(n), get_cached(to_quantifier(n)->get_expr()), m_results1.data(), m_results2.data()));
}

View file

@ -110,7 +110,7 @@ void arith_rewriter::get_coeffs_gcd(expr * t, numeral & g, bool & first, unsigne
expr * const * ms = get_monomials(t, sz);
SASSERT(sz >= 1);
numeral a;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr * arg = ms[i];
if (is_numeral(arg, a)) {
if (!a.is_zero())
@ -139,7 +139,7 @@ bool arith_rewriter::div_polynomial(expr * t, numeral const & g, const_treatment
expr * const * ms = get_monomials(t, sz);
expr_ref_buffer new_args(m);
numeral a;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr * arg = ms[i];
if (is_numeral(arg, a)) {
a /= g;
@ -406,7 +406,7 @@ bool arith_rewriter::elim_to_real_mon(expr * monomial, expr_ref & new_monomial)
expr_ref_buffer new_vars(m);
expr_ref new_var(m);
unsigned num = to_app(monomial)->get_num_args();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
if (!elim_to_real_var(to_app(monomial)->get_arg(i), new_var))
return false;
new_vars.push_back(new_var);
@ -453,7 +453,7 @@ bool arith_rewriter::is_reduce_power_target(expr * arg, bool is_eq) {
sz = 1;
args = &arg;
}
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr * arg = args[i];
expr* arg0, *arg1;
if (m_util.is_power(arg, arg0, arg1)) {
@ -480,7 +480,7 @@ expr * arith_rewriter::reduce_power(expr * arg, bool is_eq) {
}
ptr_buffer<expr> new_args;
rational k;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr * arg = args[i];
expr * arg0, *arg1;
if (m_util.is_power(arg, arg0, arg1) && m_util.is_numeral(arg1, k) && k.is_int() &&
@ -941,7 +941,7 @@ bool arith_rewriter::is_anum_simp_target(unsigned num_args, expr * const * args)
return false;
unsigned num_irrat = 0;
unsigned num_rat = 0;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
if (m_util.is_numeral(args[i])) {
num_rat++;
if (num_irrat > 0)
@ -1746,7 +1746,7 @@ br_status arith_rewriter::mk_power_core(expr * arg1, expr * arg2, expr_ref & res
is_num_y && y.is_unsigned() && 1 < y.get_unsigned() && y.get_unsigned() <= m_max_degree) {
ptr_buffer<expr> args;
unsigned k = y.get_unsigned();
for (unsigned i = 0; i < k; i++) {
for (unsigned i = 0; i < k; ++i) {
args.push_back(arg1);
}
result = ensure_real(m_util.mk_mul(args.size(), args.data()));

View file

@ -128,7 +128,7 @@ br_status array_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * c
// l_false -- at least one disequal
// l_undef -- don't know
lbool array_rewriter::compare_args(unsigned num_args, expr * const * args1, expr * const * args2) {
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
if (args1[i] == args2[i])
continue;
if (m().are_distinct(args1[i], args2[i]))
@ -367,7 +367,7 @@ br_status array_rewriter::mk_select_core(unsigned num_args, expr * const * args,
expr * v = to_app(args[0])->get_arg(num_args);
ptr_buffer<expr> eqs;
unsigned num_indices = num_args-1;
for (unsigned i = 0; i < num_indices; i++) {
for (unsigned i = 0; i < num_indices; ++i) {
eqs.push_back(m().mk_eq(to_app(args[0])->get_arg(i+1), args[i+1]));
}
if (num_indices == 1) {
@ -411,7 +411,7 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
app* store_expr = nullptr;
unsigned num_indices = 0;
bool same_store = true;
for (unsigned i = 0; same_store && i < num_args; i++) {
for (unsigned i = 0; same_store && i < num_args; ++i) {
expr* a = args[i];
if (m_util.is_const(a)) {
continue;
@ -424,7 +424,7 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
store_expr = to_app(a);
}
else {
for (unsigned j = 1; same_store && j < num_indices + 1; j++) {
for (unsigned j = 1; same_store && j < num_indices + 1; ++j) {
same_store = (store_expr->get_arg(j) == to_app(a)->get_arg(j));
}
}
@ -436,7 +436,7 @@ br_status array_rewriter::mk_map_core(func_decl * f, unsigned num_args, expr * c
if (same_store) {
ptr_buffer<expr> arrays;
ptr_buffer<expr> values;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr* a = args[i];
if (m_util.is_const(a)) {
arrays.push_back(a);

View file

@ -29,7 +29,7 @@ int & counter::get(unsigned el) {
}
counter & counter::count(unsigned sz, const unsigned * els, int delta) {
for(unsigned i = 0; i < sz; i++) {
for(unsigned i = 0; i < sz; ++i) {
update(els[i], delta);
}
return *this;
@ -77,7 +77,7 @@ int counter::get_max_counter_value() const {
void var_counter::count_vars(const app * pred, int coef) {
unsigned n = pred->get_num_args();
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
m_fv(pred->get_arg(i));
for (unsigned j = 0; j < m_fv.size(); ++j) {
if (m_fv[j]) {

View file

@ -152,7 +152,7 @@ struct blaster_rewriter_cfg : public default_rewriter_cfg {
}
else {
unsigned bv_size = butil().get_bv_size(t);
for (unsigned i = 0; i < bv_size; i++) {
for (unsigned i = 0; i < bv_size; ++i) {
parameter p(i);
out_bits.push_back(m().mk_app(butil().get_family_id(), OP_BIT2BOOL, 1, &p, 1, &t));
}
@ -226,7 +226,7 @@ struct blaster_rewriter_cfg : public default_rewriter_cfg {
unsigned bv_size = butil().get_bv_size(s);
sort * b = m().mk_bool_sort();
m_out.reset();
for (unsigned i = 0; i < bv_size; i++) {
for (unsigned i = 0; i < bv_size; ++i) {
m_out.push_back(m().mk_fresh_const(nullptr, b));
m_newbits.push_back(to_app(m_out.back())->get_decl());
}
@ -277,7 +277,7 @@ void OP(unsigned num_args, expr * const * args, expr_ref & result) { \
SASSERT(num_args > 0); \
result = args[0]; \
expr_ref new_result(m_manager); \
for (unsigned i = 1; i < num_args; i++) { \
for (unsigned i = 1; i < num_args; ++i) { \
BIN_OP(result.get(), args[i], new_result); \
result = new_result; \
} \
@ -369,7 +369,7 @@ MK_PARAMETRIC_UNARY_REDUCE(reduce_sign_extend, mk_sign_extend);
void blast_bv_term(expr * t, expr_ref & result, proof_ref & result_pr) {
ptr_buffer<expr> bits;
unsigned bv_size = butil().get_bv_size(t);
for (unsigned i = 0; i < bv_size; i++) {
for (unsigned i = 0; i < bv_size; ++i) {
parameter p(i);
bits.push_back(m().mk_app(butil().get_family_id(), OP_BIT2BOOL, 1, &p, 1, &t));
}
@ -553,7 +553,7 @@ MK_PARAMETRIC_UNARY_REDUCE(reduce_sign_extend, mk_sign_extend);
return BR_FAILED;
default:
TRACE(bit_blaster, tout << "non-supported operator: " << f->get_name() << "\n";
for (unsigned i = 0; i < num; i++) tout << mk_ismt2_pp(args[i], m()) << std::endl;);
for (unsigned i = 0; i < num; ++i) tout << mk_ismt2_pp(args[i], m()) << std::endl;);
{
expr_ref r(m().mk_app(f, num, args), m());
result = r;
@ -588,7 +588,7 @@ MK_PARAMETRIC_UNARY_REDUCE(reduce_sign_extend, mk_sign_extend);
if (butil().is_bv_sort(s)) {
unsigned bv_size = butil().get_bv_size(s);
new_args.reset();
for (unsigned k = 0; k < bv_size; k++) {
for (unsigned k = 0; k < bv_size; ++k) {
new_args.push_back(m().mk_var(j, m().mk_bool_sort()));
j++;
}
@ -660,12 +660,12 @@ MK_PARAMETRIC_UNARY_REDUCE(reduce_sign_extend, mk_sign_extend);
string_buffer<> name_buffer;
ptr_buffer<sort> new_decl_sorts;
sbuffer<symbol> new_decl_names;
for (unsigned i = 0; i < num_decls; i++) {
for (unsigned i = 0; i < num_decls; ++i) {
symbol const & n = old_q->get_decl_name(i);
sort * s = old_q->get_decl_sort(i);
if (butil().is_bv_sort(s)) {
unsigned bv_size = butil().get_bv_size(s);
for (unsigned j = 0; j < bv_size; j++) {
for (unsigned j = 0; j < bv_size; ++j) {
name_buffer.reset();
name_buffer << n << "." << j;
new_decl_names.push_back(symbol(name_buffer.c_str()));

View file

@ -38,7 +38,7 @@ void bit_blaster_tpl<Cfg>::checkpoint() {
*/
template<typename Cfg>
bool bit_blaster_tpl<Cfg>::is_numeral(unsigned sz, expr * const * bits) const {
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
if (!is_bool_const(bits[i]))
return false;
return true;
@ -51,7 +51,7 @@ bool bit_blaster_tpl<Cfg>::is_numeral(unsigned sz, expr * const * bits) const {
template<typename Cfg>
bool bit_blaster_tpl<Cfg>::is_numeral(unsigned sz, expr * const * bits, numeral & r) const {
r.reset();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (m().is_true(bits[i]))
r += power(i);
else if (!m().is_false(bits[i]))
@ -65,7 +65,7 @@ bool bit_blaster_tpl<Cfg>::is_numeral(unsigned sz, expr * const * bits, numeral
*/
template<typename Cfg>
bool bit_blaster_tpl<Cfg>::is_minus_one(unsigned sz, expr * const * bits) const {
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
if (!m().is_true(bits[i]))
return false;
return true;
@ -76,7 +76,7 @@ static void _num2bits(ast_manager & m, rational const & v, unsigned sz, expr_ref
SASSERT(v.is_nonneg());
rational aux = v;
rational two(2), base32(1ull << 32ull, rational::ui64());
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (i + 32 < sz) {
unsigned u = (aux % base32).get_unsigned();
for (unsigned j = 0; j < 32; ++j) {
@ -122,7 +122,7 @@ void bit_blaster_tpl<Cfg>::mk_neg(unsigned sz, expr * const * a_bits, expr_ref_v
SASSERT(sz > 0);
expr_ref cin(m()), cout(m()), out(m());
cin = m().mk_true();
for (unsigned idx = 0; idx < sz; idx++) {
for (unsigned idx = 0; idx < sz; ++idx) {
expr_ref not_a(m());
mk_not(a_bits[idx], not_a);
if (idx < sz - 1)
@ -139,7 +139,7 @@ void bit_blaster_tpl<Cfg>::mk_adder(unsigned sz, expr * const * a_bits, expr * c
SASSERT(sz > 0);
expr_ref cin(m()), cout(m()), out(m());
cin = m().mk_false();
for (unsigned idx = 0; idx < sz; idx++) {
for (unsigned idx = 0; idx < sz; ++idx) {
if (idx < sz - 1)
mk_full_adder(a_bits[idx], b_bits[idx], cin, out, cout);
else
@ -160,7 +160,7 @@ void bit_blaster_tpl<Cfg>::mk_subtracter(unsigned sz, expr * const * a_bits, exp
SASSERT(sz > 0);
expr_ref cin(m()), out(m());
cin = m().mk_true();
for (unsigned j = 0; j < sz; j++) {
for (unsigned j = 0; j < sz; ++j) {
expr_ref not_b(m());
mk_not(b_bits[j], not_b);
mk_full_adder(a_bits[j], not_b, cin, out, cout);
@ -237,7 +237,7 @@ void bit_blaster_tpl<Cfg>::mk_multiplier(unsigned sz, expr * const * a_bits, exp
FA denotes a full-adder.
*/
for (unsigned i = 1; i < sz; i++) {
for (unsigned i = 1; i < sz; ++i) {
checkpoint();
couts.reset();
expr_ref i1(m()), i2(m());
@ -246,7 +246,7 @@ void bit_blaster_tpl<Cfg>::mk_multiplier(unsigned sz, expr * const * a_bits, exp
if (i < sz - 1) {
mk_half_adder(i1, i2, out, cout);
couts.push_back(cout);
for (unsigned j = 2; j <= i; j++) {
for (unsigned j = 2; j <= i; ++j) {
expr_ref prev_out(m());
prev_out = out;
expr_ref i3(m());
@ -260,7 +260,7 @@ void bit_blaster_tpl<Cfg>::mk_multiplier(unsigned sz, expr * const * a_bits, exp
else {
// last step --> I don't need to generate/store couts.
mk_xor(i1, i2, out);
for (unsigned j = 2; j <= i; j++) {
for (unsigned j = 2; j <= i; ++j) {
expr_ref i3(m());
mk_and(a_bits[j], b_bits[i - j], i3);
mk_xor3(i3, out, cins.get(j - 2), out);
@ -390,12 +390,12 @@ void bit_blaster_tpl<Cfg>::mk_udiv_urem(unsigned sz, expr * const * a_bits, expr
// init p
p.push_back(a_bits[sz-1]);
for (unsigned i = 1; i < sz; i++)
for (unsigned i = 1; i < sz; ++i)
p.push_back(m().mk_false());
q_bits.resize(sz);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
checkpoint();
// generate p - b
expr_ref q(m());
@ -414,7 +414,7 @@ void bit_blaster_tpl<Cfg>::mk_udiv_urem(unsigned sz, expr * const * a_bits, expr
}
else {
// last step: p contains the remainder
for (unsigned j = 0; j < sz; j++) {
for (unsigned j = 0; j < sz; ++j) {
expr_ref ie(m());
mk_ite(q, t.get(j), p.get(j), ie);
p.set(j, ie);
@ -422,7 +422,7 @@ void bit_blaster_tpl<Cfg>::mk_udiv_urem(unsigned sz, expr * const * a_bits, expr
}
}
DEBUG_CODE({
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
SASSERT(q_bits.get(i) != 0);
}});
TRACE(bit_blaster,
@ -452,7 +452,7 @@ void bit_blaster_tpl<Cfg>::mk_urem(unsigned sz, expr * const * a_bits, expr * co
template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_multiplexer(expr * c, unsigned sz, expr * const * t_bits, expr * const * e_bits, expr_ref_vector & out_bits) {
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr_ref t(m());
mk_ite(c, t_bits[i], e_bits[i], t);
out_bits.push_back(t);
@ -768,7 +768,7 @@ void bit_blaster_tpl<Cfg>::mk_smod(unsigned sz, expr * const * a_bits, expr * co
template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_eq(unsigned sz, expr * const * a_bits, expr * const * b_bits, expr_ref & out) {
expr_ref_vector out_bits(m());
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
mk_iff(a_bits[i], b_bits[i], out);
out_bits.push_back(out);
}
@ -784,9 +784,9 @@ void bit_blaster_tpl<Cfg>::mk_rotate_left(unsigned sz, expr * const * a_bits, un
tout << "\n";
);
n = n % sz;
for (unsigned i = sz - n; i < sz; i++)
for (unsigned i = sz - n; i < sz; ++i)
out_bits.push_back(a_bits[i]);
for (unsigned i = 0 ; i < sz - n; i++)
for (unsigned i = 0 ; i < sz - n; ++i)
out_bits.push_back(a_bits[i]);
}
@ -798,19 +798,19 @@ void bit_blaster_tpl<Cfg>::mk_rotate_right(unsigned sz, expr * const * a_bits, u
template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_sign_extend(unsigned sz, expr * const * a_bits, unsigned n, expr_ref_vector & out_bits) {
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
out_bits.push_back(a_bits[i]);
expr * high_bit = a_bits[sz - 1];
for (unsigned i = sz; i < sz + n; i++)
for (unsigned i = sz; i < sz + n; ++i)
out_bits.push_back(high_bit);
}
template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_zero_extend(unsigned sz, expr * const * a_bits, unsigned n, expr_ref_vector & out_bits) {
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
out_bits.push_back(a_bits[i]);
expr * high_bit = m().mk_false();
for (unsigned i = sz; i < sz + n; i++)
for (unsigned i = sz; i < sz + n; ++i)
out_bits.push_back(high_bit);
}
@ -821,7 +821,7 @@ template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_is_eq(unsigned sz, expr * const * a_bits, unsigned n, expr_ref & out) {
numeral two(2);
expr_ref_vector out_bits(m());
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (n % 2 == 0) {
expr_ref not_a(m());
mk_not(a_bits[i], not_a);
@ -840,7 +840,7 @@ void bit_blaster_tpl<Cfg>::mk_is_eq(unsigned sz, expr * const * a_bits, unsigned
*/
template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_eqs(unsigned sz, expr * const * a_bits, expr_ref_vector & eqs) {
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr_ref eq(m());
mk_is_eq(sz, a_bits, i, eq);
eqs.push_back(eq);
@ -855,9 +855,9 @@ void bit_blaster_tpl<Cfg>::mk_shl(unsigned sz, expr * const * a_bits, expr * con
unsigned n = static_cast<unsigned>(k.get_int64());
if (n >= sz) n = sz;
unsigned pos;
for (pos = 0; pos < n; pos++)
for (pos = 0; pos < n; ++pos)
out_bits.push_back(m().mk_false());
for (unsigned i = 0; pos < sz; pos++, i++)
for (unsigned i = 0; pos < sz; ++pos, ++i)
out_bits.push_back(a_bits[i]);
}
else {
@ -900,9 +900,9 @@ void bit_blaster_tpl<Cfg>::mk_lshr(unsigned sz, expr * const * a_bits, expr * co
if (k > numeral(sz)) k = numeral(sz);
unsigned n = static_cast<unsigned>(k.get_int64());
unsigned pos = 0;
for (unsigned i = n; i < sz; pos++, i++)
for (unsigned i = n; i < sz; ++pos, ++i)
out_bits.push_back(a_bits[i]);
for (; pos < sz; pos++)
for (; pos < sz; ++pos)
out_bits.push_back(m().mk_false());
}
else {
@ -943,9 +943,9 @@ void bit_blaster_tpl<Cfg>::mk_ashr(unsigned sz, expr * const * a_bits, expr * co
if (k > numeral(sz)) k = numeral(sz);
unsigned n = static_cast<unsigned>(k.get_int64());
unsigned pos = 0;
for (unsigned i = n; i < sz; pos++, i++)
for (unsigned i = n; i < sz; ++pos, ++i)
out_bits.push_back(a_bits[i]);
for (; pos < sz; pos++)
for (; pos < sz; ++pos)
out_bits.push_back(a_bits[sz-1]);
}
else {
@ -1034,7 +1034,7 @@ void bit_blaster_tpl<Cfg>::mk_le(unsigned sz, expr * const * a_bits, expr * cons
expr_ref not_a(m());
mk_not(a_bits[0], not_a);
mk_or(not_a, b_bits[0], out);
for (unsigned idx = 1; idx < (Signed ? sz - 1 : sz); idx++) {
for (unsigned idx = 1; idx < (Signed ? sz - 1 : sz); ++idx) {
mk_not(a_bits[idx], not_a);
mk_ge2(not_a, b_bits[idx], out, out);
}
@ -1057,7 +1057,7 @@ void bit_blaster_tpl<Cfg>::mk_ule(unsigned sz, expr * const * a_bits, expr * con
template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_not(unsigned sz, expr * const * a_bits, expr_ref_vector & out_bits) {
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr_ref t(m());
mk_not(a_bits[i], t);
out_bits.push_back(t);
@ -1067,7 +1067,7 @@ void bit_blaster_tpl<Cfg>::mk_not(unsigned sz, expr * const * a_bits, expr_ref_v
#define MK_BINARY(NAME, OP) \
template<typename Cfg> \
void bit_blaster_tpl<Cfg>::NAME(unsigned sz, expr * const * a_bits, expr * const * b_bits, expr_ref_vector & out_bits) { \
for (unsigned i = 0; i < sz; i++) { \
for (unsigned i = 0; i < sz; ++i) { \
expr_ref t(m()); \
OP(a_bits[i], b_bits[i], t); \
out_bits.push_back(t); \
@ -1105,7 +1105,7 @@ void bit_blaster_tpl<Cfg>::mk_comp(unsigned sz, expr * const * a_bits, expr * co
template<typename Cfg>
void bit_blaster_tpl<Cfg>::mk_carry_save_adder(unsigned sz, expr * const * a_bits, expr * const * b_bits, expr * const * c_bits, expr_ref_vector & sum_bits, expr_ref_vector & carry_bits) {
expr_ref t(m());
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
mk_xor3(a_bits[i], b_bits[i], c_bits[i], t);
sum_bits.push_back(t);
mk_carry(a_bits[i], b_bits[i], c_bits[i], t);

View file

@ -76,7 +76,7 @@ br_status bool_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr * co
void bool_rewriter::mk_and_as_or(unsigned num_args, expr * const * args, expr_ref & result) {
expr_ref_buffer new_args(m());
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr_ref tmp(m());
mk_not(args[i], tmp);
new_args.push_back(tmp);
@ -93,7 +93,7 @@ br_status bool_rewriter::mk_nflat_and_core(unsigned num_args, expr * const * arg
expr_fast_mark2 pos_lits;
expr* atom = nullptr;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (m().is_true(arg)) {
s = true;
@ -156,7 +156,7 @@ br_status bool_rewriter::mk_nflat_and_core(unsigned num_args, expr * const * arg
br_status bool_rewriter::mk_flat_and_core(unsigned num_args, expr * const * args, expr_ref & result) {
unsigned i;
for (i = 0; i < num_args; i++) {
for (i = 0; i < num_args; ++i) {
if (m().is_and(args[i]))
break;
}
@ -164,7 +164,7 @@ br_status bool_rewriter::mk_flat_and_core(unsigned num_args, expr * const * args
// has nested ANDs
ptr_buffer<expr> flat_args;
flat_args.append(i, args);
for (; i < num_args; i++) {
for (; i < num_args; ++i) {
expr * arg = args[i];
// Remark: all rewrites are depth 1.
if (m().is_and(arg)) {
@ -188,7 +188,7 @@ br_status bool_rewriter::mk_nflat_or_core(unsigned num_args, expr * const * args
expr_fast_mark1 neg_lits;
expr_fast_mark2 pos_lits;
expr* prev = nullptr;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (m().is_true(arg)) {
neg_lits.reset();
@ -284,7 +284,7 @@ br_status bool_rewriter::mk_nflat_or_core(unsigned num_args, expr * const * args
br_status bool_rewriter::mk_flat_or_core(unsigned num_args, expr * const * args, expr_ref & result) {
unsigned i;
for (i = 0; i < num_args; i++) {
for (i = 0; i < num_args; ++i) {
if (m().is_or(args[i]))
break;
}
@ -294,7 +294,7 @@ br_status bool_rewriter::mk_flat_or_core(unsigned num_args, expr * const * args,
// has nested ORs
ptr_buffer<expr> flat_args;
flat_args.append(i, args);
for (; i < num_args; i++) {
for (; i < num_args; ++i) {
expr * arg = args[i];
// Remark: all rewrites are depth 1.
if (m().is_or(arg)) {
@ -339,7 +339,7 @@ bool bool_rewriter::simp_nested_not_or(unsigned num_args, expr * const * args,
ptr_buffer<expr> new_args;
bool simp = false;
m_local_ctx_cost += num_args;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (neg_lits.is_marked(arg)) {
result = m().mk_false();
@ -590,7 +590,7 @@ bool bool_rewriter::local_ctx_simp(unsigned num_args, expr * const * args, expr_
#endif
if (forward) {
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
PROCESS_ARG();
}
forward = false;
@ -868,7 +868,7 @@ br_status bool_rewriter::mk_distinct_core(unsigned num_args, expr * const * args
expr_fast_mark1 visited;
bool all_value = true, all_diff = true;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (visited.is_marked(arg)) {
result = m().mk_false();
@ -902,8 +902,8 @@ br_status bool_rewriter::mk_distinct_core(unsigned num_args, expr * const * args
if (m_blast_distinct && num_args < m_blast_distinct_threshold) {
expr_ref_vector new_diseqs(m());
for (unsigned i = 0; i < num_args; i++) {
for (unsigned j = i + 1; j < num_args; j++)
for (unsigned i = 0; i < num_args; ++i) {
for (unsigned j = i + 1; j < num_args; ++j)
new_diseqs.push_back(m().mk_not(m().mk_eq(args[i], args[j])));
}
result = m().mk_and(new_diseqs);

View file

@ -89,10 +89,10 @@ bool bv_elim_cfg::reduce_quantifier(quantifier * q,
new_body = subst(old_body, sub_size, sub);
for (unsigned j = 0; j < q->get_num_patterns(); j++) {
for (unsigned j = 0; j < q->get_num_patterns(); ++j) {
pats.push_back(subst(new_patterns[j], sub_size, sub));
}
for (unsigned j = 0; j < q->get_num_no_patterns(); j++) {
for (unsigned j = 0; j < q->get_num_no_patterns(); ++j) {
no_pats.push_back(subst(new_no_patterns[j], sub_size, sub));
}

View file

@ -685,7 +685,7 @@ unsigned bv_rewriter::propagate_extract(unsigned high, expr * arg, expr_ref & re
numeral val;
unsigned curr_first_sz = -1;
// calculate how much can be removed
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * const curr = a->get_arg(i);
const bool curr_is_conc = m_util.is_concat(curr);
if (curr_is_conc && to_app(curr)->get_num_args() == 0) continue;
@ -709,7 +709,7 @@ unsigned bv_rewriter::propagate_extract(unsigned high, expr * arg, expr_ref & re
SASSERT(removable <= to_remove);
ptr_buffer<expr> new_args;
ptr_buffer<expr> new_concat_args;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * const curr = a->get_arg(i);
const bool curr_is_conc = m_util.is_concat(curr);
if (curr_is_conc && to_app(curr)->get_num_args() == 0) continue;
@ -785,7 +785,7 @@ br_status bv_rewriter::mk_extract(unsigned high, unsigned low, expr * arg, expr_
if (m_util.is_concat(arg)) {
unsigned num = to_app(arg)->get_num_args();
unsigned idx = sz;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * curr = to_app(arg)->get_arg(i);
unsigned curr_sz = get_bv_size(curr);
idx -= curr_sz;
@ -814,7 +814,7 @@ br_status bv_rewriter::mk_extract(unsigned high, unsigned low, expr * arg, expr_
used_extract = true;
new_args.push_back(m_mk_extract(high - idx, 0, curr));
}
for (unsigned j = i + 1; j < num; j++) {
for (unsigned j = i + 1; j < num; ++j) {
curr = to_app(arg)->get_arg(j);
unsigned curr_sz = get_bv_size(curr);
idx -= curr_sz;
@ -844,7 +844,7 @@ br_status bv_rewriter::mk_extract(unsigned high, unsigned low, expr * arg, expr_
m_util.is_bv_mul(arg)))) {
ptr_buffer<expr> new_args;
unsigned num = to_app(arg)->get_num_args();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * curr = to_app(arg)->get_arg(i);
new_args.push_back(m_mk_extract(high, low, curr));
}
@ -1095,7 +1095,7 @@ br_status bv_rewriter::mk_bv_ashr(expr * arg1, expr * arg2, expr_ref & result) {
SASSERT(r2 <= numeral(bv_size));
unsigned k = r2.get_unsigned();
expr * sign = m_mk_extract(bv_size-1, bv_size-1, arg1);
for (unsigned i = 0; i < k; i++)
for (unsigned i = 0; i < k; ++i)
new_args.push_back(sign);
if (k != bv_size)
new_args.push_back(m_mk_extract(bv_size-1, k, arg1));
@ -1643,7 +1643,7 @@ br_status bv_rewriter::mk_concat(unsigned num_args, expr * const * args, expr_re
bool expanded = false;
bool fused_extract = false;
bool eq_args = true;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
expr * prev = nullptr;
if (i > 0) {
@ -1741,7 +1741,7 @@ br_status bv_rewriter::mk_sign_extend(unsigned n, expr * arg, expr_ref & result)
unsigned sz = get_bv_size(arg);
expr * sign = m_mk_extract(sz-1, sz-1, arg);
ptr_buffer<expr> args;
for (unsigned i = 0; i < n; i++)
for (unsigned i = 0; i < n; ++i)
args.push_back(sign);
args.push_back(arg);
result = m_util.mk_concat(args.size(), args.data());
@ -1757,7 +1757,7 @@ br_status bv_rewriter::mk_repeat(unsigned n, expr * arg, expr_ref & result) {
return BR_DONE;
}
ptr_buffer<expr> args;
for (unsigned i = 0; i < n; i++)
for (unsigned i = 0; i < n; ++i)
args.push_back(arg);
result = m_util.mk_concat(args.size(), args.data());
return BR_REWRITE1;
@ -1773,11 +1773,11 @@ br_status bv_rewriter::mk_bv_or(unsigned num, expr * const * args, expr_ref & re
bool flattened = false;
ptr_buffer<expr> flat_args;
if (m_flat) {
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * arg = args[i];
if (m_util.is_bv_or(arg)) {
unsigned num2 = to_app(arg)->get_num_args();
for (unsigned j = 0; j < num2; j++)
for (unsigned j = 0; j < num2; ++j)
flat_args.push_back(to_app(arg)->get_arg(j));
}
else {
@ -1797,7 +1797,7 @@ br_status bv_rewriter::mk_bv_or(unsigned num, expr * const * args, expr_ref & re
bool merged = false;
unsigned num_coeffs = 0;
numeral v1, v2;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * arg = args[i];
if (is_numeral(arg, v2, sz)) {
num_coeffs++;
@ -1846,7 +1846,7 @@ br_status bv_rewriter::mk_bv_or(unsigned num, expr * const * args, expr_ref & re
app * concat1 = to_app(new_args[0]);
app * concat2 = to_app(new_args[1]);
unsigned i = 0;
for (i = 0; i < sz; i++)
for (i = 0; i < sz; ++i)
if (!is_zero_bit(concat1, i) && !is_zero_bit(concat2, i))
break;
if (i == sz) {
@ -1945,11 +1945,11 @@ br_status bv_rewriter::mk_bv_xor(unsigned num, expr * const * args, expr_ref & r
bool flattened = false;
ptr_buffer<expr> flat_args;
if (m_flat) {
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * arg = args[i];
if (m_util.is_bv_xor(arg)) {
unsigned num2 = to_app(arg)->get_num_args();
for (unsigned j = 0; j < num2; j++)
for (unsigned j = 0; j < num2; ++j)
flat_args.push_back(to_app(arg)->get_arg(j));
}
else {
@ -1968,7 +1968,7 @@ br_status bv_rewriter::mk_bv_xor(unsigned num, expr * const * args, expr_ref & r
bool merged = false;
numeral v1, v2;
unsigned num_coeffs = 0;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * arg = args[i];
if (is_numeral(arg, v2, sz)) {
v1 = bitwise_xor(v1, v2);
@ -2017,7 +2017,7 @@ br_status bv_rewriter::mk_bv_xor(unsigned num, expr * const * args, expr_ref & r
if (!v1.is_zero() && num_coeffs == num - 1) {
// find argument that is not a numeral
expr * t = nullptr;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
t = args[i];
if (!is_numeral(t))
break;
@ -2070,7 +2070,7 @@ br_status bv_rewriter::mk_bv_xor(unsigned num, expr * const * args, expr_ref & r
new_args.push_back(c);
}
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * arg = args[i];
if (is_numeral(arg))
continue;
@ -2200,7 +2200,7 @@ br_status bv_rewriter::mk_bv_not(expr * arg, expr_ref & result) {
br_status bv_rewriter::mk_bv_and(unsigned num, expr * const * args, expr_ref & result) {
ptr_buffer<expr> new_args;
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]));
}
SASSERT(num == new_args.size());
@ -2210,7 +2210,7 @@ br_status bv_rewriter::mk_bv_and(unsigned num, expr * const * args, expr_ref & r
br_status bv_rewriter::mk_bv_nand(unsigned num, expr * const * args, expr_ref & result) {
ptr_buffer<expr> new_args;
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]));
}
result = m_util.mk_bv_or(new_args.size(), new_args.data());
@ -2369,7 +2369,7 @@ br_status bv_rewriter::mk_bv_add(unsigned num_args, expr * const * args, expr_re
unsigned sz = get_bv_size(x);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (!is_zero_bit(x,i) && !is_zero_bit(y,i))
return st;
}
@ -2393,9 +2393,9 @@ br_status bv_rewriter::mk_bv_add(unsigned num_args, expr * const * args, expr_re
if (_num_args < 2)
return st;
unsigned sz = get_bv_size(_args[0]);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
bool found_non_zero = false;
for (unsigned j = 0; j < _num_args; j++) {
for (unsigned j = 0; j < _num_args; ++j) {
if (!is_zero_bit(_args[j], i)) {
// at most one of the arguments may have a non-zero bit.
if (found_non_zero)
@ -2616,7 +2616,7 @@ br_status bv_rewriter::mk_blast_eq_value(expr * lhs, expr * rhs, expr_ref & resu
numeral two(2);
ptr_buffer<expr> new_args;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
bool bit0 = (v % two).is_zero();
new_args.push_back(m.mk_eq(m_mk_extract(i,i, lhs),
mk_numeral(bit0 ? 0 : 1, 1)));
@ -2979,7 +2979,7 @@ br_status bv_rewriter::mk_eq_core(expr * lhs, expr * rhs, expr_ref & result) {
br_status bv_rewriter::mk_mkbv(unsigned num, expr * const * args, expr_ref & result) {
if (m_mkbv2num) {
unsigned i;
for (i = 0; i < num; i++)
for (i = 0; i < num; ++i)
if (!m.is_true(args[i]) && !m.is_false(args[i]))
return BR_FAILED;
numeral val;

View file

@ -24,7 +24,7 @@ bool cached_var_subst::key_eq_proc::operator()(cached_var_subst::key * k1, cache
return false;
if (k1->m_num_bindings != k2->m_num_bindings)
return false;
for (unsigned i = 0; i < k1->m_num_bindings; i++)
for (unsigned i = 0; i < k1->m_num_bindings; ++i)
if (k1->m_bindings[i] != k2->m_bindings[i])
return false;
return true;
@ -66,7 +66,7 @@ expr_ref cached_var_subst::operator()() {
m_new_keys[num_bindings] = m_key; // recycle key
result = entry->get_data().m_value;
SCTRACE(bindings, is_trace_enabled(TraceTag::coming_from_quant), tout << "(cache)\n";
for (unsigned i = 0; i < num_bindings; i++)
for (unsigned i = 0; i < num_bindings; ++i)
if (m_key->m_bindings[i])
tout << i << ": " << mk_ismt2_pp(m_key->m_bindings[i], result.m()) << ";\n";
tout.flush(););
@ -92,7 +92,7 @@ expr_ref cached_var_subst::operator()() {
// increment reference counters
m_refs.push_back(m_key->m_qa);
for (unsigned i = 0; i < m_key->m_num_bindings; i++)
for (unsigned i = 0; i < m_key->m_num_bindings; ++i)
m_refs.push_back(m_key->m_bindings[i]);
m_refs.push_back(result);
return result;

View file

@ -198,7 +198,7 @@ void der::reduce1(quantifier * q, expr_ref & r, proof_ref & pr) {
m_pos2var.reserve(num_args, -1);
// Find all equalities/disequalities
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr* arg = literals.get(i);
is_eq = is_forall(q) ? is_var_diseq(arg, num_decls, v, t) : is_var_eq(arg, num_decls, v, t);
if (is_eq) {
@ -243,7 +243,7 @@ static void der_sort_vars(ptr_vector<var> & vars, expr_ref_vector & definitions,
// eliminate self loops, and definitions containing quantifiers.
bool found = false;
for (unsigned i = 0; i < definitions.size(); i++) {
for (unsigned i = 0; i < definitions.size(); ++i) {
var * v = vars[i];
expr * t = definitions.get(i);
if (t == nullptr || has_quantifiers(t) || occurs(v, t))
@ -263,7 +263,7 @@ static void der_sort_vars(ptr_vector<var> & vars, expr_ref_vector & definitions,
unsigned vidx, num;
for (unsigned i = 0; i < definitions.size(); i++) {
for (unsigned i = 0; i < definitions.size(); ++i) {
if (!definitions.get(i))
continue;
var * v = vars[i];
@ -362,7 +362,7 @@ void der::create_substitution(unsigned sz) {
m_subst_map.reset();
m_subst_map.resize(sz, nullptr);
for(unsigned i = 0; i < m_order.size(); i++) {
for(unsigned i = 0; i < m_order.size(); ++i) {
expr_ref cur(m_map.get(m_order[i]), m);
// do all the previous substitutions before inserting
@ -379,7 +379,7 @@ void der::apply_substitution(quantifier * q, expr_ref_vector& literals, bool is_
// get a new expression
m_new_args.reset();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
int x = m_pos2var[i];
if (x != -1 && m_map.get(x) != nullptr)
continue; // this is a disequality with definition (vanishes)
@ -393,11 +393,11 @@ void der::apply_substitution(quantifier * q, expr_ref_vector& literals, bool is_
// don't forget to update the quantifier patterns
expr_ref_buffer new_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.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.data()));
}

View file

@ -120,7 +120,7 @@ void distribute_forall::reduce1_quantifier(quantifier * q) {
app * or_e = to_app(to_app(e)->get_arg(0));
unsigned num_args = or_e->get_num_args();
expr_ref_buffer new_args(m_manager);
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = or_e->get_arg(i);
expr_ref not_arg(m_manager);
br.mk_not(arg, not_arg);

View file

@ -151,14 +151,14 @@ bool elim_bounds_cfg::reduce_quantifier(quantifier * q,
}
}
}
TRACE(elim_bounds, tout << "candidates:\n"; for (unsigned i = 0; i < candidates.size(); i++) tout << mk_pp(candidates[i], m) << "\n";);
TRACE(elim_bounds, tout << "candidates:\n"; for (unsigned i = 0; i < candidates.size(); ++i) tout << mk_pp(candidates[i], m) << "\n";);
// remove candidates that have lower and upper bounds
for (var * v : candidates) {
if (lowers.contains(v) && uppers.contains(v))
candidate_set.erase(v);
}
TRACE(elim_bounds, tout << "candidates after filter:\n"; for (unsigned i = 0; i < candidates.size(); i++) tout << mk_pp(candidates[i], m) << "\n";);
TRACE(elim_bounds, tout << "candidates after filter:\n"; for (unsigned i = 0; i < candidates.size(); ++i) tout << mk_pp(candidates[i], m) << "\n";);
if (candidate_set.empty()) {
return false;
}

View file

@ -53,7 +53,7 @@ bool simplify_inj_axiom(ast_manager & m, quantifier * q, expr_ref & result) {
unsigned num = f1->get_num_args();
unsigned idx = UINT_MAX;
unsigned num_vars = 1;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * c1 = f1->get_arg(i);
expr * c2 = f2->get_arg(i);
if (!is_var(c1) && !is_uninterp_const(c1))
@ -86,7 +86,7 @@ bool simplify_inj_axiom(ast_manager & m, quantifier * q, expr_ref & result) {
buffer<symbol> names;
expr * var = nullptr;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
expr * c = f1->get_arg(i);
if (is_var(c)) {
names.push_back(symbol(i));

View file

@ -56,11 +56,11 @@ struct macro_replacer::macro_replacer_cfg : public default_rewriter_cfg {
proof_ref& result_pr) {
bool erase_patterns = false;
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_patterns(); i++)
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_patterns(); ++i)
if (old_q->get_pattern(i) != new_patterns[i])
erase_patterns = true;
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_no_patterns(); i++)
for (unsigned i = 0; !erase_patterns && i < old_q->get_num_no_patterns(); ++i)
if (old_q->get_no_pattern(i) != new_no_patterns[i])
erase_patterns = true;
@ -86,7 +86,7 @@ struct macro_replacer::macro_replacer_cfg : public default_rewriter_cfg {
unsigned num = head->get_num_args();
ptr_buffer<expr> subst_args;
subst_args.resize(num, 0);
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
var* v = to_var(head->get_arg(i));
VERIFY(v->get_idx() < num);
unsigned nidx = num - v->get_idx() - 1;

View file

@ -38,7 +38,7 @@ br_status maximize_ac_sharing::reduce_app(func_decl * f, unsigned num_args, expr
expr * numeral = nullptr;
if (is_numeral(args[0])) {
numeral = args[0];
for (unsigned i = 1; i < num_args; i++)
for (unsigned i = 1; i < num_args; ++i)
_args.push_back(args[i]);
num_args--;
}
@ -51,16 +51,16 @@ br_status maximize_ac_sharing::reduce_app(func_decl * f, unsigned num_args, expr
#define MAX_NUM_ARGS_FOR_OPT 128
// Try to reuse already created circuits.
TRACE(ac_sharing_detail, tout << "args: "; for (unsigned i = 0; i < num_args; i++) tout << mk_pp(_args[i], m) << "\n";);
TRACE(ac_sharing_detail, tout << "args: "; for (unsigned i = 0; i < num_args; ++i) tout << mk_pp(_args[i], m) << "\n";);
try_to_reuse:
if (num_args > 1 && num_args < MAX_NUM_ARGS_FOR_OPT) {
for (unsigned i = 0; i + 1 < num_args; i++) {
for (unsigned j = i + 1; j < num_args; j++) {
for (unsigned i = 0; i + 1 < num_args; ++i) {
for (unsigned j = i + 1; j < num_args; ++j) {
if (contains(f, _args[i], _args[j])) {
TRACE(ac_sharing_detail, tout << "reusing args: " << i << " " << j << "\n";);
_args[i] = m.mk_app(f, _args[i], _args[j]);
SASSERT(num_args > 1);
for (unsigned w = j; w + 1 < num_args; w++) {
for (unsigned w = j; w + 1 < num_args; ++w) {
_args[w] = _args[w+1];
}
num_args--;
@ -75,7 +75,7 @@ br_status maximize_ac_sharing::reduce_app(func_decl * f, unsigned num_args, expr
while (true) {
TRACE(ac_sharing_detail, tout << "tree-loop: num_args: " << num_args << "\n";);
unsigned j = 0;
for (unsigned i = 0; i < num_args; i += 2, j++) {
for (unsigned i = 0; i < num_args; i += 2, ++j) {
if (i == num_args - 1) {
_args[j] = _args[i];
}

View file

@ -98,7 +98,7 @@ expr * poly_rewriter<Config>::mk_mul_app(unsigned num_args, expr * const * args)
new_args.push_back(this->mk_power(prev, k_prev, s));
};
for (unsigned i = 1; i < num_args; i++) {
for (unsigned i = 1; i < num_args; ++i) {
expr * arg = get_power_body(args[i], k);
if (arg == prev) {
k_prev += k;
@ -154,7 +154,7 @@ br_status poly_rewriter<Config>::mk_flat_mul_core(unsigned num_args, expr * cons
// - (* c (* x_1 ... x_n))
if (num_args != 2 || !is_numeral(args[0]) || (is_mul(args[1]) && is_numeral(to_app(args[1])->get_arg(0)))) {
unsigned i;
for (i = 0; i < num_args; i++) {
for (i = 0; i < num_args; ++i) {
if (is_mul(args[i]))
break;
}
@ -164,7 +164,7 @@ br_status poly_rewriter<Config>::mk_flat_mul_core(unsigned num_args, expr * cons
// we need the todo buffer to handle: (* (* c (* x_1 ... x_n)) (* d (* y_1 ... y_n)))
ptr_buffer<expr> todo;
flat_args.append(i, args);
for (unsigned j = i; j < num_args; j++) {
for (unsigned j = i; j < num_args; ++j) {
if (is_mul(args[j])) {
todo.push_back(args[j]);
while (!todo.empty()) {
@ -189,9 +189,9 @@ br_status poly_rewriter<Config>::mk_flat_mul_core(unsigned num_args, expr * cons
br_status st = mk_nflat_mul_core(flat_args.size(), flat_args.data(), result);
TRACE(poly_rewriter,
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";
tout << "---->\n";
for (unsigned i = 0; i < flat_args.size(); i++) tout << mk_bounded_pp(flat_args[i], M()) << "\n";
for (unsigned i = 0; i < flat_args.size(); ++i) tout << mk_bounded_pp(flat_args[i], M()) << "\n";
tout << st << "\n";
);
if (st == BR_FAILED) {
@ -218,7 +218,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
unsigned num_coeffs = 0;
unsigned num_add = 0;
expr * var = nullptr;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (is_numeral(arg, a)) {
num_coeffs++;
@ -288,7 +288,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
// (* c_1 ... c_n (+ t_1 ... t_m)) --> (+ (* c_1*...*c_n t_1) ... (* c_1*...*c_n t_m))
ptr_buffer<expr> new_add_args;
unsigned num = to_app(var)->get_num_args();
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)));
}
result = mk_add_app(new_add_args.size(), new_add_args.data());
@ -315,7 +315,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
ptr_buffer<expr> new_args;
expr * prev = nullptr;
bool ordered = true;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * curr = args[i];
if (is_numeral(curr))
continue;
@ -325,7 +325,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
prev = curr;
}
TRACE(poly_rewriter,
for (unsigned i = 0; i < new_args.size(); i++) {
for (unsigned i = 0; i < new_args.size(); ++i) {
if (i > 0)
tout << (lt(new_args[i-1], new_args[i]) ? " < " : " !< ");
tout << mk_ismt2_pp(new_args[i], M());
@ -337,7 +337,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
std::sort(new_args.begin(), new_args.end(), lt);
TRACE(poly_rewriter,
tout << "after sorting:\n";
for (unsigned i = 0; i < new_args.size(); i++) {
for (unsigned i = 0; i < new_args.size(); ++i) {
if (i > 0)
tout << (lt(new_args[i-1], new_args[i]) ? " < " : " !< ");
tout << mk_ismt2_pp(new_args[i], M());
@ -377,13 +377,13 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
ptr_buffer<expr> m_args;
TRACE(som, tout << "starting soM()...\n";);
do {
TRACE(som, for (unsigned i = 0; i < it.size(); i++) tout << it[i] << " ";
TRACE(som, for (unsigned i = 0; i < it.size(); ++i) tout << it[i] << " ";
tout << "\n";);
if (sum.size() > m_som_blowup * orig_size) {
return BR_FAILED;
}
m_args.reset();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * const * v = sums[i];
expr * arg = v[it[i]];
m_args.push_back(arg);
@ -398,7 +398,7 @@ br_status poly_rewriter<Config>::mk_nflat_mul_core(unsigned num_args, expr * con
template<typename Config>
br_status poly_rewriter<Config>::mk_flat_add_core(unsigned num_args, expr * const * args, expr_ref & result) {
unsigned i;
for (i = 0; i < num_args; i++) {
for (i = 0; i < num_args; ++i) {
if (is_add(args[i]))
break;
}
@ -406,12 +406,12 @@ br_status poly_rewriter<Config>::mk_flat_add_core(unsigned num_args, expr * cons
// has nested ADDs
ptr_buffer<expr> flat_args;
flat_args.append(i, args);
for (; i < num_args; i++) {
for (; i < num_args; ++i) {
expr * arg = args[i];
// Remark: all rewrites are depth 1.
if (is_add(arg)) {
unsigned num = to_app(arg)->get_num_args();
for (unsigned j = 0; j < num; j++)
for (unsigned j = 0; j < num; ++j)
flat_args.push_back(to_app(arg)->get_arg(j));
}
else {
@ -538,7 +538,7 @@ br_status poly_rewriter<Config>::mk_nflat_add_core(unsigned num_args, expr * con
bool has_multiple = false;
expr * prev = nullptr;
bool ordered = true;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (is_numeral(arg, a)) {
@ -566,14 +566,14 @@ br_status poly_rewriter<Config>::mk_nflat_add_core(unsigned num_args, expr * con
SASSERT(m_sort_sums || ordered);
TRACE(rewriter,
tout << "ordered: " << ordered << " sort sums: " << m_sort_sums << "\n";
for (unsigned i = 0; i < num_args; i++) tout << mk_ismt2_pp(args[i], M()) << "\n";);
for (unsigned i = 0; i < num_args; ++i) tout << mk_ismt2_pp(args[i], M()) << "\n";);
if (has_multiple) {
// expensive case
buffer<numeral> coeffs;
m_expr2pos.reset();
// compute the coefficient of power products that occur multiple times.
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (is_numeral(arg))
continue;
@ -595,7 +595,7 @@ br_status poly_rewriter<Config>::mk_nflat_add_core(unsigned num_args, expr * con
}
// copy power products with non zero coefficients to new_args
visited.reset();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (is_numeral(arg))
continue;
@ -642,7 +642,7 @@ br_status poly_rewriter<Config>::mk_nflat_add_core(unsigned num_args, expr * con
expr_ref_buffer new_args(M());
if (!c.is_zero())
new_args.push_back(mk_numeral(c));
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = args[i];
if (is_numeral(arg))
continue;
@ -693,7 +693,7 @@ br_status poly_rewriter<Config>::mk_sub(unsigned num_args, expr * const * args,
expr_ref minus_one(mk_numeral(numeral(-1)), M());
expr_ref_buffer new_args(M());
new_args.push_back(args[0]);
for (unsigned i = 1; i < num_args; i++) {
for (unsigned i = 1; i < num_args; ++i) {
if (is_zero(args[i])) continue;
expr * aux_args[2] = { minus_one, args[i] };
new_args.push_back(mk_mul_app(2, aux_args));
@ -724,7 +724,7 @@ br_status poly_rewriter<Config>::cancel_monomials(expr * lhs, expr * rhs, bool m
numeral a;
unsigned num_coeffs = 0;
for (unsigned i = 0; i < lhs_sz; i++) {
for (unsigned i = 0; i < lhs_sz; ++i) {
expr * arg = lhs_monomials[i];
if (is_numeral(arg, a)) {
c += a;
@ -739,7 +739,7 @@ br_status poly_rewriter<Config>::cancel_monomials(expr * lhs, expr * rhs, bool m
return BR_FAILED;
}
for (unsigned i = 0; i < rhs_sz; i++) {
for (unsigned i = 0; i < rhs_sz; ++i) {
expr * arg = rhs_monomials[i];
if (is_numeral(arg, a)) {
c -= a;
@ -771,7 +771,7 @@ br_status poly_rewriter<Config>::cancel_monomials(expr * lhs, expr * rhs, bool m
buffer<numeral> coeffs;
m_expr2pos.reset();
for (unsigned i = 0; i < lhs_sz; i++) {
for (unsigned i = 0; i < lhs_sz; ++i) {
expr * arg = lhs_monomials[i];
if (is_numeral(arg))
continue;
@ -788,7 +788,7 @@ br_status poly_rewriter<Config>::cancel_monomials(expr * lhs, expr * rhs, bool m
}
}
for (unsigned i = 0; i < rhs_sz; i++) {
for (unsigned i = 0; i < rhs_sz; ++i) {
expr * arg = rhs_monomials[i];
if (is_numeral(arg))
continue;
@ -806,7 +806,7 @@ br_status poly_rewriter<Config>::cancel_monomials(expr * lhs, expr * rhs, bool m
new_lhs_monomials.push_back(0); // save space for coefficient if needed
// copy power products with non zero coefficients to new_lhs_monomials
visited.reset();
for (unsigned i = 0; i < lhs_sz; i++) {
for (unsigned i = 0; i < lhs_sz; ++i) {
expr * arg = lhs_monomials[i];
if (is_numeral(arg))
continue;
@ -827,7 +827,7 @@ br_status poly_rewriter<Config>::cancel_monomials(expr * lhs, expr * rhs, bool m
ptr_buffer<expr> new_rhs_monomials;
new_rhs_monomials.push_back(0); // save space for coefficient if needed
for (unsigned i = 0; i < rhs_sz; i++) {
for (unsigned i = 0; i < rhs_sz; ++i) {
expr * arg = rhs_monomials[i];
if (is_numeral(arg))
continue;

View file

@ -23,7 +23,7 @@ Revision History:
static int has_ite_arg(ast_manager& m, unsigned num_args, expr * const * args) {
for (unsigned i = 0; i < num_args; i++)
for (unsigned i = 0; i < num_args; ++i)
if (m.is_ite(args[i]))
return i;
return -1;
@ -37,7 +37,7 @@ bool push_app_ite_cfg::is_target(func_decl * decl, unsigned num_args, expr * con
if (m.is_ite(decl))
return false;
bool found_ite = false;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
if (m.is_ite(args[i]) && !m.is_bool(args[i])) {
if (found_ite) {
if (m_conservative)
@ -51,7 +51,7 @@ bool push_app_ite_cfg::is_target(func_decl * decl, unsigned num_args, expr * con
CTRACE(push_app_ite, found_ite, tout << "found target for push app ite:\n";
tout << "conservative " << m_conservative << "\n";
tout << decl->get_name();
for (unsigned i = 0; i < num_args; i++) tout << " " << mk_pp(args[i], m);
for (unsigned i = 0; i < num_args; ++i) tout << " " << mk_pp(args[i], m);
tout << "\n";);
return found_ite;
}
@ -86,7 +86,7 @@ bool ng_push_app_ite_cfg::is_target(func_decl * decl, unsigned num_args, expr *
bool r = push_app_ite_cfg::is_target(decl, num_args, args);
if (!r)
return false;
for (unsigned i = 0; i < num_args; i++)
for (unsigned i = 0; i < num_args; ++i)
if (!is_ground(args[i]))
return true;
return false;

View file

@ -151,14 +151,14 @@ bool rewriter_core::is_child_of_top_frame(expr * t) const {
switch (parent->get_kind()) {
case AST_APP:
num = to_app(parent)->get_num_args();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
if (to_app(parent)->get_arg(i) == t)
return true;
}
return false;
case AST_QUANTIFIER:
num = to_quantifier(parent)->get_num_children();
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
if (to_quantifier(parent)->get_child(i) == t)
return true;
}
@ -177,7 +177,7 @@ void rewriter_core::elim_reflex_prs(unsigned spos) {
unsigned sz = m_result_pr_stack.size();
SASSERT(spos <= sz);
unsigned j = spos;
for (unsigned i = spos; i < sz; i++) {
for (unsigned i = spos; i < sz; ++i) {
proof * pr = m_result_pr_stack.get(i);
if (pr != nullptr) {
if (i != j)

View file

@ -427,7 +427,7 @@ void rewriter_tpl<Config>::process_app(app * t, frame & fr) {
fr.m_state = EXPAND_DEF;
TRACE(get_macro, tout << "f: " << f->get_name() << ", def: \n" << mk_ismt2_pp(def, m()) << "\n";
tout << "Args num: " << num_args << "\n";
for (unsigned i = 0; i < num_args; i++) tout << mk_ismt2_pp(new_args[i], m()) << "\n";);
for (unsigned i = 0; i < num_args; ++i) tout << mk_ismt2_pp(new_args[i], m()) << "\n";);
unsigned sz = m_bindings.size();
unsigned i = num_args;
while (i > 0) {
@ -535,7 +535,7 @@ void rewriter_tpl<Config>::process_quantifier(quantifier * q, frame & fr) {
begin_scope();
m_root = q->get_expr();
unsigned sz = m_bindings.size();
for (unsigned i = 0; i < num_decls; i++) {
for (unsigned i = 0; i < num_decls; ++i) {
m_bindings.push_back(nullptr);
m_shifts.push_back(sz);
}
@ -561,13 +561,13 @@ void rewriter_tpl<Config>::process_quantifier(quantifier * q, frame & fr) {
expr * const * np = it + 1;
expr * const * nnp = np + num_pats;
unsigned j = 0;
for (unsigned i = 0; i < num_pats; i++)
for (unsigned i = 0; i < num_pats; ++i)
if (m_manager.is_pattern(np[i]))
new_pats[j++] = np[i];
new_pats.shrink(j);
num_pats = j;
j = 0;
for (unsigned i = 0; i < num_no_pats; i++)
for (unsigned i = 0; i < num_no_pats; ++i)
if (m_manager.is_pattern(nnp[i]))
new_no_pats[j++] = nnp[i];
new_no_pats.shrink(j);
@ -662,7 +662,7 @@ void rewriter_tpl<Config>::cleanup() {
template<typename Config>
void rewriter_tpl<Config>::display_bindings(std::ostream& out) {
for (unsigned i = 0; i < m_bindings.size(); i++) {
for (unsigned i = 0; i < m_bindings.size(); ++i) {
if (m_bindings[i])
out << i << ": " << mk_ismt2_pp(m_bindings[i], m()) << ";\n";
}
@ -690,7 +690,7 @@ void rewriter_tpl<Config>::set_inv_bindings(unsigned num_bindings, expr * const
SASSERT(not_rewriting());
m_bindings.reset();
m_shifts.reset();
for (unsigned i = 0; i < num_bindings; i++) {
for (unsigned i = 0; i < num_bindings; ++i) {
m_bindings.push_back(bindings[i]);
m_shifts.push_back(num_bindings);
}

View file

@ -4335,7 +4335,7 @@ br_status seq_rewriter::mk_str_in_regexp(expr* a, expr* b, expr_ref& result) {
if (str().is_string(a, s) && re().is_ground(b)) {
// Just check membership and replace by true/false
expr_ref r(b, m());
for (unsigned i = 0; i < s.length(); i++) {
for (unsigned i = 0; i < s.length(); ++i) {
if (re().is_empty(r)) {
result = m().mk_false();
return BR_DONE;

View file

@ -457,11 +457,11 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
new_t2 = nullptr;
expr_fast_mark1 visited1;
expr_fast_mark2 visited2;
for (unsigned i = 0; i < num1; i++) {
for (unsigned i = 0; i < num1; ++i) {
expr * arg = ms1[i];
visited1.mark(arg);
}
for (unsigned i = 0; i < num2; i++) {
for (unsigned i = 0; i < num2; ++i) {
expr * arg = ms2[i];
visited2.mark(arg);
if (visited1.is_marked(arg))
@ -470,7 +470,7 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
return false; // more than one missing term
new_t2 = arg;
}
for (unsigned i = 0; i < num1; i++) {
for (unsigned i = 0; i < num1; ++i) {
expr * arg = ms1[i];
if (visited2.is_marked(arg))
continue;
@ -486,7 +486,7 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
new_t2 = m_a_util.mk_numeral(rational::zero(), is_int);
// mk common part
ptr_buffer<expr> args;
for (unsigned i = 0; i < num1; i++) {
for (unsigned i = 0; i < num1; ++i) {
expr * arg = ms1[i];
if (arg == new_t1.get())
continue;
@ -635,7 +635,7 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
if (st != BR_DONE && st != BR_FAILED) {
CTRACE(th_rewriter_step, st != BR_FAILED,
tout << f->get_name() << "\n";
for (unsigned i = 0; i < num; i++) tout << mk_ismt2_pp(args[i], m()) << "\n";
for (unsigned i = 0; i < num; ++i) tout << mk_ismt2_pp(args[i], m()) << "\n";
tout << "---------->\n" << mk_ismt2_pp(result, m()) << "\n";);
return st;
}
@ -657,7 +657,7 @@ struct th_rewriter_cfg : public default_rewriter_cfg {
CTRACE(th_rewriter_step, st != BR_FAILED,
tout << f->get_name() << "\n";
for (unsigned i = 0; i < num; i++) tout << mk_ismt2_pp(args[i], m()) << "\n";
for (unsigned i = 0; i < num; ++i) tout << mk_ismt2_pp(args[i], m()) << "\n";
tout << "---------->\n" << mk_ismt2_pp(result, m()) << "\n";);
return st;
}

View file

@ -33,7 +33,7 @@ expr_ref var_subst::operator()(expr * n, unsigned num_args, expr * const * args)
//There is no need to print the bindings here?
SCTRACE(bindings, is_trace_enabled(TraceTag::coming_from_quant),
tout << "(ground)\n";
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
if (args[i]) {
tout << i << ": " << mk_ismt2_pp(args[i], result.m()) << ";\n";
}
@ -80,7 +80,7 @@ expr_ref var_subst::operator()(expr * n, unsigned num_args, expr * const * args)
SASSERT(is_well_sorted(m, result));
TRACE(var_subst_bug,
tout << "m_std_order: " << m_std_order << "\n" << mk_ismt2_pp(n, m) << "\nusing\n";
for (unsigned i = 0; i < num_args; i++) tout << mk_ismt2_pp(args[i], m) << "\n";
for (unsigned i = 0; i < num_args; ++i) tout << mk_ismt2_pp(args[i], m) << "\n";
tout << "\n------>\n";
tout << result << "\n";);
return result;
@ -114,10 +114,10 @@ expr_ref unused_vars_eliminator::operator()(quantifier* q) {
m_used.set_num_decls(num_decls);
m_used.process(q->get_expr());
unsigned num_patterns = q->get_num_patterns();
for (unsigned i = 0; i < num_patterns; i++)
for (unsigned i = 0; i < num_patterns; ++i)
m_used.process(q->get_pattern(i));
unsigned num_no_patterns = q->get_num_no_patterns();
for (unsigned i = 0; i < num_no_patterns; i++)
for (unsigned i = 0; i < num_no_patterns; ++i)
m_used.process(q->get_no_pattern(i));
@ -154,7 +154,7 @@ expr_ref unused_vars_eliminator::operator()(quantifier* q) {
}
// (VAR 0) is in the first position of var_mapping.
for (unsigned i = num_decls; i < sz; i++) {
for (unsigned i = num_decls; i < sz; ++i) {
sort * s = m_used.contains(i);
if (s)
var_mapping.push_back(m.mk_var(i - num_removed, s));
@ -180,10 +180,10 @@ expr_ref unused_vars_eliminator::operator()(quantifier* q) {
expr_ref_buffer new_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.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.data()));
}
@ -220,7 +220,7 @@ expr_ref instantiate(ast_manager & m, quantifier * q, expr * const * exprs) {
shift(new_expr, q->get_num_decls(), result);
SASSERT(is_well_sorted(m, result));
TRACE(instantiate_bug, tout << mk_ismt2_pp(q, m) << "\nusing\n";
for (unsigned i = 0; i < q->get_num_decls(); i++) tout << mk_ismt2_pp(exprs[i], m) << "\n";
for (unsigned i = 0; i < q->get_num_decls(); ++i) tout << mk_ismt2_pp(exprs[i], m) << "\n";
tout << "\n----->\n" << mk_ismt2_pp(result, m) << "\n";);
return result;
}

View file

@ -1291,7 +1291,7 @@ bool seq_util::rex::pp::print_seq(std::ostream& out, expr* s) const {
print(out, e);
}
else if (re.u.str.is_string(s, z)) {
for (unsigned i = 0; i < z.length(); i++)
for (unsigned i = 0; i < z.length(); ++i)
out << (char)z[i];
}
else if (re.u.str.is_at(s, x, i))

View file

@ -189,7 +189,7 @@ void bound_propagator::init_eq(linear_equation * eq) {
new_c.m_counter = 0;
new_c.m_eq = eq;
unsigned sz = eq->size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
m_watches[eq->x(i)].push_back(c_idx);
}
if (propagate(c_idx) && scope_lvl() > 0)
@ -248,7 +248,7 @@ void bound_propagator::pop(unsigned num_scopes) {
unsigned i = reinit_stack_sz;
unsigned j = reinit_stack_sz;
unsigned sz = m_reinit_stack.size();
for (; i < sz; i++) {
for (; i < sz; ++i) {
unsigned c_idx = m_reinit_stack[i];
bool p = propagate(c_idx);
if (new_lvl > 0 && p) {
@ -520,7 +520,7 @@ bool bound_propagator::propagate_eq(unsigned c_idx) {
double ll = 0.0;
double uu = 0.0;
unsigned sz = eq->size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x_i = eq->x(i);
double a_i = eq->approx_a(i);
bound * l_i = m_lowers[x_i];
@ -583,7 +583,7 @@ bool bound_propagator::propagate_eq(unsigned c_idx) {
SASSERT(!ll_failed || !uu_failed);
if (ll_i == UINT_MAX || uu_i == UINT_MAX) {
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x_i = eq->x(i);
double a_i = eq->approx_a(i);
bound * l_i = m_lowers[x_i];
@ -672,7 +672,7 @@ bool bound_propagator::propagate_lower(unsigned c_idx, unsigned i) {
mpq k;
bool strict = false;
bool neg_a_i = m.is_neg(a_i);
for (unsigned j = 0; j < sz; j++) {
for (unsigned j = 0; j < sz; ++j) {
if (i == j)
continue;
var x_j = eq->x(j);
@ -709,7 +709,7 @@ bool bound_propagator::propagate_upper(unsigned c_idx, unsigned i) {
mpq k;
bool strict = false;
bool neg_a_i = m.is_neg(a_i);
for (unsigned j = 0; j < sz; j++) {
for (unsigned j = 0; j < sz; ++j) {
if (i == j)
continue;
var x_j = eq->x(j);
@ -821,7 +821,7 @@ void bound_propagator::explain(var x, bound * b, unsigned ts, assumption_vector
if (!is_a_i_pos(*eq, x))
is_lower = !is_lower;
unsigned sz = eq->size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x_i = eq->x(i);
if (x_i == x)
continue;
@ -854,7 +854,7 @@ template<bool LOWER, typename Numeral>
bool bound_propagator::get_bound(unsigned sz, Numeral const * as, var const * xs, mpq & r, bool & st) const {
st = false;
m.reset(r);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x_i = xs[i];
Numeral const & a_i = as[i];
if (m.is_zero(a_i))
@ -880,7 +880,7 @@ bool bound_propagator::upper(unsigned sz, mpq const * as, var const * xs, mpq &
}
void bound_propagator::display_bounds_of(std::ostream & out, linear_equation const & eq) const {
for (unsigned i = 0; i < eq.size(); i++) {
for (unsigned i = 0; i < eq.size(); ++i) {
display_var_bounds(out, eq.x(i));
out << "\n";
}
@ -916,7 +916,7 @@ void bound_propagator::display_var_bounds(std::ostream & out, var x, bool approx
void bound_propagator::display_bounds(std::ostream & out, bool approx, bool precise) const {
unsigned num_vars = m_dead.size();
for (unsigned x = 0; x < num_vars; x++) {
for (unsigned x = 0; x < num_vars; ++x) {
if (!is_dead(x)) {
display_var_bounds(out, x, approx, precise);
out << "\n";

View file

@ -489,7 +489,7 @@ void bound_simplifier::restore_bounds() {
m_fmls.add(dependent_expr(m, tmp, nullptr, nullptr));
};
for (unsigned x = 0; x < sz; x++) {
for (unsigned x = 0; x < sz; ++x) {
expr* p = m_var2expr.get(x);
has_l = bp.lower(x, l, strict_l, ts);
has_u = bp.upper(x, u, strict_u, ts);
@ -641,7 +641,7 @@ void find_ite_bounds(expr* root) {
void find_ite_bounds() {
unsigned sz = m_new_goal->size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr* f = m_new_goal->form(i);
if (m.is_ite(f))
find_ite_bounds(to_app(f));

View file

@ -18,7 +18,7 @@ Author:
unsigned dependent_expr_state::num_exprs() {
expr_fast_mark1 visited;
unsigned r = 0;
for (unsigned i = 0; i < qtail(); i++)
for (unsigned i = 0; i < qtail(); ++i)
r += get_num_exprs((*this)[i].fml(), visited);
return r;
}

View file

@ -322,7 +322,7 @@ void eliminate_predicates::insert_macro(app* head, expr* def, expr_dependency* d
ptr_buffer<expr> vars, subst_args;
subst_args.resize(num, nullptr);
vars.resize(num, nullptr);
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
var* v = to_var(head->get_arg(i));
var* w = m.mk_var(i, v->get_sort());
unsigned idx = v->get_idx();

View file

@ -48,7 +48,7 @@ unsigned linear_equation::pos(unsigned x_i) const {
void linear_equation_manager::display(std::ostream & out, linear_equation const & eq) const {
unsigned sz = eq.m_size;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
if (i > 0)
out << " + ";
out << m.to_string(eq.m_as[i]) << "*x" << eq.m_xs[i];
@ -63,7 +63,7 @@ linear_equation * linear_equation_manager::mk(unsigned sz, mpq * as, var * xs, b
mpz l;
mpz r;
m.set(l, as[0].denominator());
for (unsigned i = 1; i < sz; i++) {
for (unsigned i = 1; i < sz; ++i) {
m.set(r, as[i].denominator());
m.lcm(r, l, l);
}
@ -72,7 +72,7 @@ linear_equation * linear_equation_manager::mk(unsigned sz, mpq * as, var * xs, b
// copy l * as to m_int_buffer.
m_int_buffer.reset();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
TRACE(linear_equation_mk, tout << "before as[" << i << "]: " << m.to_string(as[i]) << "\n";);
m.mul(l, as[i], as[i]);
TRACE(linear_equation_mk, tout << "after as[" << i << "]: " << m.to_string(as[i]) << "\n";);
@ -91,16 +91,16 @@ linear_equation * linear_equation_manager::mk(unsigned sz, mpq * as, var * xs, b
linear_equation * linear_equation_manager::mk_core(unsigned sz, mpz * as, var * xs) {
SASSERT(sz > 0);
DEBUG_CODE({
for (unsigned i = 1; i < sz; i++) {
for (unsigned i = 1; i < sz; ++i) {
SASSERT(xs[i-1] < xs[i]);
}
});
TRACE(linear_equation_bug, for (unsigned i = 0; i < sz; i++) tout << m.to_string(as[i]) << "*x" << xs[i] << " "; tout << "\n";);
TRACE(linear_equation_bug, for (unsigned i = 0; i < sz; ++i) tout << m.to_string(as[i]) << "*x" << xs[i] << " "; tout << "\n";);
mpz g;
m.set(g, as[0]);
for (unsigned i = 1; i < sz; i++) {
for (unsigned i = 1; i < sz; ++i) {
if (m.is_one(g))
break;
if (m.is_neg(as[i])) {
@ -113,14 +113,14 @@ linear_equation * linear_equation_manager::mk_core(unsigned sz, mpz * as, var *
}
}
if (!m.is_one(g)) {
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
m.div(as[i], g, as[i]);
}
}
TRACE(linear_equation_bug,
tout << "g: " << m.to_string(g) << "\n";
for (unsigned i = 0; i < sz; i++) tout << m.to_string(as[i]) << "*x" << xs[i] << " "; tout << "\n";);
for (unsigned i = 0; i < sz; ++i) tout << m.to_string(as[i]) << "*x" << xs[i] << " "; tout << "\n";);
m.del(g);
@ -130,7 +130,7 @@ linear_equation * linear_equation_manager::mk_core(unsigned sz, mpz * as, var *
mpz * new_as = reinterpret_cast<mpz*>(reinterpret_cast<char*>(new_eq) + sizeof(linear_equation));
double * new_app_as = reinterpret_cast<double*>(reinterpret_cast<char*>(new_as) + sz * sizeof(mpz));
var * new_xs = reinterpret_cast<var *>(reinterpret_cast<char*>(new_app_as) + sz * sizeof(double));
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
new (new_as + i) mpz();
m.set(new_as[i], as[i]);
new_app_as[i] = m.get_double(as[i]);
@ -146,7 +146,7 @@ linear_equation * linear_equation_manager::mk_core(unsigned sz, mpz * as, var *
linear_equation * linear_equation_manager::mk(unsigned sz, mpz * as, var * xs, bool normalized) {
if (!normalized) {
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x = xs[i];
m_mark.reserve(x+1, false);
m_val_buffer.reserve(x+1);
@ -161,7 +161,7 @@ linear_equation * linear_equation_manager::mk(unsigned sz, mpz * as, var * xs, b
}
unsigned j = 0;
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x = xs[i];
if (m_mark[x]) {
if (!m.is_zero(m_val_buffer[x])) {
@ -178,26 +178,26 @@ linear_equation * linear_equation_manager::mk(unsigned sz, mpz * as, var * xs, b
}
else {
DEBUG_CODE({
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x = xs[i];
m_mark.reserve(x+1, false);
SASSERT(!m_mark[x]);
m_mark[x] = true;
}
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x = xs[i];
m_mark[x] = false;
}
});
}
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x = xs[i];
m_val_buffer.reserve(x+1);
m.swap(m_val_buffer[x], as[i]);
}
std::sort(xs, xs+sz);
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
var x = xs[i];
m.swap(as[i], m_val_buffer[x]);
}
@ -270,7 +270,7 @@ linear_equation * linear_equation_manager::mk(mpz const & b1, linear_equation co
}
void linear_equation_manager::del(linear_equation * eq) {
for (unsigned i = 0; i < eq->m_size; i++) {
for (unsigned i = 0; i < eq->m_size; ++i) {
m.del(eq->m_as[i]);
}
unsigned obj_sz = linear_equation::get_obj_size(eq->m_size);

View file

@ -213,7 +213,7 @@ class reduce_args_simplifier : public dependent_expr_simplifier {
// compute the hash-code using only the arguments where m_bv is true.
unsigned a = 0x9e3779b9;
unsigned num_args = n->get_num_args();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
if (!m_bv.get(i))
continue; // ignore argument
a = hash_u_u(a, n->get_arg(i)->get_id());
@ -230,7 +230,7 @@ class reduce_args_simplifier : public dependent_expr_simplifier {
// compare only the arguments where m_bv is true
SASSERT(n1->get_num_args() == n2->get_num_args());
unsigned num_args = n1->get_num_args();
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
if (!m_bv.get(i))
continue; // ignore argument
if (n1->get_arg(i) != n2->get_arg(i))
@ -306,7 +306,7 @@ class reduce_args_simplifier : public dependent_expr_simplifier {
}
ptr_buffer<expr> new_args;
for (unsigned i = 0; i < num; i++) {
for (unsigned i = 0; i < num; ++i) {
if (!bv.get(i))
new_args.push_back(args[i]);
}
@ -339,7 +339,7 @@ class reduce_args_simplifier : public dependent_expr_simplifier {
bit_vector & bv = decl2args.find(f);
new_vars.reset();
new_args.reset();
for (unsigned i = 0; i < f->get_arity(); i++) {
for (unsigned i = 0; i < f->get_arity(); ++i) {
new_vars.push_back(m.mk_var(i, f->get_domain(i)));
if (!bv.get(i))
new_args.push_back(new_vars.back());
@ -352,7 +352,7 @@ class reduce_args_simplifier : public dependent_expr_simplifier {
}
else {
new_eqs.reset();
for (unsigned i = 0; i < f->get_arity(); i++)
for (unsigned i = 0; i < f->get_arity(); ++i)
if (bv.get(i))
new_eqs.push_back(m.mk_eq(new_vars.get(i), t->get_arg(i)));
SASSERT(new_eqs.size() > 0);

View file

@ -41,7 +41,7 @@ bvsls_opt_engine::optimization_result bvsls_opt_engine::optimize(
if (initial_model.get() != nullptr) {
TRACE(sls_opt, tout << "Initial model provided: " << std::endl;
for (unsigned i = 0; i < initial_model->get_num_constants(); i++) {
for (unsigned i = 0; i < initial_model->get_num_constants(); ++i) {
func_decl * fd = initial_model->get_constant(i);
expr * val = initial_model->get_const_interp(fd);
tout << fd->get_name() << " := " << mk_ismt2_pp(val, m()) << std::endl;
@ -57,7 +57,7 @@ bvsls_opt_engine::optimization_result bvsls_opt_engine::optimize(
for (m_stats.m_restarts = 0;
m_stats.m_restarts < m_max_restarts;
m_stats.m_restarts++)
++m_stats.m_restarts)
{
mpz old_best;
m_mpz_manager.set(old_best, m_best_model_score);
@ -178,7 +178,7 @@ void bvsls_opt_engine::save_model(mpz const & score) {
model_ref mdl = m_hard_tracker.get_model();
model_ref obj_mdl = m_obj_tracker.get_model();
for (unsigned i = 0; i < obj_mdl->get_num_constants(); i++) {
for (unsigned i = 0; i < obj_mdl->get_num_constants(); ++i) {
func_decl * fd = obj_mdl->get_constant(i);
expr * val = obj_mdl->get_const_interp(fd);
if (mdl->has_interpretation(fd)) {
@ -252,14 +252,14 @@ mpz bvsls_opt_engine::find_best_move(
mpz new_score;
m_mpz_manager.set(new_score, score);
for (unsigned i = 0; i < to_evaluate.size() && m_mpz_manager.lt(new_score, max_score); i++) {
for (unsigned i = 0; i < to_evaluate.size() && m_mpz_manager.lt(new_score, max_score); ++i) {
func_decl * fd = to_evaluate[i];
sort * srt = fd->get_range();
bv_sz = (m_manager.is_bool(srt)) ? 1 : m_bv_util.get_bv_size(srt);
m_mpz_manager.set(old_value, m_obj_tracker.get_value(fd));
// first try to flip every bit
for (unsigned j = 0; j < bv_sz && m_mpz_manager.lt(new_score, max_score); j++) {
for (unsigned j = 0; j < bv_sz && m_mpz_manager.lt(new_score, max_score); ++j) {
// What would happen if we flipped bit #i ?
mk_flip(srt, old_value, j, temp);

View file

@ -59,7 +59,7 @@ protected:
obj_hashtable<expr> const & top_exprs = m_obj_tracker.get_top_exprs();
for (obj_hashtable<expr>::iterator it = top_exprs.begin();
it != top_exprs.end();
it++)
++it)
m_mpz_manager.add(res, m_obj_tracker.get_value(*it), res);
return res;
}

View file

@ -269,7 +269,7 @@ void sls_engine::mk_random_move(ptr_vector<func_decl> & unsat_constants)
}
TRACE(sls, tout << "Randomization candidates: ";
for (unsigned i = 0; i < unsat_constants.size(); i++)
for (unsigned i = 0; i < unsat_constants.size(); ++i)
tout << unsat_constants[i]->get_name() << ", ";
tout << std::endl;
tout << "Random move: ";
@ -302,17 +302,17 @@ double sls_engine::find_best_move(
// Andreas: Introducting a bit of randomization by using a random offset and a random direction to go through the candidate list.
unsigned sz = to_evaluate.size();
unsigned offset = (m_random_offset) ? m_tracker.get_random_uint(16) % sz : 0;
for (unsigned j = 0; j < sz; j++) {
for (unsigned j = 0; j < sz; ++j) {
unsigned i = j + offset;
if (i >= sz) i -= sz;
//for (unsigned i = 0; i < to_evaluate.size(); i++) {
//for (unsigned i = 0; i < to_evaluate.size(); ++i) {
func_decl * fd = to_evaluate[i];
sort * srt = fd->get_range();
bv_sz = (m_manager.is_bool(srt)) ? 1 : m_bv_util.get_bv_size(srt);
m_mpz_manager.set(old_value, m_tracker.get_value(fd));
// first try to flip every bit
for (unsigned j = 0; j < bv_sz; j++) {
for (unsigned j = 0; j < bv_sz; ++j) {
// What would happen if we flipped bit #i ?
mk_flip(srt, old_value, j, temp);
@ -360,19 +360,19 @@ double sls_engine::find_best_move_mc(ptr_vector<func_decl> & to_evaluate, double
// Andreas: Introducting a bit of randomization by using a random offset and a random direction to go through the candidate list.
unsigned sz = to_evaluate.size();
unsigned offset = (m_random_offset) ? m_tracker.get_random_uint(16) % sz : 0;
for (unsigned j = 0; j < sz; j++) {
for (unsigned j = 0; j < sz; ++j) {
unsigned i = j + offset;
if (i >= sz) i -= sz;
//for (unsigned i = 0; i < to_evaluate.size(); i++) {
//for (unsigned i = 0; i < to_evaluate.size(); ++i) {
func_decl * fd = to_evaluate[i];
sort * srt = fd->get_range();
bv_sz = (m_manager.is_bool(srt)) ? 1 : m_bv_util.get_bv_size(srt);
m_mpz_manager.set(old_value, m_tracker.get_value(fd));
if (m_bv_util.is_bv_sort(srt) && bv_sz > 2) {
for (unsigned j = 0; j < bv_sz; j++) {
for (unsigned j = 0; j < bv_sz; ++j) {
mk_flip(srt, old_value, j, temp);
for (unsigned l = 0; l < m_vns_mc && l < bv_sz / 2; l++)
for (unsigned l = 0; l < m_vns_mc && l < bv_sz / 2; ++l)
{
unsigned k = m_tracker.get_random_uint(16) % bv_sz;
while (k == j)

View file

@ -76,7 +76,7 @@ public:
switch (n->get_decl_kind()) {
case OP_AND: {
m_mpz_manager.set(result, m_one);
for (unsigned i = 0; i < n_args; i++)
for (unsigned i = 0; i < n_args; ++i)
if (m_mpz_manager.neq(m_tracker.get_value(args[i]), result)) {
m_mpz_manager.set(result, m_zero);
break;
@ -84,7 +84,7 @@ public:
break;
}
case OP_OR: {
for (unsigned i = 0; i < n_args; i++)
for (unsigned i = 0; i < n_args; ++i)
if (m_mpz_manager.neq(m_tracker.get_value(args[i]), result)) {
m_mpz_manager.set(result, m_one);
break;
@ -102,7 +102,7 @@ public:
SASSERT(n_args >= 2);
m_mpz_manager.set(result, m_one);
const mpz & first = m_tracker.get_value(args[0]);
for (unsigned i = 1; i < n_args; i++)
for (unsigned i = 1; i < n_args; ++i)
if (m_mpz_manager.neq(m_tracker.get_value(args[i]), first)) {
m_mpz_manager.set(result, m_zero);
break;
@ -111,8 +111,8 @@ public:
}
case OP_DISTINCT: {
m_mpz_manager.set(result, m_one);
for (unsigned i = 0; i < n_args && m_mpz_manager.is_one(result); i++) {
for (unsigned j = i+1; j < n_args && m_mpz_manager.is_one(result); j++) {
for (unsigned i = 0; i < n_args && m_mpz_manager.is_one(result); ++i) {
for (unsigned j = i+1; j < n_args && m_mpz_manager.is_one(result); ++j) {
if (m_mpz_manager.eq(m_tracker.get_value(args[i]), m_tracker.get_value(args[j])))
m_mpz_manager.set(result, m_zero);
}
@ -136,7 +136,7 @@ public:
switch(k) {
case OP_CONCAT: {
SASSERT(n_args >= 2);
for (unsigned i = 0; i < n_args; i++) {
for (unsigned i = 0; i < n_args; ++i) {
if (i != 0) {
const mpz & p = m_powers(m_bv_util.get_bv_size(args[i]));
m_mpz_manager.mul(result, p, result);
@ -157,7 +157,7 @@ public:
}
case OP_BADD: {
SASSERT(n_args >= 2);
for (unsigned i = 0; i < n_args; i++) {
for (unsigned i = 0; i < n_args; ++i) {
const mpz & next = m_tracker.get_value(args[i]);
m_mpz_manager.add(result, next, result);
}
@ -177,7 +177,7 @@ public:
case OP_BMUL: {
SASSERT(n_args >= 2);
m_mpz_manager.set(result, m_tracker.get_value(args[0]));
for (unsigned i = 1; i < n_args; i++) {
for (unsigned i = 1; i < n_args; ++i) {
const mpz & next = m_tracker.get_value(args[i]);
m_mpz_manager.mul(result, next, result);
}
@ -341,14 +341,14 @@ public:
case OP_BAND: {
SASSERT(n_args >= 2);
m_mpz_manager.set(result, m_tracker.get_value(args[0]));
for (unsigned i = 1; i < n_args; i++)
for (unsigned i = 1; i < n_args; ++i)
m_mpz_manager.bitwise_and(result, m_tracker.get_value(args[i]), result);
break;
}
case OP_BOR: {
SASSERT(n_args >= 2);
m_mpz_manager.set(result, m_tracker.get_value(args[0]));
for (unsigned i = 1; i < n_args; i++) {
for (unsigned i = 1; i < n_args; ++i) {
m_mpz_manager.bitwise_or(result, m_tracker.get_value(args[i]), result);
}
break;
@ -356,7 +356,7 @@ public:
case OP_BXOR: {
SASSERT(n_args >= 2);
m_mpz_manager.set(result, m_tracker.get_value(args[0]));
for (unsigned i = 1; i < n_args; i++)
for (unsigned i = 1; i < n_args; ++i)
m_mpz_manager.bitwise_xor(result, m_tracker.get_value(args[i]), result);
break;
}
@ -365,7 +365,7 @@ public:
mpz temp;
unsigned bv_sz = m_bv_util.get_bv_size(n);
m_mpz_manager.set(result, m_tracker.get_value(args[0]));
for (unsigned i = 1; i < n_args; i++) {
for (unsigned i = 1; i < n_args; ++i) {
m_mpz_manager.bitwise_and(result, m_tracker.get_value(args[i]), temp);
m_mpz_manager.bitwise_not(bv_sz, temp, result);
}
@ -377,7 +377,7 @@ public:
mpz temp;
unsigned bv_sz = m_bv_util.get_bv_size(n);
m_mpz_manager.set(result, m_tracker.get_value(args[0]));
for (unsigned i = 1; i < n_args; i++) {
for (unsigned i = 1; i < n_args; ++i) {
m_mpz_manager.bitwise_or(result, m_tracker.get_value(args[i]), temp);
m_mpz_manager.bitwise_not(bv_sz, temp, result);
}
@ -495,7 +495,7 @@ public:
}
TRACE(sls_eval, tout << "(" << fd->get_name();
for (unsigned i = 0; i < n_args; i++)
for (unsigned i = 0; i < n_args; ++i)
tout << " " << m_mpz_manager.to_string(m_tracker.get_value(args[i]));
tout << ") ---> " << m_mpz_manager.to_string(result);
if (m_manager.is_bool(fd->get_range())) tout << " [Boolean]";
@ -513,7 +513,7 @@ public:
unsigned n_args = a->get_num_args();
m_temp_exprs.reset();
for (unsigned i = 0; i < n_args; i++) {
for (unsigned i = 0; i < n_args; ++i) {
expr * arg = a->get_arg(i);
const mpz & v = m_tracker.get_value(arg);
m_temp_exprs.push_back(m_tracker.mpz2value(arg->get_sort(), v));
@ -549,7 +549,7 @@ public:
while (cur_depth != static_cast<unsigned>(-1)) {
ptr_vector<expr> & cur_depth_exprs = m_traversal_stack[cur_depth];
for (unsigned i = 0; i < cur_depth_exprs.size(); i++) {
for (unsigned i = 0; i < cur_depth_exprs.size(); ++i) {
expr * cur = cur_depth_exprs[i];
(*this)(to_app(cur), new_value);
@ -570,7 +570,7 @@ public:
if (m_tracker.has_uplinks(cur)) {
ptr_vector<expr> & ups = m_tracker.get_uplinks(cur);
for (unsigned j = 0; j < ups.size(); j++) {
for (unsigned j = 0; j < ups.size(); ++j) {
expr * next = ups[j];
unsigned next_d = m_tracker.get_distance(next);
SASSERT(next_d < cur_depth);
@ -600,7 +600,7 @@ public:
while (cur_depth != static_cast<unsigned>(-1)) {
ptr_vector<expr> & cur_depth_exprs = m_traversal_stack[cur_depth];
for (unsigned i = 0; i < cur_depth_exprs.size(); i++) {
for (unsigned i = 0; i < cur_depth_exprs.size(); ++i) {
expr * cur = cur_depth_exprs[i];
(*this)(to_app(cur), new_value);
@ -611,7 +611,7 @@ public:
m_tracker.set_score(cur, new_score);
if (m_tracker.has_uplinks(cur)) {
ptr_vector<expr> & ups = m_tracker.get_uplinks(cur);
for (unsigned j = 0; j < ups.size(); j++) {
for (unsigned j = 0; j < ups.size(); ++j) {
expr * next = ups[j];
unsigned next_d = m_tracker.get_distance(next);
SASSERT(next_d < cur_depth);
@ -672,7 +672,7 @@ public:
ptr_vector<expr> & cur_depth_exprs = m_traversal_stack_bool[cur_depth];
for (unsigned i = 0; i < cur_depth_exprs.size(); i++) {
for (unsigned i = 0; i < cur_depth_exprs.size(); ++i) {
expr * cur = cur_depth_exprs[i];
new_score = m_tracker.score(cur);
@ -689,7 +689,7 @@ public:
if (m_tracker.has_uplinks(cur)) {
ptr_vector<expr> & ups = m_tracker.get_uplinks(cur);
for (unsigned j = 0; j < ups.size(); j++) {
for (unsigned j = 0; j < ups.size(); ++j) {
expr * next = ups[j];
unsigned next_d = m_tracker.get_distance(next);
SASSERT(next_d < cur_depth);
@ -709,7 +709,7 @@ public:
if (pot_benefits)
{
unsigned cur_size = cur_depth_exprs.size();
for (unsigned i = 0; i < cur_size; i++) {
for (unsigned i = 0; i < cur_size; ++i) {
expr * cur = cur_depth_exprs[i];
new_score = m_tracker.score(cur);
@ -719,7 +719,7 @@ public:
if (m_tracker.has_uplinks(cur)) {
ptr_vector<expr> & ups = m_tracker.get_uplinks(cur);
for (unsigned j = 0; j < ups.size(); j++) {
for (unsigned j = 0; j < ups.size(); ++j) {
expr * next = ups[j];
unsigned next_d = m_tracker.get_distance(next);
SASSERT(next_d < cur_depth);
@ -748,7 +748,7 @@ public:
while (cur_depth != static_cast<unsigned>(-1)) {
ptr_vector<expr> & cur_depth_exprs = m_traversal_stack[cur_depth];
for (unsigned i = 0; i < cur_depth_exprs.size(); i++) {
for (unsigned i = 0; i < cur_depth_exprs.size(); ++i) {
expr * cur = cur_depth_exprs[i];
(*this)(to_app(cur), new_value);
@ -756,7 +756,7 @@ public:
// Andreas: Should actually always have uplinks ...
if (m_tracker.has_uplinks(cur)) {
ptr_vector<expr> & ups = m_tracker.get_uplinks(cur);
for (unsigned j = 0; j < ups.size(); j++) {
for (unsigned j = 0; j < ups.size(); ++j) {
expr * next = ups[j];
unsigned next_d = m_tracker.get_distance(next);
SASSERT(next_d < cur_depth);

View file

@ -155,12 +155,12 @@ public:
double sum = 0.0;
unsigned count = 0;
for (unsigned i = 0; i < g->size(); i++)
for (unsigned i = 0; i < g->size(); ++i)
{
m_temp_constants.reset();
ptr_vector<func_decl> const & this_decls = m_constants_occ.find(g->form(i));
unsigned sz = this_decls.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
func_decl * fd = this_decls[i];
m_temp_constants.push_back(fd);
sort * srt = fd->get_range();
@ -294,7 +294,7 @@ public:
expr * e;
unsigned touched_old, touched_new;
for (unsigned i = 0; i < as.size(); i++)
for (unsigned i = 0; i < as.size(); ++i)
{
e = as[i];
touched_old = m_scores.find(e).touched;
@ -380,7 +380,7 @@ public:
// precondition: m_scores is set up.
unsigned sz = as.size();
ptr_vector<app> stack;
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
stack.push_back(to_app(as[i]));
while (!stack.empty()) {
app * cur = stack.back();
@ -388,7 +388,7 @@ public:
unsigned d = get_distance(cur);
for (unsigned i = 0; i < cur->get_num_args(); i++) {
for (unsigned i = 0; i < cur->get_num_args(); ++i) {
app * child = to_app(cur->get_arg(i));
unsigned d_child = get_distance(child);
if (d >= d_child) {
@ -406,7 +406,7 @@ public:
app * a = to_app(e);
expr * const * args = a->get_args();
unsigned int sz = a->get_num_args();
for (unsigned int i = 0; i < sz; i++) {
for (unsigned int i = 0; i < sz; ++i) {
expr * q = args[i];
initialize_recursive(proc, visited, q);
}
@ -419,7 +419,7 @@ public:
app * a = to_app(e);
expr * const * args = a->get_args();
unsigned int sz = a->get_num_args();
for (unsigned int i = 0; i < sz; i++) {
for (unsigned int i = 0; i < sz; ++i) {
expr * q = args[i];
initialize_recursive(q);
}
@ -458,7 +458,7 @@ public:
if (m_track_unsat)
{
m_list_false = new expr*[sz];
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
{
if (m_mpz_manager.eq(get_value(as[i]), m_zero))
break_assertion(as[i]);
@ -529,14 +529,14 @@ public:
void show_model(std::ostream & out) {
unsigned sz = get_num_constants();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
func_decl * fd = get_constant(i);
out << fd->get_name() << " = " << m_mpz_manager.to_string(get_value(fd)) << std::endl;
}
}
void set_model(model_ref const & mdl) {
for (unsigned i = 0; i < mdl->get_num_constants(); i++) {
for (unsigned i = 0; i < mdl->get_num_constants(); ++i) {
func_decl * fd = mdl->get_constant(i);
expr * val = mdl->get_const_interp(fd);
if (m_entry_points.contains(fd)) {
@ -560,7 +560,7 @@ public:
model_ref get_model() {
model_ref res = alloc(model, m_manager);
unsigned sz = get_num_constants();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
func_decl * fd = get_constant(i);
res->register_decl(fd, mpz2value(fd->get_range(), get_value(fd)));
}
@ -648,7 +648,7 @@ public:
void randomize(ptr_vector<expr> const & as) {
TRACE(sls_verbose, tout << "Abandoned model:" << std::endl; show_model(tout); );
for (entry_point_type::iterator it = m_entry_points.begin(); it != m_entry_points.end(); it++) {
for (entry_point_type::iterator it = m_entry_points.begin(); it != m_entry_points.end(); ++it) {
func_decl * fd = it->m_key;
sort * s = fd->get_range();
mpz temp = get_random(s);
@ -662,7 +662,7 @@ public:
void reset(ptr_vector<expr> const & as) {
TRACE(sls_verbose, tout << "Abandoned model:" << std::endl; show_model(tout); );
for (entry_point_type::iterator it = m_entry_points.begin(); it != m_entry_points.end(); it++) {
for (entry_point_type::iterator it = m_entry_points.begin(); it != m_entry_points.end(); ++it) {
set_value(it->m_value, m_zero);
}
}
@ -720,7 +720,7 @@ public:
else if (m_manager.is_and(n) && !negated) {
/* Andreas: Seems to have no effect. But maybe you want to try it again at some point.
double sum = 0.0;
for (unsigned i = 0; i < a->get_num_args(); i++)
for (unsigned i = 0; i < a->get_num_args(); ++i)
sum += get_score(args[i]);
res = sum / (double) a->get_num_args(); */
double min = 1.0;
@ -892,8 +892,8 @@ public:
app * a = to_app(n);
unsigned pairs = 0, distinct_pairs = 0;
unsigned sz = a->get_num_args();
for (unsigned i = 0; i < sz; i++) {
for (unsigned j = i+1; j < sz; j++) {
for (unsigned i = 0; i < sz; ++i) {
for (unsigned j = i+1; j < sz; ++j) {
// pair i/j
const mpz & v0 = get_value(a->get_arg(0));
const mpz & v1 = get_value(a->get_arg(1));
@ -970,7 +970,7 @@ public:
ptr_vector<func_decl> & get_constants(expr * e) {
ptr_vector<func_decl> const & this_decls = m_constants_occ.find(e);
unsigned sz = this_decls.size();
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
func_decl * fd = this_decls[i];
if (!m_temp_constants.contains(fd))
m_temp_constants.push_back(fd);
@ -1043,9 +1043,9 @@ public:
{
double max = -1.0;
// Andreas: Commented things here might be used for track_unsat data structures as done in SLS for SAT. But seems to have no benefit.
/* for (unsigned i = 0; i < m_where_false.size(); i++) {
/* for (unsigned i = 0; i < m_where_false.size(); ++i) {
expr * e = m_list_false[i]; */
for (unsigned i = 0; i < sz; i++) {
for (unsigned i = 0; i < sz; ++i) {
expr * e = as[i];
if (m_mpz_manager.neq(get_value(e), m_one))
{
@ -1075,7 +1075,7 @@ public:
return m_list_false[get_random_uint(16) % sz]; */
unsigned cnt_unsat = 0;
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
if (m_mpz_manager.neq(get_value(as[i]), m_one) && (get_random_uint(16) % ++cnt_unsat == 0)) pos = i;
if (pos == static_cast<unsigned>(-1))
return nullptr;
@ -1092,7 +1092,7 @@ public:
m_temp_constants.reset();
unsigned cnt_unsat = 0, pos = -1;
for (unsigned i = 0; i < sz; i++)
for (unsigned i = 0; i < sz; ++i)
if ((i != m_last_pos) && m_mpz_manager.neq(get_value(as[i]), m_one) && (get_random_uint(16) % ++cnt_unsat == 0)) pos = i;
if (pos == static_cast<unsigned>(-1))

View file

@ -27,7 +27,7 @@ class powers : public u_map<mpz*> {
public:
powers(unsynch_mpz_manager & m) : m(m) {}
~powers() {
for (iterator it = begin(); it != end(); it++) {
for (iterator it = begin(); it != end(); ++it) {
m.del(*it->m_value);
dealloc(it->m_value);
}

View file

@ -1624,13 +1624,13 @@ namespace sls {
if (offset_val.is_neg() || offset_val.get_unsigned() >= r.length()) {
has_empty = true;
for (unsigned i = 0; i < r.length(); i++)
for (unsigned i = 0; i < r.length(); ++i)
m_int_updates.push_back({ offset, rational(i), 1 });
}
if (!len_val.is_pos()) {
has_empty = true;
for (unsigned i = 1; i + offset_u < r.length(); i++)
for (unsigned i = 1; i + offset_u < r.length(); ++i)
m_int_updates.push_back({ len, rational(i), 1 });
}

View file

@ -184,7 +184,7 @@ void static_features::update_core(expr * e) {
else {
m_num_ite_terms++;
// process then&else nodes
for (unsigned i = 1; i < 3; i++) {
for (unsigned i = 1; i < 3; ++i) {
expr * arg = to_app(e)->get_arg(i);
acc_num(arg);
// Must check whether arg is diff logic or not.
@ -224,7 +224,7 @@ void static_features::update_core(expr * e) {
unsigned num_patterns = to_quantifier(e)->get_num_patterns();
if (num_patterns > 0) {
m_num_quantifiers_with_patterns++;
for (unsigned i = 0; i < num_patterns; i++) {
for (unsigned i = 0; i < num_patterns; ++i) {
expr * p = to_quantifier(e)->get_pattern(i);
if (is_app(p) && to_app(p)->get_num_args() > 1) {
m_num_quantifiers_with_multi_patterns++;
@ -332,7 +332,7 @@ void static_features::update_core(expr * e) {
sort * ty = to_app(e)->get_decl()->get_range();
mark_theory(ty->get_family_id());
unsigned n = ty->get_num_parameters();
for (unsigned i = 0; i < n; i++) {
for (unsigned i = 0; i < n; ++i) {
sort * ds = to_sort(ty->get_parameter(i).get_ast());
update_core(ds);
}
@ -531,7 +531,7 @@ void static_features::process_root(expr * e) {
if (num_args == 2)
m_num_bin_clauses++;
unsigned depth = 0;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = to_app(e)->get_arg(i);
if (m.is_not(arg))
arg = to_app(arg)->get_arg(0);
@ -555,7 +555,7 @@ void static_features::process_root(expr * e) {
}
void static_features::collect(unsigned num_formulas, expr * const * formulas) {
for (unsigned i = 0; i < num_formulas; i++)
for (unsigned i = 0; i < num_formulas; ++i)
process_root(formulas[i]);
}
@ -564,7 +564,7 @@ bool static_features::internal_family(symbol const & f_name) const {
}
void static_features::display_family_data(std::ostream & out, char const * prefix, unsigned_vector const & data) const {
for (unsigned fid = 0; fid < data.size(); fid++) {
for (unsigned fid = 0; fid < data.size(); ++fid) {
symbol const & n = m.get_family_name(fid);
if (!internal_family(n))
out << prefix << "_" << n << " " << data[fid] << "\n";

View file

@ -200,7 +200,7 @@ expr_ref demodulator_rewriter_util::rewrite(expr * n) {
m_rewrite_todo.push_back(n);
while (!m_rewrite_todo.empty()) {
TRACE(demodulator_stack, tout << "STACK: " << std::endl;
for (unsigned i = 0; i < m_rewrite_todo.size(); i++)
for (unsigned i = 0; i < m_rewrite_todo.size(); ++i)
tout << std::dec << i << ": " << std::hex << (size_t)m_rewrite_todo[i] <<
" = " << mk_pp(m_rewrite_todo[i], m) << std::endl;
);
@ -495,7 +495,7 @@ expr * demodulator_rewriter::rewrite(expr * n) {
m_rewrite_todo.push_back(n);
while (!m_rewrite_todo.empty()) {
TRACE(demodulator_stack, tout << "STACK: " << std::endl;
for (unsigned i = 0; i < m_rewrite_todo.size(); i++)
for (unsigned i = 0; i < m_rewrite_todo.size(); ++i)
tout << std::dec << i << ": " << std::hex << (size_t)m_rewrite_todo[i] <<
" = " << mk_pp(m_rewrite_todo[i], m) << std::endl;
);
@ -879,7 +879,7 @@ bool demodulator_match_subst::match_args(app * lhs, expr * const * args) {
m_all_args_eq = true;
unsigned num_args = lhs->get_num_args();
if (!fill_commutative(lhs, args)) {
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * t_arg = lhs->get_arg(i);
expr * i_arg = args[i];
if (t_arg != i_arg)

View file

@ -40,7 +40,7 @@ void substitution::reset() {
void substitution::reset_cache() {
TRACE(subst_bug, tout << "substitution::reset_cache\n";
for (unsigned i = 0; i < m_new_exprs.size(); i++) { tout << mk_pp(m_new_exprs.get(i), m_manager) << "\nref_count: " << m_new_exprs.get(i)->get_ref_count() << "\n"; });
for (unsigned i = 0; i < m_new_exprs.size(); ++i) { tout << mk_pp(m_new_exprs.get(i), m_manager) << "\nref_count: " << m_new_exprs.get(i)->get_ref_count() << "\n"; });
m_apply_cache.reset();
m_new_exprs.reset();
@ -54,7 +54,7 @@ void substitution::pop_scope(unsigned num_scopes) {
unsigned old_sz = m_scopes[new_lvl];
unsigned curr_sz = m_vars.size();
SASSERT(old_sz <= curr_sz);
for (unsigned i = old_sz; i < curr_sz; i++) {
for (unsigned i = old_sz; i < curr_sz; ++i) {
var_offset & curr = m_vars[i];
m_subst.erase(curr.first, curr.second);
}
@ -144,7 +144,7 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
m_todo.pop_back();
new_args.reset();
bool has_new_args = false;
for (unsigned i = 0; i < num_args; i++) {
for (unsigned i = 0; i < num_args; ++i) {
expr * arg = to_app(e)->get_arg(i);
expr * new_arg = nullptr;
@ -175,8 +175,8 @@ void substitution::apply(unsigned num_actual_offsets, unsigned const * deltas, e
subst.reserve(m_subst.offsets_capacity(), m_subst.vars_capacity() + num_vars);
var_shifter var_sh(m_manager);
expr_offset r;
for (unsigned i = 0; i < m_subst.offsets_capacity(); i++) {
for (unsigned j = 0; j < m_subst.vars_capacity(); j++) {
for (unsigned i = 0; i < m_subst.offsets_capacity(); ++i) {
for (unsigned j = 0; j < m_subst.vars_capacity(); ++j) {
if (find(j, i, r)) {
var_sh(r.get_expr(), num_vars, er);
subst.insert(j + num_vars, i, expr_offset(er, r.get_offset()));
@ -311,8 +311,8 @@ bool substitution::acyclic() {
void substitution::display(std::ostream & out, unsigned num_actual_offsets, unsigned const * deltas) {
reset_cache();
for (unsigned i = 0; i < num_actual_offsets; i++)
for (unsigned j = 0; j < m_subst.vars_capacity(); j++) {
for (unsigned i = 0; i < num_actual_offsets; ++i)
for (unsigned j = 0; j < m_subst.vars_capacity(); ++j) {
expr_offset r;
if (find(j, i, r)) {
expr_ref tmp(m_manager);
@ -323,8 +323,8 @@ void substitution::display(std::ostream & out, unsigned num_actual_offsets, unsi
}
void substitution::display(std::ostream & out) {
for (unsigned i = 0; i < m_subst.offsets_capacity(); i++)
for (unsigned j = 0; j < m_subst.vars_capacity(); j++) {
for (unsigned i = 0; i < m_subst.offsets_capacity(); ++i)
for (unsigned j = 0; j < m_subst.vars_capacity(); ++j) {
expr_offset r;
if (find(j, i, r))
out << "VAR " << j << ":" << i << " --> " << r.get_offset() << "\n" << mk_pp(r.get_expr(), m_manager) << "\n";

Some files were not shown because too many files have changed in this diff Show more