mirror of
https://github.com/Z3Prover/z3
synced 2026-02-25 09:41:19 +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:
parent
851b8ea31c
commit
317dd92105
475 changed files with 3237 additions and 3237 deletions
|
|
@ -69,7 +69,7 @@ inline unsigned to_idx(aig * p) { SASSERT(!is_var(p)); return p->m_id - FIRST_NO
|
|||
|
||||
|
||||
static void unmark(unsigned sz, aig * const * ns) {
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
ns[i]->m_mark = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -507,7 +507,7 @@ struct aig_manager::imp {
|
|||
void restore_result_stack(unsigned old_sz) {
|
||||
unsigned sz = m_result_stack.size();
|
||||
SASSERT(old_sz <= sz);
|
||||
for (unsigned i = old_sz; i < sz; i++)
|
||||
for (unsigned i = old_sz; i < sz; ++i)
|
||||
m.dec_ref(m_result_stack[i]);
|
||||
m_result_stack.shrink(old_sz);
|
||||
}
|
||||
|
|
@ -972,7 +972,7 @@ struct aig_manager::imp {
|
|||
continue;
|
||||
}
|
||||
bool ok = true;
|
||||
for (unsigned i = 0; i < 2; i++) {
|
||||
for (unsigned i = 0; i < 2; ++i) {
|
||||
aig * c = t->m_children[i].ptr();
|
||||
if (!is_var(c) && cache.get(to_idx(c), nullptr) == nullptr) {
|
||||
todo.push_back(c);
|
||||
|
|
@ -982,7 +982,7 @@ struct aig_manager::imp {
|
|||
if (!ok)
|
||||
continue;
|
||||
expr * args[2];
|
||||
for (unsigned i = 0; i < 2; i++) {
|
||||
for (unsigned i = 0; i < 2; ++i) {
|
||||
aig_lit l = t->m_children[i];
|
||||
aig * c = l.ptr();
|
||||
if (is_var(c))
|
||||
|
|
@ -1341,7 +1341,7 @@ public:
|
|||
void dec_ref(aig_lit const & r) { dec_ref(r.ptr()); }
|
||||
|
||||
void dec_array_ref(unsigned sz, aig * const * ns) {
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
if (ns[i])
|
||||
dec_ref(ns[i]);
|
||||
}
|
||||
|
|
@ -1371,7 +1371,7 @@ public:
|
|||
std::sort(args, args+num, aig_lit_lt());
|
||||
aig_lit r = mk_and(args[0], args[1]);
|
||||
inc_ref(r);
|
||||
for (unsigned i = 2; i < num; i++) {
|
||||
for (unsigned i = 2; i < num; ++i) {
|
||||
aig_lit new_r = mk_and(r, args[i]);
|
||||
inc_ref(new_r);
|
||||
dec_ref(r);
|
||||
|
|
@ -1402,7 +1402,7 @@ public:
|
|||
std::sort(args, args+num, aig_lit_lt());
|
||||
aig_lit r = mk_or(args[0], args[1]);
|
||||
inc_ref(r);
|
||||
for (unsigned i = 2; i < num; i++) {
|
||||
for (unsigned i = 2; i < num; ++i) {
|
||||
aig_lit new_r = mk_or(r, args[i]);
|
||||
inc_ref(new_r);
|
||||
dec_ref(r);
|
||||
|
|
@ -1515,7 +1515,7 @@ public:
|
|||
try {
|
||||
expr2aig proc(*this);
|
||||
unsigned sz = s.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
SASSERT(ref_count(r) >= 1);
|
||||
expr * t = s.form(i);
|
||||
aig_lit n = proc(t);
|
||||
|
|
@ -1625,7 +1625,7 @@ public:
|
|||
continue;
|
||||
}
|
||||
bool visited = true;
|
||||
for (unsigned i = 0; i < 2; i++) {
|
||||
for (unsigned i = 0; i < 2; ++i) {
|
||||
aig_lit c = t->m_children[i];
|
||||
aig * data = c.ptr();
|
||||
if (!data->m_mark) {
|
||||
|
|
@ -1638,7 +1638,7 @@ public:
|
|||
to_unmark.push_back(t);
|
||||
t->m_mark = true;
|
||||
out << "(define-fun aig" << to_idx(t) << " () Bool (and";
|
||||
for (unsigned i = 0; i < 2; i++) {
|
||||
for (unsigned i = 0; i < 2; ++i) {
|
||||
out << " ";
|
||||
display_smt2_ref(out, t->m_children[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public:
|
|||
|
||||
expr_ref_vector nodeps(m);
|
||||
|
||||
for (unsigned i = 0; i < g->size(); i++) {
|
||||
for (unsigned i = 0; i < g->size(); ++i) {
|
||||
expr_dependency * ed = g->dep(i);
|
||||
if (!ed) {
|
||||
nodeps.push_back(g->form(i));
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class add_bounds_tactic : public tactic {
|
|||
expr_fast_mark1 visited;
|
||||
add_bound_proc proc(bm, *(g.get()), m_lower, m_upper);
|
||||
unsigned sz = g->size();
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
quick_for_each_expr(proc, visited, g->form(i));
|
||||
visited.reset();
|
||||
g->inc_depth();
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class diff_neq_tactic : public tactic {
|
|||
// throws exception if contains unbounded variable
|
||||
void check_unbounded() {
|
||||
unsigned num = num_vars();
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
if (m_lower[x] == INT_MIN || m_upper[x] == INT_MAX)
|
||||
throw_not_supported();
|
||||
// possible extension: support bound normalization here
|
||||
|
|
@ -166,7 +166,7 @@ class diff_neq_tactic : public tactic {
|
|||
expr * lhs;
|
||||
expr * rhs;
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = g.form(i);
|
||||
TRACE(diff_neq_tactic, tout << "processing: " << mk_ismt2_pp(f, m) << "\n";);
|
||||
if (u.is_le(f, lhs, rhs))
|
||||
|
|
@ -183,10 +183,10 @@ class diff_neq_tactic : public tactic {
|
|||
|
||||
void display(std::ostream & out) {
|
||||
unsigned num = num_vars();
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
out << m_lower[x] << " <= " << mk_ismt2_pp(m_var2expr.get(x), m) << " <= " << m_upper[x] << "\n";
|
||||
}
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
diseqs::iterator it = m_var_diseqs[x].begin();
|
||||
diseqs::iterator end = m_var_diseqs[x].end();
|
||||
for (; it != end; ++it) {
|
||||
|
|
@ -197,7 +197,7 @@ class diff_neq_tactic : public tactic {
|
|||
|
||||
void display_model(std::ostream & out) {
|
||||
unsigned num = m_stack.size();
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
out << mk_ismt2_pp(m_var2expr.get(x), m) << " := " << m_stack[x] << "\n";
|
||||
}
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ class diff_neq_tactic : public tactic {
|
|||
void init_forbidden() {
|
||||
int max = 0;
|
||||
unsigned num = num_vars();
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
if (m_upper[x] > max)
|
||||
max = m_upper[x];
|
||||
}
|
||||
|
|
@ -250,10 +250,10 @@ class diff_neq_tactic : public tactic {
|
|||
max = bad_v;
|
||||
}
|
||||
// reset forbidden
|
||||
for (int i = starting_at + 1; i <= max; i++)
|
||||
for (int i = starting_at + 1; i <= max; ++i)
|
||||
m_forbidden[i] = false;
|
||||
DEBUG_CODE({
|
||||
for (unsigned i = 0; i < m_forbidden.size(); i++) {
|
||||
for (unsigned i = 0; i < m_forbidden.size(); ++i) {
|
||||
SASSERT(!m_forbidden[i]);
|
||||
}
|
||||
});
|
||||
|
|
@ -305,7 +305,7 @@ class diff_neq_tactic : public tactic {
|
|||
model * md = alloc(model, m);
|
||||
unsigned num = num_vars();
|
||||
SASSERT(m_stack.size() == num);
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
func_decl * d = to_app(m_var2expr.get(x))->get_decl();
|
||||
md->register_decl(d, u.mk_numeral(rational(m_stack[x]), true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < g->size(); i++) {
|
||||
for (unsigned i = 0; i < g->size(); ++i) {
|
||||
collect_fd(g->form(i));
|
||||
}
|
||||
cleanup_fd(mc1);
|
||||
|
|
@ -198,7 +198,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; !g->inconsistent() && i < g->size(); i++) {
|
||||
for (unsigned i = 0; !g->inconsistent() && i < g->size(); ++i) {
|
||||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
app_ref var(m);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class factor_tactic : public tactic {
|
|||
void mk_eq(polynomial::factors const & fs, expr_ref & result) {
|
||||
expr_ref_buffer args(m);
|
||||
expr_ref arg(m);
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); i++) {
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); ++i) {
|
||||
m_expr2poly.to_expr(fs[i], true, arg);
|
||||
args.push_back(arg);
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ class factor_tactic : public tactic {
|
|||
void mk_split_eq(polynomial::factors const & fs, expr_ref & result) {
|
||||
expr_ref_buffer args(m);
|
||||
expr_ref arg(m);
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); i++) {
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); ++i) {
|
||||
m_expr2poly.to_expr(fs[i], true, arg);
|
||||
args.push_back(m.mk_eq(arg, mk_zero_for(arg)));
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ class factor_tactic : public tactic {
|
|||
SASSERT(k == OP_LT || k == OP_GT || k == OP_LE || k == OP_GE);
|
||||
expr_ref_buffer args(m);
|
||||
expr_ref arg(m);
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); i++) {
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); ++i) {
|
||||
m_expr2poly.to_expr(fs[i], true, arg);
|
||||
if (fs.get_degree(i) % 2 == 0)
|
||||
arg = m_util.mk_power(arg, m_util.mk_numeral(rational(2), m_util.is_int(arg)));
|
||||
|
|
@ -113,7 +113,7 @@ class factor_tactic : public tactic {
|
|||
// See mk_split_strict_comp and mk_split_nonstrict_comp
|
||||
void split_even_odd(bool strict, polynomial::factors const & fs, expr_ref_buffer & even_eqs, expr_ref_buffer & odd_factors) {
|
||||
expr_ref arg(m);
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); i++) {
|
||||
for (unsigned i = 0; i < fs.distinct_factors(); ++i) {
|
||||
m_expr2poly.to_expr(fs[i], true, arg);
|
||||
if (fs.get_degree(i) % 2 == 0) {
|
||||
expr * eq = m.mk_eq(arg, mk_zero_for(arg));
|
||||
|
|
@ -264,7 +264,7 @@ class factor_tactic : public tactic {
|
|||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; !g->inconsistent() && idx < size; idx++) {
|
||||
for (unsigned idx = 0; !g->inconsistent() && idx < size; ++idx) {
|
||||
expr * curr = g->form(idx);
|
||||
m_rw(curr, new_curr, new_pr);
|
||||
if (produce_proofs) {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class fm_tactic : public tactic {
|
|||
|
||||
bool is_lower = false;
|
||||
bool found = false;
|
||||
for (unsigned i = 0; i < num_lits; i++) {
|
||||
for (unsigned i = 0; i < num_lits; ++i) {
|
||||
expr * l = lits[i];
|
||||
expr * atom;
|
||||
if (is_uninterp_const(l) || (m.is_not(l, atom) && is_uninterp_const(atom))) {
|
||||
|
|
@ -109,7 +109,7 @@ class fm_tactic : public tactic {
|
|||
num_mons = 1;
|
||||
mons = &lhs;
|
||||
}
|
||||
for (unsigned j = 0; j < num_mons; j++) {
|
||||
for (unsigned j = 0; j < num_mons; ++j) {
|
||||
expr * monomial = mons[j];
|
||||
expr * ai;
|
||||
expr * xi;
|
||||
|
|
@ -296,7 +296,7 @@ class fm_tactic : public tactic {
|
|||
out << "(fm-model-converter";
|
||||
SASSERT(m_xs.size() == m_clauses.size());
|
||||
unsigned sz = m_xs.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
out << "\n(" << m_xs[i]->get_name();
|
||||
clauses const & cs = m_clauses[i];
|
||||
for (auto& c : cs)
|
||||
|
|
@ -310,7 +310,7 @@ class fm_tactic : public tactic {
|
|||
ast_manager & to_m = translator.to();
|
||||
fm_model_converter * res = alloc(fm_model_converter, to_m);
|
||||
unsigned sz = m_xs.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
func_decl * new_x = translator(m_xs[i]);
|
||||
to_m.inc_ref(new_x);
|
||||
res->m_xs.push_back(new_x);
|
||||
|
|
@ -503,7 +503,7 @@ class fm_tactic : public tactic {
|
|||
|
||||
expr_fast_mark2 visited;
|
||||
bool all_forbidden = true;
|
||||
for (unsigned i = 0; i < num_mons; i++) {
|
||||
for (unsigned i = 0; i < num_mons; ++i) {
|
||||
expr * x;
|
||||
if (!is_linear_mon_core(mons[i], x))
|
||||
return false;
|
||||
|
|
@ -532,7 +532,7 @@ class fm_tactic : public tactic {
|
|||
if (m_fm_occ && m.is_or(t)) {
|
||||
unsigned num = to_app(t)->get_num_args();
|
||||
bool found = false;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr * l = to_app(t)->get_arg(i);
|
||||
if (is_literal(l)) {
|
||||
continue;
|
||||
|
|
@ -566,7 +566,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
void del_constraints(unsigned sz, constraint * const * cs) {
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
del_constraint(cs[i]);
|
||||
}
|
||||
|
||||
|
|
@ -590,18 +590,18 @@ class fm_tactic : public tactic {
|
|||
cnstr->m_strict = strict;
|
||||
cnstr->m_num_vars = num_vars;
|
||||
cnstr->m_lits = reinterpret_cast<literal*>(mem_lits);
|
||||
for (unsigned i = 0; i < num_lits; i++)
|
||||
for (unsigned i = 0; i < num_lits; ++i)
|
||||
cnstr->m_lits[i] = lits[i];
|
||||
cnstr->m_xs = reinterpret_cast<var*>(mem_xs);
|
||||
cnstr->m_as = reinterpret_cast<rational*>(mem_as);
|
||||
for (unsigned i = 0; i < num_vars; i++) {
|
||||
for (unsigned i = 0; i < num_vars; ++i) {
|
||||
TRACE(mk_constraint_bug, tout << "xs[" << i << "]: " << xs[i] << "\n";);
|
||||
cnstr->m_xs[i] = xs[i];
|
||||
new (cnstr->m_as + i) rational(as[i]);
|
||||
}
|
||||
cnstr->m_c = c;
|
||||
DEBUG_CODE({
|
||||
for (unsigned i = 0; i < num_vars; i++) {
|
||||
for (unsigned i = 0; i < num_vars; ++i) {
|
||||
SASSERT(cnstr->m_xs[i] == xs[i]);
|
||||
SASSERT(cnstr->m_as[i] == as[i]);
|
||||
}
|
||||
|
|
@ -622,13 +622,13 @@ class fm_tactic : public tactic {
|
|||
// multiply as and c, by the lcm of their denominators
|
||||
void mk_int(unsigned num, rational * as, rational & c) {
|
||||
rational l = denominator(c);
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
for (unsigned i = 0; i < num; ++i)
|
||||
l = lcm(l, denominator(as[i]));
|
||||
if (l.is_one())
|
||||
return;
|
||||
c *= l;
|
||||
SASSERT(c.is_int());
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
as[i] *= l;
|
||||
SASSERT(as[i].is_int());
|
||||
}
|
||||
|
|
@ -641,7 +641,7 @@ class fm_tactic : public tactic {
|
|||
rational g = c.m_c;
|
||||
if (g.is_neg())
|
||||
g.neg();
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i) {
|
||||
if (g.is_one())
|
||||
break;
|
||||
if (c.m_as[i].is_pos())
|
||||
|
|
@ -652,12 +652,12 @@ class fm_tactic : public tactic {
|
|||
if (g.is_one())
|
||||
return;
|
||||
c.m_c /= g;
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++)
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i)
|
||||
c.m_as[i] /= g;
|
||||
}
|
||||
|
||||
void display(std::ostream & out, constraint const & c) const {
|
||||
for (unsigned i = 0; i < c.m_num_lits; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_lits; ++i) {
|
||||
literal l = c.m_lits[i];
|
||||
if (sign(l))
|
||||
out << "~";
|
||||
|
|
@ -668,7 +668,7 @@ class fm_tactic : public tactic {
|
|||
out << "(";
|
||||
if (c.m_num_vars == 0)
|
||||
out << "0";
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i) {
|
||||
if (i > 0)
|
||||
out << " + ";
|
||||
if (!c.m_as[i].is_one())
|
||||
|
|
@ -706,12 +706,12 @@ class fm_tactic : public tactic {
|
|||
|
||||
m_counter += c1.m_num_lits + c2.m_num_lits;
|
||||
|
||||
for (unsigned i = 0; i < c1.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c1.m_num_vars; ++i) {
|
||||
m_var2pos[c1.m_xs[i]] = i;
|
||||
}
|
||||
|
||||
bool failed = false;
|
||||
for (unsigned i = 0; i < c2.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c2.m_num_vars; ++i) {
|
||||
unsigned pos1 = m_var2pos[c2.m_xs[i]];
|
||||
if (pos1 == UINT_MAX || c1.m_as[pos1] != c2.m_as[i]) {
|
||||
failed = true;
|
||||
|
|
@ -719,21 +719,21 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < c1.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c1.m_num_vars; ++i) {
|
||||
m_var2pos[c1.m_xs[i]] = UINT_MAX;
|
||||
}
|
||||
|
||||
if (failed)
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < c2.m_num_lits; i++) {
|
||||
for (unsigned i = 0; i < c2.m_num_lits; ++i) {
|
||||
literal l = c2.m_lits[i];
|
||||
bvar b = lit2bvar(l);
|
||||
SASSERT(m_bvar2sign[b] == 0);
|
||||
m_bvar2sign[b] = sign(l) ? -1 : 1;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < c1.m_num_lits; i++) {
|
||||
for (unsigned i = 0; i < c1.m_num_lits; ++i) {
|
||||
literal l = c1.m_lits[i];
|
||||
bvar b = lit2bvar(l);
|
||||
char s = sign(l) ? -1 : 1;
|
||||
|
|
@ -743,7 +743,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < c2.m_num_lits; i++) {
|
||||
for (unsigned i = 0; i < c2.m_num_lits; ++i) {
|
||||
literal l = c2.m_lits[i];
|
||||
bvar b = lit2bvar(l);
|
||||
m_bvar2sign[b] = 0;
|
||||
|
|
@ -761,7 +761,7 @@ class fm_tactic : public tactic {
|
|||
var best = UINT_MAX;
|
||||
unsigned best_sz = UINT_MAX;
|
||||
bool best_lower = false;
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i) {
|
||||
var xi = c.m_xs[i];
|
||||
if (is_forbidden(xi))
|
||||
continue; // variable is not in the index
|
||||
|
|
@ -854,7 +854,7 @@ class fm_tactic : public tactic {
|
|||
expr_fast_mark1 visited;
|
||||
forbidden_proc proc(*this);
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = g.form(i);
|
||||
if (is_occ(f))
|
||||
continue;
|
||||
|
|
@ -905,7 +905,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
bool all_int(constraint const & c) const {
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i) {
|
||||
if (!is_int(c.m_xs[i]))
|
||||
return false;
|
||||
}
|
||||
|
|
@ -924,7 +924,7 @@ class fm_tactic : public tactic {
|
|||
else {
|
||||
bool int_cnstr = all_int(c);
|
||||
ptr_buffer<expr> ms;
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i) {
|
||||
expr * x = m_var2expr.get(c.m_xs[i]);
|
||||
if (!int_cnstr && is_int(c.m_xs[i]))
|
||||
x = m_util.mk_to_real(x);
|
||||
|
|
@ -955,7 +955,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
ptr_buffer<expr> lits;
|
||||
for (unsigned i = 0; i < c.m_num_lits; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_lits; ++i) {
|
||||
literal l = c.m_lits[i];
|
||||
if (sign(l))
|
||||
lits.push_back(m.mk_not(m_bvar2expr.get(lit2bvar(l))));
|
||||
|
|
@ -1049,7 +1049,7 @@ class fm_tactic : public tactic {
|
|||
#if Z3DEBUG
|
||||
bool found_ineq = false;
|
||||
#endif
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr * l = args[i];
|
||||
if (is_literal(l)) {
|
||||
lits.push_back(to_literal(l));
|
||||
|
|
@ -1080,7 +1080,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
bool all_int = true;
|
||||
for (unsigned j = 0; j < num_mons; j++) {
|
||||
for (unsigned j = 0; j < num_mons; ++j) {
|
||||
expr * monomial = mons[j];
|
||||
expr * a;
|
||||
rational a_val;
|
||||
|
|
@ -1108,7 +1108,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
}
|
||||
|
||||
TRACE(to_var_bug, tout << "before mk_constraint: "; for (unsigned i = 0; i < xs.size(); i++) tout << " " << xs[i]; tout << "\n";);
|
||||
TRACE(to_var_bug, tout << "before mk_constraint: "; for (unsigned i = 0; i < xs.size(); ++i) tout << " " << xs[i]; tout << "\n";);
|
||||
|
||||
constraint * new_c = mk_constraint(lits.size(),
|
||||
lits.data(),
|
||||
|
|
@ -1138,7 +1138,7 @@ class fm_tactic : public tactic {
|
|||
|
||||
bool r = false;
|
||||
|
||||
for (unsigned i = 0; i < c->m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c->m_num_vars; ++i) {
|
||||
var x = c->m_xs[i];
|
||||
if (!is_forbidden(x)) {
|
||||
r = true;
|
||||
|
|
@ -1164,7 +1164,7 @@ class fm_tactic : public tactic {
|
|||
|
||||
void init_use_list(goal const & g) {
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
if (m_inconsistent)
|
||||
return;
|
||||
expr * f = g.form(i);
|
||||
|
|
@ -1204,7 +1204,7 @@ class fm_tactic : public tactic {
|
|||
void sort_candidates(var_vector & xs) {
|
||||
svector<x_cost> x_cost_vector;
|
||||
unsigned num = num_vars();
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
if (!is_forbidden(x)) {
|
||||
x_cost_vector.push_back(x_cost(x, get_cost(x)));
|
||||
}
|
||||
|
|
@ -1222,7 +1222,7 @@ class fm_tactic : public tactic {
|
|||
void cleanup_constraints(constraints & cs) {
|
||||
unsigned j = 0;
|
||||
unsigned sz = cs.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
constraint * c = cs[i];
|
||||
if (c->m_dead)
|
||||
continue;
|
||||
|
|
@ -1238,7 +1238,7 @@ class fm_tactic : public tactic {
|
|||
void analyze(constraint const & c, var x, bool & all_int, bool & unit_coeff) const {
|
||||
all_int = true;
|
||||
unit_coeff = true;
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i) {
|
||||
if (!is_int(c.m_xs[i])) {
|
||||
all_int = false;
|
||||
return;
|
||||
|
|
@ -1304,7 +1304,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
void get_coeff(constraint const & c, var x, rational & a) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < c.m_num_vars; ++i) {
|
||||
if (c.m_xs[i] == x) {
|
||||
a = c.m_as[i];
|
||||
return;
|
||||
|
|
@ -1333,7 +1333,7 @@ class fm_tactic : public tactic {
|
|||
rational new_c = l.m_c*b + u.m_c*a;
|
||||
bool new_strict = l.m_strict || u.m_strict;
|
||||
|
||||
for (unsigned i = 0; i < l.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < l.m_num_vars; ++i) {
|
||||
var xi = l.m_xs[i];
|
||||
if (xi == x)
|
||||
continue;
|
||||
|
|
@ -1346,7 +1346,7 @@ class fm_tactic : public tactic {
|
|||
SASSERT(new_xs.size() == new_as.size());
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < u.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < u.m_num_vars; ++i) {
|
||||
var xi = u.m_xs[i];
|
||||
if (xi == x)
|
||||
continue;
|
||||
|
|
@ -1364,7 +1364,7 @@ class fm_tactic : public tactic {
|
|||
bool all_int = true;
|
||||
unsigned sz = new_xs.size();
|
||||
unsigned j = 0;
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
if (new_as[i].is_zero())
|
||||
continue;
|
||||
if (!is_int(new_xs[i]))
|
||||
|
|
@ -1384,7 +1384,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
// reset m_var2pos
|
||||
for (unsigned i = 0; i < l.m_num_vars; i++) {
|
||||
for (unsigned i = 0; i < l.m_num_vars; ++i) {
|
||||
m_var2pos[l.m_xs[i]] = UINT_MAX;
|
||||
}
|
||||
|
||||
|
|
@ -1398,7 +1398,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
new_lits.reset();
|
||||
for (unsigned i = 0; i < l.m_num_lits; i++) {
|
||||
for (unsigned i = 0; i < l.m_num_lits; ++i) {
|
||||
literal lit = l.m_lits[i];
|
||||
bvar p = lit2bvar(lit);
|
||||
m_bvar2sign[p] = sign(lit) ? -1 : 1;
|
||||
|
|
@ -1406,7 +1406,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
bool tautology = false;
|
||||
for (unsigned i = 0; i < u.m_num_lits && !tautology; i++) {
|
||||
for (unsigned i = 0; i < u.m_num_lits && !tautology; ++i) {
|
||||
literal lit = u.m_lits[i];
|
||||
bvar p = lit2bvar(lit);
|
||||
switch (m_bvar2sign[p]) {
|
||||
|
|
@ -1427,7 +1427,7 @@ class fm_tactic : public tactic {
|
|||
}
|
||||
|
||||
// reset m_bvar2sign
|
||||
for (unsigned i = 0; i < l.m_num_lits; i++) {
|
||||
for (unsigned i = 0; i < l.m_num_lits; ++i) {
|
||||
literal lit = l.m_lits[i];
|
||||
bvar p = lit2bvar(lit);
|
||||
m_bvar2sign[p] = 0;
|
||||
|
|
@ -1510,8 +1510,8 @@ class fm_tactic : public tactic {
|
|||
unsigned limit = num_old_cnstrs + m_fm_extra;
|
||||
unsigned num_new_cnstrs = 0;
|
||||
new_constraints.reset();
|
||||
for (unsigned i = 0; i < num_lowers; i++) {
|
||||
for (unsigned j = 0; j < num_uppers; j++) {
|
||||
for (unsigned i = 0; i < num_lowers; ++i) {
|
||||
for (unsigned j = 0; j < num_uppers; ++j) {
|
||||
if (m_inconsistent || num_new_cnstrs > limit) {
|
||||
TRACE(fm, tout << "too many new constraints: " << num_new_cnstrs << "\n";);
|
||||
del_constraints(new_constraints.size(), new_constraints.data());
|
||||
|
|
@ -1533,7 +1533,7 @@ class fm_tactic : public tactic {
|
|||
|
||||
m_counter += sz;
|
||||
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
constraint * c = new_constraints[i];
|
||||
backward_subsumption(*c);
|
||||
register_constraint(c);
|
||||
|
|
@ -1601,7 +1601,7 @@ class fm_tactic : public tactic {
|
|||
m_mc = alloc(fm_model_converter, m);
|
||||
|
||||
unsigned num = candidates.size();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
checkpoint();
|
||||
if (m_counter > m_fm_limit)
|
||||
break;
|
||||
|
|
@ -1636,7 +1636,7 @@ class fm_tactic : public tactic {
|
|||
|
||||
void display(std::ostream & out) const {
|
||||
unsigned num = num_vars();
|
||||
for (var x = 0; x < num; x++) {
|
||||
for (var x = 0; x < num; ++x) {
|
||||
if (is_forbidden(x))
|
||||
continue;
|
||||
out << mk_ismt2_pp(m_var2expr.get(x), m) << "\n";
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ public:
|
|||
TRACE(pb, tout << "add bound " << lo << " " << hi << ": " << mk_pp(x, m) << "\n";);
|
||||
}
|
||||
}
|
||||
for (unsigned i = 0; !g->inconsistent() && i < g->size(); i++) {
|
||||
for (unsigned i = 0; !g->inconsistent() && i < g->size(); ++i) {
|
||||
checkpoint();
|
||||
|
||||
expr_ref new_curr(m), tmp(m);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class lia2pb_tactic : public tactic {
|
|||
expr_fast_mark1 visited;
|
||||
visitor proc(*this);
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = g.form(i);
|
||||
for_each_expr_core<visitor, expr_fast_mark1, true, true>(proc, visited, f);
|
||||
}
|
||||
|
|
@ -236,7 +236,7 @@ class lia2pb_tactic : public tactic {
|
|||
def_args.reset();
|
||||
rational a(1);
|
||||
unsigned num_bits = u.get_num_bits();
|
||||
for (unsigned i = 0; i < num_bits; i++) {
|
||||
for (unsigned i = 0; i < num_bits; ++i) {
|
||||
app * x_prime = m.mk_fresh_const(nullptr, m_util.mk_int());
|
||||
g->assert_expr(m_util.mk_le(zero, x_prime));
|
||||
g->assert_expr(m_util.mk_le(x_prime, one));
|
||||
|
|
@ -271,7 +271,7 @@ class lia2pb_tactic : public tactic {
|
|||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; !g->inconsistent() && idx < size; idx++) {
|
||||
for (unsigned idx = 0; !g->inconsistent() && idx < size; ++idx) {
|
||||
expr * curr = g->form(idx);
|
||||
expr_dependency * dep = nullptr;
|
||||
m_rw(curr, new_curr, new_pr);
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class normalize_bounds_tactic : public tactic {
|
|||
m_rw.set_substitution(&subst);
|
||||
expr_ref new_curr(m);
|
||||
|
||||
for (unsigned idx = 0; !in->inconsistent() && idx < in->size(); idx++) {
|
||||
for (unsigned idx = 0; !in->inconsistent() && idx < in->size(); ++idx) {
|
||||
expr * curr = in->form(idx);
|
||||
proof_ref new_pr(m);
|
||||
m_rw(curr, new_curr, new_pr);
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ private:
|
|||
expr_fast_mark1 visited;
|
||||
only_01_visitor proc(m_arith_util, m_pb, m_bm);
|
||||
unsigned sz = g->size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = g->form(i);
|
||||
for_each_expr_core<only_01_visitor, expr_fast_mark1, true, true>(proc, visited, f);
|
||||
}
|
||||
|
|
@ -360,7 +360,7 @@ private:
|
|||
}
|
||||
|
||||
static bool is_cardinality(polynomial const & m_p, numeral const & m_c) {
|
||||
for (unsigned i = 0; i < m_p.size(); i++) {
|
||||
for (unsigned i = 0; i < m_p.size(); ++i) {
|
||||
if (!m_p[i].m_a.is_one())
|
||||
return false;
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ private:
|
|||
|
||||
if (is_card && m_c.is_one()) {
|
||||
ptr_buffer<expr> args;
|
||||
for (unsigned i = 0; i < m_p.size(); i++) {
|
||||
for (unsigned i = 0; i < m_p.size(); ++i) {
|
||||
args.push_back(mon_lit2lit(m_p[i]));
|
||||
}
|
||||
r = m.mk_or(args.size(), args.data());
|
||||
|
|
@ -386,7 +386,7 @@ private:
|
|||
|
||||
if (is_card && m_c == numeral(m_p.size())) {
|
||||
ptr_buffer<expr> args;
|
||||
for (unsigned i = 0; i < m_p.size(); i++) {
|
||||
for (unsigned i = 0; i < m_p.size(); ++i) {
|
||||
args.push_back(mon_lit2lit(m_p[i]));
|
||||
}
|
||||
m_b_rw.mk_and(args.size(), args.data(), r);
|
||||
|
|
@ -414,8 +414,8 @@ private:
|
|||
expr_ref_vector tmp(m);
|
||||
tmp.resize(rowsz, m.mk_true());
|
||||
|
||||
for (unsigned i = 0; i < k; i++) {
|
||||
for (unsigned j = 0; j < rowsz; j++) {
|
||||
for (unsigned i = 0; i < k; ++i) {
|
||||
for (unsigned j = 0; j < rowsz; ++j) {
|
||||
expr_ref new_ite(m);
|
||||
m_b_rw.mk_ite(mon_lit2lit(m_p[i + j]),
|
||||
tmp.get(j),
|
||||
|
|
@ -435,7 +435,7 @@ private:
|
|||
// [Leo] improving number of bits needed.
|
||||
// using (sum-of-coeffs).get_num_bits()
|
||||
numeral sum;
|
||||
for (unsigned i = 0; i < m_p.size(); i++) {
|
||||
for (unsigned i = 0; i < m_p.size(); ++i) {
|
||||
monomial const & mo = m_p[i];
|
||||
SASSERT(mo.m_a.is_pos());
|
||||
sum += mo.m_a;
|
||||
|
|
@ -458,7 +458,7 @@ private:
|
|||
|
||||
ptr_buffer<expr> lhs_args;
|
||||
|
||||
for (unsigned i = 0; i < m_p.size(); i++) {
|
||||
for (unsigned i = 0; i < m_p.size(); ++i) {
|
||||
monomial const & mo = m_p[i];
|
||||
// encode using if-then-else
|
||||
expr * bv_monom =
|
||||
|
|
@ -483,7 +483,7 @@ private:
|
|||
|
||||
unsigned sz = m_p.size();
|
||||
unsigned i;
|
||||
for (i = 2; i < sz; i++) {
|
||||
for (i = 2; i < sz; ++i) {
|
||||
if (m_p[i].m_a != m_c)
|
||||
break;
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ private:
|
|||
}
|
||||
|
||||
// copy lits [0, i) to m_clause
|
||||
for (unsigned j = 0; j < i; j++)
|
||||
for (unsigned j = 0; j < i; ++j)
|
||||
m_clause.push_back(monomial(numeral(1), m_p[j].m_lit));
|
||||
|
||||
app * new_var = m.mk_fresh_const(nullptr, m_arith_util.mk_int());
|
||||
|
|
@ -503,7 +503,7 @@ private:
|
|||
m_clause.push_back(monomial(numeral(1), lit(new_var, true)));
|
||||
|
||||
// remove monomials [0, i) from m_p and add new_var in the beginning
|
||||
for (unsigned j = i; j < sz; j++) {
|
||||
for (unsigned j = i; j < sz; ++j) {
|
||||
m_p[j - i + 1] = m_p[j];
|
||||
}
|
||||
m_p.shrink(sz - i + 1);
|
||||
|
|
@ -598,7 +598,7 @@ private:
|
|||
unsigned n = sz/2;
|
||||
if (c != rational::power_of_two(n) - numeral(1))
|
||||
return false;
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
monomial const & m1 = p[i*2];
|
||||
monomial const & m2 = p[i*2+1];
|
||||
if (m1.m_lit.sign() == m2.m_lit.sign())
|
||||
|
|
@ -745,7 +745,7 @@ private:
|
|||
unsigned sz = to_app(lhs)->get_num_args();
|
||||
expr * const * ms = to_app(lhs)->get_args();
|
||||
expr * a, * x;
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * m = ms[i];
|
||||
if (is_uninterp_const(m))
|
||||
continue;
|
||||
|
|
@ -759,7 +759,7 @@ private:
|
|||
polynomial m_p;
|
||||
numeral m_c;
|
||||
m_c = c;
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * m = ms[i];
|
||||
if (is_uninterp_const(m)) {
|
||||
add_bounds_dependencies(m);
|
||||
|
|
@ -789,7 +789,7 @@ private:
|
|||
}
|
||||
else if (k == LE) {
|
||||
m_c.neg();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
monomial & m = m_p[i];
|
||||
SASSERT(m.m_a.is_nonneg());
|
||||
m_c += m.m_a;
|
||||
|
|
@ -818,7 +818,7 @@ private:
|
|||
polynomial m_p2;
|
||||
numeral m_c2 = m_c;
|
||||
m_c2.neg();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
monomial m = m_p[i];
|
||||
SASSERT(m.m_a.is_nonneg());
|
||||
m_c2 += m.m_a;
|
||||
|
|
@ -914,7 +914,7 @@ private:
|
|||
}
|
||||
|
||||
unsigned size = g->size();
|
||||
for (unsigned i = 0; i < size; i++)
|
||||
for (unsigned i = 0; i < size; ++i)
|
||||
m_bm(g->form(i), g->dep(i), g->pr(i));
|
||||
|
||||
TRACE(pb2bv, m_bm.display(tout););
|
||||
|
|
@ -933,7 +933,7 @@ private:
|
|||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
expr_ref new_f(m);
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
expr * curr = g->form(idx);
|
||||
expr * atom;
|
||||
bool pos;
|
||||
|
|
@ -957,7 +957,7 @@ private:
|
|||
throw_tactic(p.e);
|
||||
}
|
||||
|
||||
for (unsigned idx = 0; idx < size; idx++)
|
||||
for (unsigned idx = 0; idx < size; ++idx)
|
||||
g->update(idx, new_exprs.get(idx), nullptr, (m_produce_unsat_cores) ? new_deps.get(idx) : g->dep(idx));
|
||||
|
||||
expr_ref_vector fmls(m);
|
||||
|
|
@ -974,7 +974,7 @@ private:
|
|||
mc1->hide(f);
|
||||
// store temp int constants in the filter
|
||||
unsigned num_temps = m_temporary_ints.size();
|
||||
for (unsigned i = 0; i < num_temps; i++)
|
||||
for (unsigned i = 0; i < num_temps; ++i)
|
||||
mc1->hide(m_temporary_ints.get(i));
|
||||
pb2bv_model_converter * mc2 = alloc(pb2bv_model_converter, m, m_const2bit, m_bm);
|
||||
mc = concat(mc1, mc2);
|
||||
|
|
@ -1043,7 +1043,7 @@ struct is_pb_probe : public probe {
|
|||
try {
|
||||
ast_manager & m = g.m();
|
||||
bound_manager bm(m);
|
||||
for (unsigned i = 0; i < g.size(); i++)
|
||||
for (unsigned i = 0; i < g.size(); ++i)
|
||||
bm(g.form(i), g.dep(i), g.pr(i));
|
||||
arith_util a_util(m);
|
||||
pb_util pb(m);
|
||||
|
|
@ -1051,7 +1051,7 @@ struct is_pb_probe : public probe {
|
|||
pb2bv_tactic::only_01_visitor proc(a_util, pb, bm);
|
||||
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = g.form(i);
|
||||
for_each_expr_core<pb2bv_tactic::only_01_visitor, expr_fast_mark1, true, true>(proc, visited, f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ static bool is_lp(goal const & g) {
|
|||
ast_manager & m = g.m();
|
||||
arith_util u(m);
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = g.form(i);
|
||||
bool sign = false;
|
||||
while (m.is_not(f, f))
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ struct purify_arith_proc {
|
|||
find_unsafe_proc proc(*this);
|
||||
expr_fast_mark1 visited;
|
||||
unsigned sz = m_goal.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * curr = m_goal.form(i);
|
||||
for_each_expr_core<find_unsafe_proc, expr_fast_mark1, true, true>(proc, visited, curr);
|
||||
}
|
||||
|
|
@ -243,7 +243,7 @@ struct purify_arith_proc {
|
|||
expr_fast_mark1 visited;
|
||||
proc p(*this);
|
||||
unsigned sz = m_owner.m_goal.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr* f = m_owner.m_goal.form(i);
|
||||
for_each_expr_core<proc, expr_fast_mark1, true, true>(p, visited, f);
|
||||
}
|
||||
|
|
@ -523,7 +523,7 @@ struct purify_arith_proc {
|
|||
unsigned sz = p.size();
|
||||
SASSERT(sz > 2);
|
||||
ptr_buffer<expr> args;
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
if (am.qm().is_zero(p[i]))
|
||||
continue;
|
||||
rational coeff = rational(p[i]);
|
||||
|
|
@ -780,7 +780,7 @@ struct purify_arith_proc {
|
|||
expr_ref new_curr(m());
|
||||
proof_ref new_pr(m());
|
||||
unsigned sz = m_goal.size();
|
||||
for (unsigned i = 0; !m_goal.inconsistent() && i < sz; i++) {
|
||||
for (unsigned i = 0; !m_goal.inconsistent() && i < sz; ++i) {
|
||||
expr * curr = m_goal.form(i);
|
||||
r(curr, new_curr, new_pr);
|
||||
if (m_produce_proofs) {
|
||||
|
|
@ -794,7 +794,7 @@ struct purify_arith_proc {
|
|||
sz = r.cfg().m_new_cnstrs.size();
|
||||
TRACE(purify_arith, tout << r.cfg().m_new_cnstrs << "\n";);
|
||||
TRACE(purify_arith, tout << r.cfg().m_new_cnstr_prs << "\n";);
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
m_goal.assert_expr(r.cfg().m_new_cnstrs.get(i), m_produce_proofs ? r.cfg().m_new_cnstr_prs.get(i) : nullptr, nullptr);
|
||||
}
|
||||
auto const& divs = r.cfg().m_divs;
|
||||
|
|
|
|||
|
|
@ -169,13 +169,13 @@ class recover_01_tactic : public tactic {
|
|||
return false;
|
||||
idx = 0;
|
||||
unsigned val = 1;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr * lit = zero_cls->get_arg(i);
|
||||
if (m.is_eq(lit))
|
||||
continue;
|
||||
// search for lit or ~lit in cls
|
||||
unsigned j;
|
||||
for (j = 0; j < num; j++) {
|
||||
for (j = 0; j < num; ++j) {
|
||||
expr * lit2 = cls->get_arg(j);
|
||||
if (m.is_eq(lit2))
|
||||
continue;
|
||||
|
|
@ -193,7 +193,7 @@ class recover_01_tactic : public tactic {
|
|||
|
||||
// find k
|
||||
unsigned i;
|
||||
for (i = 0; i < num; i++) {
|
||||
for (i = 0; i < num; ++i) {
|
||||
expr * lhs, * rhs;
|
||||
if (m.is_eq(cls->get_arg(i), lhs, rhs) && (m_util.is_numeral(lhs, k) || m_util.is_numeral(rhs, k)))
|
||||
break;
|
||||
|
|
@ -264,13 +264,13 @@ class recover_01_tactic : public tactic {
|
|||
|
||||
unsigned num_bits = cls_size - 1;
|
||||
// check if idxs are consistent
|
||||
for (unsigned idx = 0; idx < expected_num_clauses; idx++) {
|
||||
for (unsigned idx = 0; idx < expected_num_clauses; ++idx) {
|
||||
if (!found[idx])
|
||||
return false; // case is missing
|
||||
rational expected_k;
|
||||
unsigned idx_aux = idx;
|
||||
unsigned idx_bit = 1;
|
||||
for (unsigned j = 0; j < num_bits; j++) {
|
||||
for (unsigned j = 0; j < num_bits; ++j) {
|
||||
if (idx_aux % 2 == 1) {
|
||||
expected_k += idx2coeff[idx_bit];
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ class recover_01_tactic : public tactic {
|
|||
expr_ref def(m);
|
||||
bool real_ctx = m_util.is_real(x->get_range());
|
||||
unsigned idx_bit = 1;
|
||||
for (unsigned i = 0; i < cls_size; i++) {
|
||||
for (unsigned i = 0; i < cls_size; ++i) {
|
||||
expr * lit = zero_cls->get_arg(i);
|
||||
if (m.is_eq(lit))
|
||||
continue;
|
||||
|
|
@ -322,7 +322,7 @@ class recover_01_tactic : public tactic {
|
|||
SASSERT(new_goal->prec() == g->prec());
|
||||
new_goal->inc_depth();
|
||||
|
||||
for (unsigned i = 0; i < g->size(); i++) {
|
||||
for (unsigned i = 0; i < g->size(); ++i) {
|
||||
expr * f = g->form(i);
|
||||
if (save_clause(f))
|
||||
saved = true;
|
||||
|
|
@ -367,7 +367,7 @@ class recover_01_tactic : public tactic {
|
|||
m_rw.set_substitution(subst);
|
||||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
for (unsigned idx = 0; idx < new_goal->size(); idx++) {
|
||||
for (unsigned idx = 0; idx < new_goal->size(); ++idx) {
|
||||
expr * curr = new_goal->form(idx);
|
||||
m_rw(curr, new_curr);
|
||||
new_goal->update(idx, new_curr);
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ struct bit_blaster_model_converter : public model_converter {
|
|||
|
||||
void collect_bits(obj_hashtable<func_decl> & bits) {
|
||||
unsigned sz = m_bits.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * bs = m_bits.get(i);
|
||||
SASSERT(!TO_BOOL || is_app_of(bs, m().get_family_id("bv"), OP_MKBV));
|
||||
SASSERT(TO_BOOL || is_app_of(bs, m().get_family_id("bv"), OP_CONCAT));
|
||||
unsigned num_args = to_app(bs)->get_num_args();
|
||||
for (unsigned j = 0; j < num_args; j++) {
|
||||
for (unsigned j = 0; j < num_args; ++j) {
|
||||
expr * bit = to_app(bs)->get_arg(j);
|
||||
SASSERT(!TO_BOOL || m().is_bool(bit));
|
||||
SASSERT(TO_BOOL || is_sort_of(bit->get_sort(), m().get_family_id("bv"), BV_SORT));
|
||||
|
|
@ -77,7 +77,7 @@ struct bit_blaster_model_converter : public model_converter {
|
|||
|
||||
void copy_non_bits(obj_hashtable<func_decl> & bits, model * old_model, model * new_model) {
|
||||
unsigned num = old_model->get_num_constants();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
func_decl * f = old_model->get_constant(i);
|
||||
if (bits.contains(f))
|
||||
continue;
|
||||
|
|
@ -97,7 +97,7 @@ struct bit_blaster_model_converter : public model_converter {
|
|||
rational two(2);
|
||||
SASSERT(m_vars.size() == m_bits.size());
|
||||
unsigned sz = m_vars.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr* new_val = old_model->get_const_interp(m_vars.get(i));
|
||||
if (new_val) {
|
||||
new_model->register_decl(m_vars.get(i), new_val);
|
||||
|
|
@ -125,7 +125,7 @@ struct bit_blaster_model_converter : public model_converter {
|
|||
}
|
||||
else {
|
||||
SASSERT(is_app_of(bs, m().get_family_id("bv"), OP_CONCAT));
|
||||
for (unsigned j = 0; j < bv_sz; j++) {
|
||||
for (unsigned j = 0; j < bv_sz; ++j) {
|
||||
val *= two;
|
||||
expr * bit = to_app(bs)->get_arg(j);
|
||||
SASSERT(util.is_bv(bit));
|
||||
|
|
@ -196,7 +196,7 @@ struct bit_blaster_model_converter : public model_converter {
|
|||
for (func_decl * f : m_newbits)
|
||||
display_del(out, f);
|
||||
unsigned sz = m_vars.size();
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
display_add(out, m(), m_vars.get(i), m_bits.get(i));
|
||||
}
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ struct bit_blaster_model_converter : public model_converter {
|
|||
if (!util.is_numeral(value, r))
|
||||
continue;
|
||||
unsigned sz = m_vars.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
if (m_vars.get(i) != to_app(var)->get_decl())
|
||||
continue;
|
||||
unsigned k = 0;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class bit_blaster_tactic : public tactic {
|
|||
proof_ref new_pr(m());
|
||||
unsigned size = g->size();
|
||||
bool change = false;
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
if (g->inconsistent())
|
||||
break;
|
||||
expr * curr = g->form(idx);
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
}
|
||||
sort * b = butil().mk_sort(1);
|
||||
ptr_buffer<expr> bits;
|
||||
for (unsigned i = 0; i < bv_size; i++) {
|
||||
for (unsigned i = 0; i < bv_size; ++i) {
|
||||
bits.push_back(m().mk_fresh_const(nullptr, b));
|
||||
m_newbits.push_back(to_app(bits.back())->get_decl());
|
||||
m_saved.push_back(m_newbits.back());
|
||||
|
|
@ -155,7 +155,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
SASSERT(t_bits.size() == e_bits.size());
|
||||
bit_buffer new_ites;
|
||||
unsigned num = t_bits.size();
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
for (unsigned i = 0; i < num; ++i)
|
||||
new_ites.push_back(t_bits[i] == e_bits[i] ? t_bits[i] : m().mk_ite(c, t_bits[i], e_bits[i]));
|
||||
result = butil().mk_concat(new_ites.size(), new_ites.data());
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
rational v = f->get_parameter(0).get_rational();
|
||||
rational two(2);
|
||||
unsigned sz = f->get_parameter(1).get_int();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
if ((v % two).is_zero())
|
||||
bits.push_back(m_bit0);
|
||||
else
|
||||
|
|
@ -189,7 +189,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
unsigned start = sz - 1 - high;
|
||||
unsigned end = sz - 1 - low;
|
||||
bit_buffer bits;
|
||||
for (unsigned i = start; i <= end; i++) {
|
||||
for (unsigned i = start; i <= end; ++i) {
|
||||
bits.push_back(arg_bits[i]);
|
||||
}
|
||||
result = butil().mk_concat(bits.size(), bits.data());
|
||||
|
|
@ -198,7 +198,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
void reduce_concat(unsigned num, expr * const * args, expr_ref & result) {
|
||||
bit_buffer bits;
|
||||
bit_buffer arg_bits;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr * arg = args[i];
|
||||
arg_bits.reset();
|
||||
get_bits(arg, arg_bits);
|
||||
|
|
@ -215,7 +215,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
SASSERT(bits1.size() == bits2.size());
|
||||
bit_buffer new_bits;
|
||||
unsigned num = bits1.size();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
new_bits.push_back(m().mk_ite(m().mk_eq(bits1[i], bits2[i]), m_bit0, m_bit1));
|
||||
}
|
||||
result = butil().mk_concat(new_bits.size(), new_bits.data());
|
||||
|
|
@ -229,21 +229,21 @@ class bv1_blaster_tactic : public tactic {
|
|||
return;
|
||||
}
|
||||
reduce_bin_xor(args[0], args[1], result);
|
||||
for (unsigned i = 2; i < num_args; i++) {
|
||||
for (unsigned i = 2; i < num_args; ++i) {
|
||||
reduce_bin_xor(result, args[i], result);
|
||||
}
|
||||
#else
|
||||
ptr_buffer<bit_buffer> args_bits;
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
for (unsigned i = 0; i < num_args; ++i) {
|
||||
bit_buffer * buff_i = alloc(bit_buffer);
|
||||
get_bits(args[i], *buff_i);
|
||||
args_bits.push_back(buff_i);
|
||||
}
|
||||
bit_buffer new_bits;
|
||||
unsigned sz = butil().get_bv_size(args[0]);
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
ptr_buffer<expr> eqs;
|
||||
for (unsigned j = 0; j < num_args; j++) {
|
||||
for (unsigned j = 0; j < num_args; ++j) {
|
||||
bit_buffer * buff_j = args_bits[j];
|
||||
eqs.push_back(m().mk_eq(buff_j->get(i), m_bit1));
|
||||
}
|
||||
|
|
@ -367,7 +367,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
unsigned sz = g.size();
|
||||
visitor proc(m_rw.cfg().butil().get_family_id());
|
||||
try {
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = g.form(i);
|
||||
for_each_expr_core<visitor, expr_fast_mark1, false, true>(proc, visited, f);
|
||||
}
|
||||
|
|
@ -394,7 +394,7 @@ class bv1_blaster_tactic : public tactic {
|
|||
expr_ref new_curr(m());
|
||||
proof_ref new_pr(m());
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
if (g->inconsistent())
|
||||
break;
|
||||
expr * curr = g->form(idx);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ struct bv_bound_chk_rewriter_cfg : public default_rewriter_cfg {
|
|||
const br_status st = reduce_app_core(f, num, args, result, result_pr);
|
||||
CTRACE(bv_bound_chk_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;
|
||||
}
|
||||
|
|
@ -151,7 +151,7 @@ public:
|
|||
ast_manager& m(g->m());
|
||||
expr_ref new_curr(m);
|
||||
const unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
if (g->inconsistent()) break;
|
||||
expr * curr = g->form(idx);
|
||||
m_rw(curr, new_curr);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public:
|
|||
};
|
||||
#endif
|
||||
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
bool negated = false;
|
||||
f = g.form(i);
|
||||
if (m.is_not(f)) {
|
||||
|
|
@ -327,10 +327,10 @@ public:
|
|||
if (!(m_unsigned_lowers.empty() && m_unsigned_uppers.empty())) {
|
||||
TRACE(bv_size_reduction,
|
||||
tout << "m_unsigned_lowers: " << std::endl;
|
||||
for (obj_map<app, numeral>::iterator it = m_unsigned_lowers.begin(); it != m_unsigned_lowers.end(); it++)
|
||||
for (obj_map<app, numeral>::iterator it = m_unsigned_lowers.begin(); it != m_unsigned_lowers.end(); ++it)
|
||||
tout << mk_ismt2_pp(it->m_key, m) << " >= " << it->m_value.to_string() << std::endl;
|
||||
tout << "m_unsigned_uppers: " << std::endl;
|
||||
for (obj_map<app, numeral>::iterator it = m_unsigned_uppers.begin(); it != m_unsigned_uppers.end(); it++)
|
||||
for (obj_map<app, numeral>::iterator it = m_unsigned_uppers.begin(); it != m_unsigned_uppers.end(); ++it)
|
||||
tout << mk_ismt2_pp(it->m_key, m) << " <= " << it->m_value.to_string() << std::endl;
|
||||
);
|
||||
|
||||
|
|
@ -398,7 +398,7 @@ public:
|
|||
unsigned sz = g.size();
|
||||
expr * f;
|
||||
expr_ref new_f(m);
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
if (g.inconsistent())
|
||||
return;
|
||||
f = g.form(i);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ sort * bvarray2uf_rewriter_cfg::get_index_sort(expr * e) {
|
|||
sort * bvarray2uf_rewriter_cfg::get_index_sort(sort * s) {
|
||||
SASSERT(s->get_num_parameters() >= 2);
|
||||
unsigned total_width = 0;
|
||||
for (unsigned i = 0; i < s->get_num_parameters() - 1; i++) {
|
||||
for (unsigned i = 0; i < s->get_num_parameters() - 1; ++i) {
|
||||
parameter const & p = s->get_parameter(i);
|
||||
SASSERT(p.is_ast() && is_sort(to_sort(p.get_ast())));
|
||||
SASSERT(m_bv_util.is_bv_sort(to_sort(p.get_ast())));
|
||||
|
|
@ -90,7 +90,7 @@ bool bvarray2uf_rewriter_cfg::is_bv_array(sort * s) {
|
|||
return false;
|
||||
|
||||
SASSERT(s->get_num_parameters() >= 2);
|
||||
for (unsigned i = 0; i < s->get_num_parameters(); i++) {
|
||||
for (unsigned i = 0; i < s->get_num_parameters(); ++i) {
|
||||
parameter const & p = s->get_parameter(i);
|
||||
if (!p.is_ast() || !is_sort(to_sort(p.get_ast())) ||
|
||||
!m_bv_util.is_bv_sort(to_sort(p.get_ast())))
|
||||
|
|
@ -201,7 +201,7 @@ br_status bvarray2uf_rewriter_cfg::reduce_app(func_decl * f, unsigned num, expr
|
|||
|
||||
bool has_bv_arrays = false;
|
||||
func_decl_ref f_t(m_manager);
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
if (is_bv_array(args[i])) {
|
||||
SASSERT(m_array_util.is_as_array(args[i]));
|
||||
has_bv_arrays = true;
|
||||
|
|
@ -279,7 +279,7 @@ br_status bvarray2uf_rewriter_cfg::reduce_app(func_decl * f, unsigned num, expr
|
|||
func_decl_ref map_f(to_func_decl(f->get_parameter(0).get_ast()), m_manager);
|
||||
|
||||
func_decl_ref_vector ss(m_manager);
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
SASSERT(m_array_util.is_array(args[i]));
|
||||
func_decl_ref fd(mk_uf_for_array(args[i]), m_manager);
|
||||
ss.push_back(fd);
|
||||
|
|
@ -291,7 +291,7 @@ br_status bvarray2uf_rewriter_cfg::reduce_app(func_decl * f, unsigned num, expr
|
|||
var_ref x(m_manager.mk_var(0, sorts[0]), m_manager);
|
||||
|
||||
expr_ref_vector new_args(m_manager);
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
for (unsigned i = 0; i < num; ++i)
|
||||
new_args.push_back(m_manager.mk_app(ss[i].get(), x.get()));
|
||||
|
||||
expr_ref body(m_manager);
|
||||
|
|
@ -362,7 +362,7 @@ bool bvarray2uf_rewriter_cfg::pre_visit(expr * t)
|
|||
quantifier * q = to_quantifier(t);
|
||||
TRACE(bvarray2uf_rw_q, 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);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class bvarray2uf_tactic : public tactic {
|
|||
expr_ref new_curr(m_manager);
|
||||
proof_ref new_pr(m_manager);
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
if (g->inconsistent())
|
||||
break;
|
||||
expr* curr = g->form(idx);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public:
|
|||
rw.set_is_fd(&m_is_fd);
|
||||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
rw(g->form(idx), new_curr, new_pr);
|
||||
if (produce_proofs) {
|
||||
proof * pr = g->pr(idx);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class elim_small_bv_tactic : public tactic {
|
|||
|
||||
// (VAR 0) is in the first position of substitution; (VAR num_decls-1) is in the last position.
|
||||
|
||||
for (unsigned i = 0; i < max_var_idx_p1; i++)
|
||||
for (unsigned i = 0; i < max_var_idx_p1; ++i)
|
||||
substitution.push_back(nullptr);
|
||||
|
||||
// (VAR num_decls) ... (VAR num_decls+sz-1); are in positions num_decls .. num_decls+sz-1
|
||||
|
|
@ -89,7 +89,7 @@ class elim_small_bv_tactic : public tactic {
|
|||
// (VAR 0) should be in the last position of substitution.
|
||||
|
||||
TRACE(elim_small_bv, tout << "substitution: " << std::endl;
|
||||
for (unsigned k = 0; k < substitution.size(); k++) {
|
||||
for (unsigned k = 0; k < substitution.size(); ++k) {
|
||||
expr * se = substitution[k];
|
||||
tout << k << " = ";
|
||||
if (se == 0) tout << "0";
|
||||
|
|
@ -151,7 +151,7 @@ class elim_small_bv_tactic : public tactic {
|
|||
if (max_num > m_max_steps || max_num + num_steps > m_max_steps)
|
||||
return false;
|
||||
|
||||
for (unsigned j = 0; j < max_num && !max_steps_exceeded(num_steps); j++) {
|
||||
for (unsigned j = 0; j < max_num && !max_steps_exceeded(num_steps); ++j) {
|
||||
expr_ref n(m_util.mk_numeral(j, bv_sz), m);
|
||||
new_bodies.push_back(replace_var(uv, num_decls, max_var_idx_p1, i, s, body, n));
|
||||
num_steps++;
|
||||
|
|
@ -170,7 +170,7 @@ class elim_small_bv_tactic : public tactic {
|
|||
}
|
||||
|
||||
TRACE(elim_small_bv, tout << "new bodies: " << std::endl;
|
||||
for (unsigned k = 0; k < new_bodies.size(); k++)
|
||||
for (unsigned k = 0; k < new_bodies.size(); ++k)
|
||||
tout << mk_ismt2_pp(new_bodies[k].get(), m) << std::endl; );
|
||||
|
||||
body = is_forall(q) ? m.mk_and(new_bodies.size(), new_bodies.data()) :
|
||||
|
|
@ -200,7 +200,7 @@ class elim_small_bv_tactic : public tactic {
|
|||
quantifier * q = to_quantifier(t);
|
||||
TRACE(elim_small_bv, tout << "pre_visit quantifier [" << q->get_id() << "]: " << mk_ismt2_pp(q->get_expr(), m) << std::endl;);
|
||||
sort_ref_vector new_bindings(m);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ struct cofactor_elim_term_ite::imp {
|
|||
bool has_new_args = false;
|
||||
bool has_term_ite = false;
|
||||
unsigned num = to_app(t)->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr * arg = to_app(t)->get_arg(i);
|
||||
expr * new_arg = nullptr;
|
||||
TRACE(cofactor_bug, tout << "collecting child: " << arg->get_id() << "\n";);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ void collect_occs::process(expr * t) {
|
|||
|
||||
void collect_occs::operator()(goal const & g, obj_hashtable<expr> & r) {
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * t = g.form(i);
|
||||
process(t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public:
|
|||
collect_proc cp(m, m_stats);
|
||||
expr_mark visited;
|
||||
const unsigned sz = g->size();
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
for_each_expr(cp, visited, g->form(i));
|
||||
|
||||
std::cout << "(\n";
|
||||
|
|
@ -157,7 +157,7 @@ protected:
|
|||
}
|
||||
|
||||
void operator()(func_decl * f) {
|
||||
for (unsigned i = 0; i < f->get_arity(); i++)
|
||||
for (unsigned i = 0; i < f->get_arity(); ++i)
|
||||
this->operator()(f->get_domain()[i]);
|
||||
this->operator()(f->get_range());
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ struct ctx_simplify_tactic::imp {
|
|||
restore_cache(0);
|
||||
dealloc(m_simp);
|
||||
DEBUG_CODE({
|
||||
for (unsigned i = 0; i < m_cache.size(); i++) {
|
||||
for (unsigned i = 0; i < m_cache.size(); ++i) {
|
||||
CTRACE(ctx_simplify_tactic_bug, m_cache[i].m_from,
|
||||
tout << "i: " << i << "\n" << mk_ismt2_pp(m_cache[i].m_from, m) << "\n";
|
||||
tout << "m_result: " << m_cache[i].m_result << "\n";
|
||||
|
|
@ -210,7 +210,7 @@ struct ctx_simplify_tactic::imp {
|
|||
}
|
||||
|
||||
bool check_cache() {
|
||||
for (unsigned i = 0; i < m_cache.size(); i++) {
|
||||
for (unsigned i = 0; i < m_cache.size(); ++i) {
|
||||
cache_cell & cell = m_cache[i];
|
||||
if (cell.m_from != nullptr) {
|
||||
SASSERT(cell.m_result != 0);
|
||||
|
|
@ -294,7 +294,7 @@ struct ctx_simplify_tactic::imp {
|
|||
m_simp->pop(num_scopes);
|
||||
|
||||
// restore cache
|
||||
for (unsigned i = 0; i < num_scopes; i++) {
|
||||
for (unsigned i = 0; i < num_scopes; ++i) {
|
||||
restore_cache(lvl);
|
||||
lvl--;
|
||||
}
|
||||
|
|
@ -354,7 +354,7 @@ struct ctx_simplify_tactic::imp {
|
|||
unsigned old_lvl = scope_level();
|
||||
bool modified = false;
|
||||
unsigned num_args = t->get_num_args();
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
for (unsigned i = 0; i < num_args; ++i) {
|
||||
expr * arg = t->get_arg(i);
|
||||
expr_ref new_arg(m);
|
||||
simplify(arg, new_arg);
|
||||
|
|
@ -479,7 +479,7 @@ struct ctx_simplify_tactic::imp {
|
|||
expr_ref_buffer new_args(m);
|
||||
bool modified = false;
|
||||
unsigned num_args = t->get_num_args();
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
for (unsigned i = 0; i < num_args; ++i) {
|
||||
expr * arg = t->get_arg(i);
|
||||
expr_ref new_arg(m);
|
||||
simplify(arg, new_arg);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class elim_term_ite_tactic : public tactic {
|
|||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
expr * curr = g->form(idx);
|
||||
m_rw(curr, new_curr, new_pr);
|
||||
if (produce_proofs) {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
}
|
||||
|
||||
bool uncnstr(unsigned num, expr * const * args) const {
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
for (unsigned i = 0; i < num; ++i)
|
||||
if (!uncnstr(args[i]))
|
||||
return false;
|
||||
return true;
|
||||
|
|
@ -130,7 +130,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
void add_defs(unsigned num, expr * const * args, expr * u, expr * identity) {
|
||||
if (m_mc) {
|
||||
add_def(args[0], u);
|
||||
for (unsigned i = 1; i < num; i++)
|
||||
for (unsigned i = 1; i < num; ++i)
|
||||
add_def(args[i], identity);
|
||||
}
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
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
|
||||
|
|
@ -164,7 +164,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
// and d is a term different from (select t i1 ... in)
|
||||
ptr_buffer<expr> new_args;
|
||||
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 = m().mk_app(fid, OP_SELECT, new_args.size(), new_args.data());
|
||||
|
|
@ -182,7 +182,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
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;
|
||||
|
|
@ -195,7 +195,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
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);
|
||||
}
|
||||
|
|
@ -403,7 +403,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return nullptr;
|
||||
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;
|
||||
|
|
@ -418,7 +418,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
if (!m_mc)
|
||||
return u;
|
||||
ptr_buffer<expr> new_args;
|
||||
for (unsigned j = 0; j < num; j++) {
|
||||
for (unsigned j = 0; j < num; ++j) {
|
||||
if (j == i)
|
||||
continue;
|
||||
new_args.push_back(args[j]);
|
||||
|
|
@ -775,7 +775,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return r;
|
||||
}
|
||||
func_decl * c = m_dt_util.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 nullptr;
|
||||
app * u;
|
||||
|
|
@ -783,7 +783,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
return u;
|
||||
ptr_vector<func_decl> const & accs = *m_dt_util.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(u);
|
||||
else
|
||||
|
|
@ -841,7 +841,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
if (fid == null_family_id)
|
||||
return BR_FAILED;
|
||||
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
if (!is_ground(args[i]))
|
||||
return BR_FAILED; // non-ground terms are not handled.
|
||||
}
|
||||
|
|
@ -932,7 +932,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
unsigned size = g->size();
|
||||
unsigned idx = 0;
|
||||
while (true) {
|
||||
for (; idx < size; idx++) {
|
||||
for (; idx < size; ++idx) {
|
||||
expr * f = g->form(idx);
|
||||
m_rw->operator()(f, new_f, new_pr);
|
||||
if (f == new_f)
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public:
|
|||
proof_ref new_pr(m);
|
||||
|
||||
unsigned sz = g->size();
|
||||
for (unsigned i = 0; !g->inconsistent() && i < sz; i++) {
|
||||
for (unsigned i = 0; !g->inconsistent() && i < sz; ++i) {
|
||||
expr * curr = g->form(i);
|
||||
local_nnf(curr, defs, def_prs, new_curr, new_pr);
|
||||
if (produce_proofs) {
|
||||
|
|
@ -81,7 +81,7 @@ public:
|
|||
}
|
||||
|
||||
sz = defs.size();
|
||||
for (unsigned i = 0; !g->inconsistent() && i < sz; i++) {
|
||||
for (unsigned i = 0; !g->inconsistent() && i < sz; ++i) {
|
||||
if (produce_proofs)
|
||||
g->assert_expr(defs.get(i), def_prs.get(i), nullptr);
|
||||
else
|
||||
|
|
@ -93,7 +93,7 @@ public:
|
|||
if (num_extra_names > 0 && !g->inconsistent()) {
|
||||
generic_model_converter * fmc = alloc(generic_model_converter, m, "nnf");
|
||||
g->add(fmc);
|
||||
for (unsigned i = 0; i < num_extra_names; i++)
|
||||
for (unsigned i = 0; i < num_extra_names; ++i)
|
||||
fmc->hide(dnames.get_name_decl(i));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class occf_tactic : public tactic {
|
|||
SASSERT(m.is_or(cls));
|
||||
bool found = false;
|
||||
unsigned num = cls->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
if (is_constraint(cls->get_arg(i))) {
|
||||
if (found)
|
||||
return true;
|
||||
|
|
@ -138,7 +138,7 @@ class occf_tactic : public tactic {
|
|||
cnstr2bvar c2b;
|
||||
|
||||
unsigned sz = g->size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
checkpoint();
|
||||
expr * f = g->form(i);
|
||||
expr_dependency * d = g->dep(i);
|
||||
|
|
@ -154,7 +154,7 @@ class occf_tactic : public tactic {
|
|||
expr * keep = nullptr;
|
||||
new_lits.reset();
|
||||
unsigned num = cls->get_num_args();
|
||||
for (unsigned j = 0; j < num; j++) {
|
||||
for (unsigned j = 0; j < num; ++j) {
|
||||
expr * l = cls->get_arg(j);
|
||||
if (is_constraint(l)) {
|
||||
expr * new_l = get_aux_lit(c2b, l, g);
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class propagate_values_tactic : public tactic {
|
|||
while (true) {
|
||||
TRACE(propagate_values, tout << "while(true) loop\n"; m_goal->display_with_dependencies(tout););
|
||||
if (forward) {
|
||||
for (; m_idx < size; m_idx++) {
|
||||
for (; m_idx < size; ++m_idx) {
|
||||
process_current();
|
||||
if (m_goal->inconsistent())
|
||||
goto end;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class reduce_args_tactic : public tactic {
|
|||
find_non_candidates_proc proc(m, m_bv, m_ar, non_candidates);
|
||||
expr_fast_mark1 visited;
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
checkpoint();
|
||||
quick_for_each_expr(proc, visited, g.form(i));
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ class reduce_args_tactic : public tactic {
|
|||
decl2args.reset();
|
||||
populate_decl2args_proc proc(m, m_bv, non_candidates, decl2args);
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
checkpoint();
|
||||
quick_for_each_expr(proc, visited, g.form(i));
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ class reduce_args_tactic : public tactic {
|
|||
ptr_buffer<func_decl> bad_decls;
|
||||
for (auto const& [k, v] : decl2args) {
|
||||
bool is_zero = true;
|
||||
for (unsigned i = 0; i < v.size() && is_zero; i++) {
|
||||
for (unsigned i = 0; i < v.size() && is_zero; ++i) {
|
||||
if (v.get(i))
|
||||
is_zero = false;
|
||||
}
|
||||
|
|
@ -247,7 +247,7 @@ class reduce_args_tactic : public tactic {
|
|||
// 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());
|
||||
|
|
@ -264,7 +264,7 @@ class reduce_args_tactic : public tactic {
|
|||
// 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))
|
||||
|
|
@ -348,7 +348,7 @@ class reduce_args_tactic : public tactic {
|
|||
}
|
||||
|
||||
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]);
|
||||
}
|
||||
|
|
@ -381,7 +381,7 @@ class reduce_args_tactic : public tactic {
|
|||
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());
|
||||
|
|
@ -394,7 +394,7 @@ class reduce_args_tactic : public tactic {
|
|||
}
|
||||
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)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ struct simplify_tactic::imp {
|
|||
expr_ref new_curr(m());
|
||||
proof_ref new_pr(m());
|
||||
unsigned size = g.size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
if (g.inconsistent())
|
||||
break;
|
||||
expr * curr = g.form(idx);
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ void special_relations_tactic::operator()(goal_ref const & g, goal_ref_buffer &
|
|||
initialize();
|
||||
obj_map<func_decl, sp_axioms> goal_features;
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
collect_feature(*g, idx, goal_features);
|
||||
}
|
||||
special_relations_util u(m);
|
||||
|
|
@ -159,7 +159,7 @@ void special_relations_tactic::operator()(goal_ref const & g, goal_ref_buffer &
|
|||
}
|
||||
}
|
||||
if (!replace.empty()) {
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
if (to_delete.contains(idx)) {
|
||||
g->update(idx, m.mk_true());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class split_clause_tactic : public tactic {
|
|||
unsigned result_idx = UINT_MAX;
|
||||
unsigned len = 0;
|
||||
unsigned sz = in->size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = in->form(i);
|
||||
if (m.is_or(f)) {
|
||||
unsigned curr_len = to_app(f)->get_num_args();
|
||||
|
|
@ -61,7 +61,7 @@ class split_clause_tactic : public tactic {
|
|||
SASSERT(num_source == m_clause->get_num_args());
|
||||
proof_ref_buffer prs(m);
|
||||
prs.push_back(m_clause_pr);
|
||||
for (unsigned i = 0; i < num_source; i++) {
|
||||
for (unsigned i = 0; i < num_source; ++i) {
|
||||
proof * pr_i = source[i];
|
||||
expr * not_li = m.mk_not(m_clause->get_arg(i));
|
||||
prs.push_back(m.mk_lemma(pr_i, not_li));
|
||||
|
|
|
|||
|
|
@ -664,14 +664,14 @@ class tseitin_cnf_tactic : public tactic {
|
|||
bool visited = true;
|
||||
unsigned num = t->get_num_args();
|
||||
unsigned blowup = 1;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr * a = t->get_arg(i);
|
||||
expr * a0;
|
||||
if (m_distributivity && m.is_not(a, a0) && m.is_or(a0) && !is_shared(a0)) {
|
||||
unsigned num2 = to_app(a0)->get_num_args();
|
||||
if (num2 < m_distributivity_blowup && blowup * num2 < m_distributivity_blowup && blowup < blowup * num2) {
|
||||
blowup *= num2;
|
||||
for (unsigned j = 0; j < num2; j++)
|
||||
for (unsigned j = 0; j < num2; ++j)
|
||||
visit(to_app(a0)->get_arg(j), visited);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -693,7 +693,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
bool distributivity = false;
|
||||
if (m_distributivity) {
|
||||
// check if need to apply distributivity
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr * a = t->get_arg(i);
|
||||
expr * a0;
|
||||
if (m.is_not(a, a0) && m.is_or(a0) && !is_shared(a0) && to_app(a0)->get_num_args() < m_distributivity_blowup) {
|
||||
|
|
@ -706,7 +706,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
if (!distributivity) {
|
||||
// easy case
|
||||
expr_ref_buffer lits(m); expr_ref l(m);
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
get_lit(t->get_arg(i), false, l);
|
||||
lits.push_back(l);
|
||||
}
|
||||
|
|
@ -714,7 +714,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
mk_clause(lits.size(), lits.data());
|
||||
}
|
||||
else {
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
inv(lits[i], l);
|
||||
mk_clause(l, k);
|
||||
}
|
||||
|
|
@ -728,7 +728,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
sbuffer<unsigned> it;
|
||||
sbuffer<unsigned> offsets;
|
||||
unsigned blowup = 1;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
it.push_back(0);
|
||||
offsets.push_back(buffer.size());
|
||||
expr * a = t->get_arg(i);
|
||||
|
|
@ -739,7 +739,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
szs.push_back(num2);
|
||||
blowup *= num2;
|
||||
expr_ref_buffer lits(m);
|
||||
for (unsigned j = 0; j < num2; j++) {
|
||||
for (unsigned j = 0; j < num2; ++j) {
|
||||
get_lit(to_app(a0)->get_arg(j), true, nl);
|
||||
buffer.push_back(nl);
|
||||
if (!root) {
|
||||
|
|
@ -766,12 +766,12 @@ class tseitin_cnf_tactic : public tactic {
|
|||
sbuffer<expr**> arg_lits;
|
||||
ptr_buffer<expr> lits;
|
||||
expr ** buffer_ptr = buffer.data();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
arg_lits.push_back(buffer_ptr + offsets[i]);
|
||||
}
|
||||
do {
|
||||
lits.reset();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
lits.push_back(arg_lits[i][it[i]]);
|
||||
}
|
||||
if (!root)
|
||||
|
|
@ -863,7 +863,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
g->reset();
|
||||
unsigned sz = m_clauses.size();
|
||||
expr_fast_mark1 added;
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * cls = m_clauses.get(i);
|
||||
if (added.is_marked(cls))
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -34,16 +34,16 @@ model_converter * fpa2bv_model_converter::translate(ast_translation & translator
|
|||
|
||||
void fpa2bv_model_converter::convert(model_core * mc, model * float_mdl) {
|
||||
TRACE(fpa2bv_mc, tout << "BV Model: " << std::endl;
|
||||
for (unsigned i = 0; i < mc->get_num_constants(); i++)
|
||||
for (unsigned i = 0; i < mc->get_num_constants(); ++i)
|
||||
tout << mc->get_constant(i)->get_name() << " --> " <<
|
||||
mk_ismt2_pp(mc->get_const_interp(mc->get_constant(i)), m) << std::endl;
|
||||
for (unsigned i = 0; i < mc->get_num_functions(); i++) {
|
||||
for (unsigned i = 0; i < mc->get_num_functions(); ++i) {
|
||||
func_decl * f = mc->get_function(i);
|
||||
tout << f->get_name() << "(...) := " << std::endl;
|
||||
func_interp * fi = mc->get_func_interp(f);
|
||||
for (unsigned j = 0; j < fi->num_entries(); j++) {
|
||||
for (unsigned j = 0; j < fi->num_entries(); ++j) {
|
||||
func_entry const * fe = fi->get_entry(j);
|
||||
for (unsigned k = 0; k < f->get_arity(); k++)
|
||||
for (unsigned k = 0; k < f->get_arity(); ++k)
|
||||
tout << mk_ismt2_pp(fe->get_arg(k), m) << " ";
|
||||
tout << "--> " << mk_ismt2_pp(fe->get_result(), m) << std::endl;
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ void fpa2bv_model_converter::convert(model_core * mc, model * float_mdl) {
|
|||
|
||||
// Keep all the non-float constants.
|
||||
unsigned sz = mc->get_num_constants();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
func_decl * c = mc->get_constant(i);
|
||||
if (!seen.contains(c))
|
||||
float_mdl->register_decl(c, mc->get_const_interp(c));
|
||||
|
|
@ -66,7 +66,7 @@ void fpa2bv_model_converter::convert(model_core * mc, model * float_mdl) {
|
|||
|
||||
// And keep everything else
|
||||
sz = mc->get_num_functions();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
func_decl * f = mc->get_function(i);
|
||||
if (!seen.contains(f)) {
|
||||
TRACE(fpa2bv_mc, tout << "Keeping: " << mk_ismt2_pp(f, m) << std::endl;);
|
||||
|
|
@ -76,7 +76,7 @@ void fpa2bv_model_converter::convert(model_core * mc, model * float_mdl) {
|
|||
}
|
||||
|
||||
sz = mc->get_num_uninterpreted_sorts();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
sort * s = mc->get_uninterpreted_sort(i);
|
||||
ptr_vector<expr> u = mc->get_universe(s);
|
||||
float_mdl->register_usort(s, u.size(), u.data());
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class fpa2bv_tactic : public tactic {
|
|||
expr_ref new_curr(m);
|
||||
proof_ref new_pr(m);
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
if (g->inconsistent())
|
||||
break;
|
||||
expr * curr = g->form(idx);
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ void goal::quick_process(bool save_first, expr_ref& f, expr_dependency * d) {
|
|||
|
||||
void goal::process_and(bool save_first, app * f, proof * pr, expr_dependency * d, expr_ref & out_f, proof_ref & out_pr) {
|
||||
unsigned num = f->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
if (m_inconsistent)
|
||||
return;
|
||||
slow_process(save_first && i == 0, f->get_arg(i), m().mk_and_elim(pr, i), d, out_f, out_pr);
|
||||
|
|
@ -206,7 +206,7 @@ void goal::process_and(bool save_first, app * f, proof * pr, expr_dependency * d
|
|||
|
||||
void goal::process_not_or(bool save_first, app * f, proof * pr, expr_dependency * d, expr_ref & out_f, proof_ref & out_pr) {
|
||||
unsigned num = f->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
if (m_inconsistent)
|
||||
return;
|
||||
expr * child = f->get_arg(i);
|
||||
|
|
@ -269,14 +269,14 @@ void goal::assert_expr(expr * f, expr_dependency * d) {
|
|||
|
||||
void goal::get_formulas(ptr_vector<expr> & result) const {
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
result.push_back(form(i));
|
||||
}
|
||||
}
|
||||
|
||||
void goal::get_formulas(expr_ref_vector & result) const {
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
result.push_back(form(i));
|
||||
}
|
||||
}
|
||||
|
|
@ -342,7 +342,7 @@ void goal::reset() {
|
|||
void goal::display(ast_printer & prn, std::ostream & out) const {
|
||||
out << "(goal";
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
out << "\n ";
|
||||
prn.display(out, form(i), 2);
|
||||
}
|
||||
|
|
@ -354,7 +354,7 @@ void goal::display_with_dependencies(ast_printer & prn, std::ostream & out) cons
|
|||
obj_hashtable<expr> to_pp;
|
||||
out << "(goal";
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
out << "\n |-";
|
||||
deps.reset();
|
||||
m().linearize(dep(i), deps);
|
||||
|
|
@ -386,7 +386,7 @@ void goal::display_with_dependencies(std::ostream & out) const {
|
|||
ptr_vector<expr> deps;
|
||||
out << "(goal";
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
out << "\n |-";
|
||||
deps.reset();
|
||||
m().linearize(dep(i), deps);
|
||||
|
|
@ -407,7 +407,7 @@ void goal::display_with_dependencies(std::ostream & out) const {
|
|||
void goal::display_with_proofs(std::ostream& out) const {
|
||||
out << "(goal";
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
out << "\n |-";
|
||||
if (pr(i)) {
|
||||
out << mk_ismt2_pp(pr(i), m(), 4);
|
||||
|
|
@ -428,7 +428,7 @@ void goal::display_with_dependencies(ast_printer_context & ctx) const {
|
|||
void goal::display(std::ostream & out) const {
|
||||
out << "(goal";
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
out << "\n ";
|
||||
out << mk_ismt2_pp(form(i), m(), 2);
|
||||
}
|
||||
|
|
@ -438,7 +438,7 @@ void goal::display(std::ostream & out) const {
|
|||
void goal::display_as_and(std::ostream & out) const {
|
||||
ptr_buffer<expr> args;
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
args.push_back(form(i));
|
||||
expr_ref tmp(m());
|
||||
tmp = m().mk_and(args.size(), args.data());
|
||||
|
|
@ -447,7 +447,7 @@ void goal::display_as_and(std::ostream & out) const {
|
|||
|
||||
void goal::display_ll(std::ostream & out) const {
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
out << mk_ll_pp(form(i), m()) << "\n";
|
||||
}
|
||||
}
|
||||
|
|
@ -465,7 +465,7 @@ unsigned goal::num_exprs() const {
|
|||
expr_fast_mark1 visited;
|
||||
unsigned sz = size();
|
||||
unsigned r = 0;
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
r += get_num_exprs(form(i), visited);
|
||||
}
|
||||
return r;
|
||||
|
|
@ -474,12 +474,12 @@ unsigned goal::num_exprs() const {
|
|||
void goal::shrink(unsigned j) {
|
||||
SASSERT(j <= size());
|
||||
unsigned sz = size();
|
||||
for (unsigned i = j; i < sz; i++)
|
||||
for (unsigned i = j; i < sz; ++i)
|
||||
m().pop_back(m_forms);
|
||||
for (unsigned i = j; i < sz; i++)
|
||||
for (unsigned i = j; i < sz; ++i)
|
||||
m().pop_back(m_proofs);
|
||||
if (unsat_core_enabled())
|
||||
for (unsigned i = j; i < sz; i++)
|
||||
for (unsigned i = j; i < sz; ++i)
|
||||
m().pop_back(m_dependencies);
|
||||
}
|
||||
|
||||
|
|
@ -511,7 +511,7 @@ void goal::elim_true() {
|
|||
*/
|
||||
unsigned goal::get_idx(expr * f) const {
|
||||
unsigned sz = size();
|
||||
for (unsigned j = 0; j < sz; j++) {
|
||||
for (unsigned j = 0; j < sz; ++j) {
|
||||
if (form(j) == f)
|
||||
return j;
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ unsigned goal::get_idx(expr * f) const {
|
|||
unsigned goal::get_not_idx(expr * f) const {
|
||||
expr * atom;
|
||||
unsigned sz = size();
|
||||
for (unsigned j = 0; j < sz; j++) {
|
||||
for (unsigned j = 0; j < sz; ++j) {
|
||||
if (m().is_not(form(j), atom) && atom == f)
|
||||
return j;
|
||||
}
|
||||
|
|
@ -539,7 +539,7 @@ void goal::elim_redundancies() {
|
|||
expr_ref_fast_mark2 pos_lits(m());
|
||||
unsigned sz = size();
|
||||
unsigned j = 0;
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f = form(i);
|
||||
if (m().is_true(f))
|
||||
continue;
|
||||
|
|
@ -593,7 +593,7 @@ void goal::elim_redundancies() {
|
|||
|
||||
bool goal::is_well_formed() const {
|
||||
unsigned sz = size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * t = form(i);
|
||||
if (!::is_well_sorted(m(), t))
|
||||
return false;
|
||||
|
|
@ -618,7 +618,7 @@ goal * goal::translate(ast_translation & translator) const {
|
|||
goal * res = alloc(goal, m_to, m_to.proofs_enabled() && proofs_enabled(), models_enabled(), unsat_core_enabled());
|
||||
|
||||
unsigned sz = m().size(m_forms);
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
res->m().push_back(res->m_forms, translator(m().get(m_forms, i)));
|
||||
res->m().push_back(res->m_proofs, translator(m().get(m_proofs, i)));
|
||||
if (res->unsat_core_enabled())
|
||||
|
|
@ -663,7 +663,7 @@ bool is_equal(goal const & s1, goal const & s2) {
|
|||
expr_fast_mark1 visited1;
|
||||
expr_fast_mark2 visited2;
|
||||
unsigned sz = s1.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f1 = s1.form(i);
|
||||
if (visited1.is_marked(f1))
|
||||
continue;
|
||||
|
|
@ -672,7 +672,7 @@ bool is_equal(goal const & s1, goal const & s2) {
|
|||
}
|
||||
SASSERT(num1 <= sz);
|
||||
SASSERT(0 <= num1);
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * f2 = s2.form(i);
|
||||
if (visited2.is_marked(f2))
|
||||
continue;
|
||||
|
|
@ -688,7 +688,7 @@ bool is_equal(goal const & s1, goal const & s2) {
|
|||
}
|
||||
|
||||
bool goal::is_cnf() const {
|
||||
for (unsigned i = 0; i < size(); i++) {
|
||||
for (unsigned i = 0; i < size(); ++i) {
|
||||
expr * f = form(i);
|
||||
if (m_manager.is_or(f)) {
|
||||
for (expr* lit : *to_app(f))
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ bool test(goal const & g, Predicate & proc) {
|
|||
expr_fast_mark1 visited;
|
||||
try {
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
quick_for_each_expr(proc, visited, g.form(i));
|
||||
}
|
||||
catch (const typename Predicate::found &) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Revision History:
|
|||
void goal_num_occurs::operator()(goal const & g) {
|
||||
expr_fast_mark1 visited;
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
m_pinned.push_back(g.form(i));
|
||||
process(g.form(i), visited);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ void goal_shared_occs::operator()(goal const & g) {
|
|||
m_occs.reset();
|
||||
shared_occs_mark visited;
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr * t = g.form(i);
|
||||
m_occs(t, visited);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ public:
|
|||
result.push_back(g.get());
|
||||
return;
|
||||
}
|
||||
for (unsigned i = 0; i < sz; i++)
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
fmls.push_back(std::make_pair(i, expr_ref(g->form(i), m)));
|
||||
if (!m_solver) {
|
||||
scoped_ptr<solver_factory> f = mk_smt_strategic_solver_factory();
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ public:
|
|||
proc p(g.m(), m_bool, m_family);
|
||||
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));
|
||||
}
|
||||
return result(p.m_counter);
|
||||
|
|
@ -519,7 +519,7 @@ public:
|
|||
expr_fast_mark1 visited;
|
||||
proc p;
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
quick_for_each_expr(p, visited, g.form(i));
|
||||
}
|
||||
return false;
|
||||
|
|
@ -549,7 +549,7 @@ public:
|
|||
expr_fast_mark1 visited;
|
||||
proc p;
|
||||
unsigned sz = g.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
quick_for_each_expr(p, visited, g.form(i));
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < g->size(); i++)
|
||||
for (unsigned i = 0; i < g->size(); ++i)
|
||||
m_sls->assert_expr(g->form(i));
|
||||
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < g->size(); i++)
|
||||
for (unsigned i = 0; i < g->size(); ++i)
|
||||
m_engine->assert_expr(g->form(i));
|
||||
|
||||
lbool res = m_engine->operator()();
|
||||
|
|
@ -177,7 +177,7 @@ public:
|
|||
if (res == l_true) {
|
||||
report_tactic_progress("Number of flips:", stats.m_moves);
|
||||
|
||||
for (unsigned i = 0; i < g->size(); i++)
|
||||
for (unsigned i = 0; i < g->size(); ++i)
|
||||
if (!m_engine->get_mpz_manager().is_one(m_engine->get_value(g->form(i)))) {
|
||||
verbose_stream() << "Terminated before all assertions were SAT!" << std::endl;
|
||||
NOT_IMPLEMENTED_YET();
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public:
|
|||
// running implementation
|
||||
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));
|
||||
scoped_ptr<solver> uffree_solver = setup_sat();
|
||||
lackr imp(m, m_p, m_st, flas, uffree_solver.get());
|
||||
const lbool o = imp.operator()();
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ lbool check_sat(tactic & t, goal_ref & g, model_ref & md, labels_vec & labels, p
|
|||
}
|
||||
TRACE(tactic,
|
||||
tout << "r.size(): " << r.size() << "\n";
|
||||
for (unsigned i = 0; i < r.size(); i++) r[i]->display_with_dependencies(tout););
|
||||
for (unsigned i = 0; i < r.size(); ++i) r[i]->display_with_dependencies(tout););
|
||||
|
||||
if (r.size() > 0) {
|
||||
pr = r[0]->pr(0);
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public:
|
|||
}
|
||||
else {
|
||||
goal_ref_buffer r2;
|
||||
for (unsigned i = 0; i < r1_size; i++) {
|
||||
for (unsigned i = 0; i < r1_size; ++i) {
|
||||
goal_ref g = r1[i];
|
||||
r2.reset();
|
||||
m_t2->operator()(g, r2);
|
||||
|
|
@ -285,7 +285,7 @@ protected:
|
|||
|
||||
public:
|
||||
nary_tactical(unsigned num, tactic * const * ts) {
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
SASSERT(ts[i]);
|
||||
m_ts.push_back(ts[i]);
|
||||
}
|
||||
|
|
@ -347,7 +347,7 @@ public:
|
|||
goal orig(*(in.get()));
|
||||
unsigned sz = m_ts.size();
|
||||
unsigned i;
|
||||
for (i = 0; i < sz; i++) {
|
||||
for (i = 0; i < sz; ++i) {
|
||||
tactic * t = m_ts[i];
|
||||
SASSERT(sz > 0);
|
||||
if (i < sz - 1) {
|
||||
|
|
@ -493,7 +493,7 @@ public:
|
|||
goal_ref_vector in_copies;
|
||||
tactic_ref_vector ts;
|
||||
unsigned sz = m_ts.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
ast_manager * new_m = alloc(ast_manager, m, !m.proof_mode());
|
||||
managers.push_back(new_m);
|
||||
ast_translation translator(m, *new_m);
|
||||
|
|
@ -523,7 +523,7 @@ public:
|
|||
}
|
||||
}
|
||||
if (first) {
|
||||
for (unsigned j = 0; j < sz; j++) {
|
||||
for (unsigned j = 0; j < sz; ++j) {
|
||||
if (i != j) {
|
||||
managers[j]->limit().cancel();
|
||||
}
|
||||
|
|
@ -648,7 +648,7 @@ public:
|
|||
tactic_ref_vector ts2;
|
||||
goal_ref_vector g_copies;
|
||||
|
||||
for (unsigned i = 0; i < r1_size; i++) {
|
||||
for (unsigned i = 0; i < r1_size; ++i) {
|
||||
ast_manager * new_m = alloc(ast_manager, m, !m.proof_mode());
|
||||
managers.push_back(new_m);
|
||||
ast_translation translator(m, *new_m);
|
||||
|
|
@ -715,7 +715,7 @@ public:
|
|||
}
|
||||
|
||||
if (curr_failed) {
|
||||
for (unsigned j = 0; j < r1_size; j++) {
|
||||
for (unsigned j = 0; j < r1_size; ++j) {
|
||||
if (static_cast<unsigned>(i) != j) {
|
||||
managers[j]->limit().cancel();
|
||||
}
|
||||
|
|
@ -736,7 +736,7 @@ public:
|
|||
}
|
||||
}
|
||||
if (first) {
|
||||
for (unsigned j = 0; j < r1_size; j++) {
|
||||
for (unsigned j = 0; j < r1_size; ++j) {
|
||||
if (static_cast<unsigned>(i) != j) {
|
||||
managers[j]->limit().cancel();
|
||||
}
|
||||
|
|
@ -794,12 +794,12 @@ public:
|
|||
return;
|
||||
|
||||
expr_dependency_ref core(m);
|
||||
for (unsigned i = 0; i < r1_size; i++) {
|
||||
for (unsigned i = 0; i < r1_size; ++i) {
|
||||
ast_translation translator(*(managers[i]), m, false);
|
||||
goal_ref_buffer * r = goals_vect[i];
|
||||
unsigned j = result.size();
|
||||
if (r != nullptr) {
|
||||
for (unsigned k = 0; k < r->size(); k++) {
|
||||
for (unsigned k = 0; k < r->size(); ++k) {
|
||||
result.push_back((*r)[k]->translate(translator));
|
||||
}
|
||||
}
|
||||
|
|
@ -940,7 +940,7 @@ class repeat_tactical : public unary_tactical {
|
|||
}
|
||||
|
||||
goal_ref_buffer r2;
|
||||
for (unsigned i = 0; i < r1_size; i++) {
|
||||
for (unsigned i = 0; i < r1_size; ++i) {
|
||||
goal_ref g = r1[i];
|
||||
r2.reset();
|
||||
operator()(depth + 1, g, r2);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class macro_finder_tactic : public tactic {
|
|||
proof_ref_vector proofs(m_manager), new_proofs(m_manager);
|
||||
expr_dependency_ref_vector deps(m_manager), new_deps(m_manager);
|
||||
unsigned size = g->size();
|
||||
for (unsigned idx = 0; idx < size; idx++) {
|
||||
for (unsigned idx = 0; idx < size; ++idx) {
|
||||
forms.push_back(g->form(idx));
|
||||
proofs.push_back(g->pr(idx));
|
||||
deps.push_back(g->dep(idx));
|
||||
|
|
@ -67,14 +67,14 @@ class macro_finder_tactic : public tactic {
|
|||
mf(forms, proofs, deps, new_forms, new_proofs, new_deps);
|
||||
|
||||
g->reset();
|
||||
for (unsigned i = 0; i < new_forms.size(); i++)
|
||||
for (unsigned i = 0; i < new_forms.size(); ++i)
|
||||
g->assert_expr(new_forms.get(i),
|
||||
produce_proofs ? new_proofs.get(i) : nullptr,
|
||||
unsat_core_enabled ? new_deps.get(i) : nullptr);
|
||||
|
||||
generic_model_converter * evmc = alloc(generic_model_converter, mm.get_manager(), "macro_finder");
|
||||
unsigned num = mm.get_num_macros();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr_ref f_interp(mm.get_manager());
|
||||
func_decl * f = mm.get_macro_interpretation(i, f_interp);
|
||||
evmc->add(f, f_interp);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class quasi_macros_tactic : public tactic {
|
|||
expr_dependency_ref_vector deps(m_manager);
|
||||
|
||||
unsigned size = g->size();
|
||||
for (unsigned i = 0; i < size; i++) {
|
||||
for (unsigned i = 0; i < size; ++i) {
|
||||
forms.push_back(g->form(i));
|
||||
proofs.push_back(g->pr(i));
|
||||
deps.push_back(g->dep(i));
|
||||
|
|
@ -70,14 +70,14 @@ class quasi_macros_tactic : public tactic {
|
|||
while (qm(forms, proofs, deps));
|
||||
|
||||
g->reset();
|
||||
for (unsigned i = 0; i < forms.size(); i++)
|
||||
for (unsigned i = 0; i < forms.size(); ++i)
|
||||
g->assert_expr(forms.get(i),
|
||||
produce_proofs ? proofs.get(i) : nullptr,
|
||||
produce_unsat_cores ? deps.get(i, nullptr) : nullptr);
|
||||
|
||||
generic_model_converter * evmc = alloc(generic_model_converter, mm.get_manager(), "quasi_macros");
|
||||
unsigned num = mm.get_num_macros();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
expr_ref f_interp(mm.get_manager());
|
||||
func_decl * f = mm.get_macro_interpretation(i, f_interp);
|
||||
evmc->add(f, f_interp);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public:
|
|||
expr_ref_vector forms(m_manager), new_forms(m_manager);
|
||||
|
||||
unsigned size = g->size();
|
||||
for (unsigned i = 0; i < size; i++)
|
||||
for (unsigned i = 0; i < size; ++i)
|
||||
forms.push_back(g->form(i));
|
||||
|
||||
dem(forms, new_forms);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue