mirror of
https://github.com/Z3Prover/z3
synced 2026-05-04 09:25:15 +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
|
|
@ -90,7 +90,7 @@ protected:
|
|||
public:
|
||||
concat_star_converter(T * c1, unsigned num, T * const * c2s, unsigned * szs):
|
||||
m_c1(c1) {
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
T * c2 = c2s[i];
|
||||
if (c2)
|
||||
c2->inc_ref();
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ public:
|
|||
return false;
|
||||
unsigned i;
|
||||
expr* v = nullptr;
|
||||
for (i = 0; i < num; i++) {
|
||||
for (i = 0; i < num; ++i) {
|
||||
expr* arg = args[i];
|
||||
if (uncnstr(arg)) {
|
||||
v = arg;
|
||||
|
|
@ -196,7 +196,7 @@ public:
|
|||
if (!m_mc)
|
||||
return true;
|
||||
ptr_buffer<expr> new_args;
|
||||
for (unsigned j = 0; j < num; j++)
|
||||
for (unsigned j = 0; j < num; ++j)
|
||||
if (j != i)
|
||||
new_args.push_back(args[j]);
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ class bv_expr_inverter : public iexpr_inverter {
|
|||
return false;
|
||||
unsigned i;
|
||||
expr* v = nullptr;
|
||||
for (i = 0; i < num; i++) {
|
||||
for (i = 0; i < num; ++i) {
|
||||
expr* arg = args[i];
|
||||
if (uncnstr(arg)) {
|
||||
v = arg;
|
||||
|
|
@ -283,7 +283,7 @@ class bv_expr_inverter : public iexpr_inverter {
|
|||
if (!m_mc)
|
||||
return true;
|
||||
ptr_buffer<expr> new_args;
|
||||
for (unsigned j = 0; j < num; j++)
|
||||
for (unsigned j = 0; j < num; ++j)
|
||||
if (j != i)
|
||||
new_args.push_back(args[j]);
|
||||
|
||||
|
|
@ -648,7 +648,7 @@ public:
|
|||
if (m.is_uninterp(get_array_range(s)))
|
||||
return false;
|
||||
unsigned arity = get_array_arity(s);
|
||||
for (unsigned i = 0; i < arity; i++)
|
||||
for (unsigned i = 0; i < arity; ++i)
|
||||
if (m.is_uninterp(get_array_domain(s, i)))
|
||||
return false;
|
||||
// building
|
||||
|
|
@ -657,7 +657,7 @@ public:
|
|||
// and d is a term different from (select t i1 ... in)
|
||||
expr_ref_vector new_args(m);
|
||||
new_args.push_back(t);
|
||||
for (unsigned i = 0; i < arity; i++)
|
||||
for (unsigned i = 0; i < arity; ++i)
|
||||
new_args.push_back(m.get_some_value(get_array_domain(s, i)));
|
||||
expr_ref sel(m);
|
||||
sel = a.mk_select(new_args);
|
||||
|
|
@ -692,13 +692,13 @@ public:
|
|||
return true;
|
||||
}
|
||||
func_decl* c = dt.get_accessor_constructor(f);
|
||||
for (unsigned i = 0; i < c->get_arity(); i++)
|
||||
for (unsigned i = 0; i < c->get_arity(); ++i)
|
||||
if (!m.is_fully_interp(c->get_domain(i)))
|
||||
return false;
|
||||
mk_fresh_uncnstr_var_for(f, r);
|
||||
ptr_vector<func_decl> const& accs = *dt.get_constructor_accessors(c);
|
||||
ptr_buffer<expr> new_args;
|
||||
for (unsigned i = 0; i < accs.size(); i++) {
|
||||
for (unsigned i = 0; i < accs.size(); ++i) {
|
||||
if (accs[i] == f)
|
||||
new_args.push_back(r);
|
||||
else
|
||||
|
|
@ -719,7 +719,7 @@ public:
|
|||
for (func_decl* constructor : constructors) {
|
||||
unsigned num = constructor->get_arity();
|
||||
unsigned target = UINT_MAX;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
sort* s_arg = constructor->get_domain(i);
|
||||
if (s == s_arg) {
|
||||
target = i;
|
||||
|
|
@ -732,7 +732,7 @@ public:
|
|||
continue;
|
||||
// use the constructor the distinct term constructor(...,t,...)
|
||||
ptr_buffer<expr> new_args;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
for (unsigned i = 0; i < num; ++i) {
|
||||
if (i == target)
|
||||
new_args.push_back(t);
|
||||
else
|
||||
|
|
@ -965,7 +965,7 @@ expr_inverter::~expr_inverter() {
|
|||
|
||||
|
||||
bool iexpr_inverter::uncnstr(unsigned num, expr * const * args) const {
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
for (unsigned i = 0; i < num; ++i)
|
||||
if (!m_is_var(args[i]))
|
||||
return false;
|
||||
return true;
|
||||
|
|
@ -997,7 +997,7 @@ void iexpr_inverter::add_defs(unsigned num, expr* const* args, expr* u, expr* id
|
|||
if (!m_mc)
|
||||
return;
|
||||
add_def(args[0], u);
|
||||
for (unsigned i = 1; i < num; i++)
|
||||
for (unsigned i = 1; i < num; ++i)
|
||||
add_def(args[i], identity);
|
||||
}
|
||||
|
||||
|
|
@ -1021,7 +1021,7 @@ bool expr_inverter::operator()(func_decl* f, unsigned num, expr* const* args, ex
|
|||
if (num == 0)
|
||||
return false;
|
||||
|
||||
for (unsigned i = 0; i < num; i++)
|
||||
for (unsigned i = 0; i < num; ++i)
|
||||
if (!is_ground(args[i]))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ proof_ref apply(ast_manager & m, proof_converter_ref & pc1, proof_converter_ref_
|
|||
SASSERT(pc1);
|
||||
proof_ref_buffer prs(m);
|
||||
unsigned sz = pc2s.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
proof_ref pr(m);
|
||||
SASSERT(pc2s[i]); // proof production is enabled
|
||||
pr = pc2s[i]->operator()(m, 0, nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue