@@ -129,9 +129,9 @@ void peq::mk_peq(app_ref &result) {
129
129
ptr_vector<expr> args;
130
130
args.push_back (m_lhs);
131
131
args.push_back (m_rhs);
132
- for (unsigned i = 0 ; i < m_num_indices; i++) {
133
- args.push_back (m_diff_indices. get (i) );
134
- }
132
+ for (auto idx : m_diff_indices)
133
+ args.push_back (idx );
134
+
135
135
m_peq = m.mk_app (m_decl, args.size (), args.data ());
136
136
}
137
137
result = m_peq;
@@ -144,13 +144,11 @@ void peq::mk_eq(app_ref_vector &aux_consts, app_ref &result,
144
144
if (!stores_on_rhs) { std::swap (lhs, rhs); }
145
145
// lhs = (...(store (store rhs i0 v0) i1 v1)...)
146
146
sort *val_sort = get_array_range (lhs->get_sort ());
147
- expr_ref_vector::iterator end = m_diff_indices.end ();
148
- for (expr_ref_vector::iterator it = m_diff_indices.begin (); it != end;
149
- it++) {
147
+ for (auto it : m_diff_indices) {
150
148
app *val = m.mk_fresh_const (" diff" , val_sort);
151
149
ptr_vector<expr> store_args;
152
150
store_args.push_back (rhs);
153
- store_args.push_back (* it);
151
+ store_args.push_back (it);
154
152
store_args.push_back (val);
155
153
rhs = m_arr_u.mk_store (store_args);
156
154
aux_consts.push_back (val);
@@ -333,19 +331,19 @@ class arith_project_util {
333
331
m_strict.reset ();
334
332
m_eq.reset ();
335
333
336
- for (unsigned i = 0 ; i < lits. size (); ++i ) {
334
+ for (auto lit : lits) {
337
335
rational c (0 ), d (0 );
338
336
expr_ref t (m);
339
337
bool is_strict = false ;
340
338
bool is_eq = false ;
341
339
bool is_diseq = false ;
342
- if (!(*m_var)(lits. get (i) )) {
343
- new_lits.push_back (lits. get (i) );
340
+ if (!(*m_var)(lit )) {
341
+ new_lits.push_back (lit );
344
342
continue ;
345
343
}
346
- if (is_linear (lits. get (i) , c, t, d, is_strict, is_eq, is_diseq)) {
344
+ if (is_linear (lit , c, t, d, is_strict, is_eq, is_diseq)) {
347
345
if (c.is_zero ()) {
348
- m_rw (lits. get (i) , t);
346
+ m_rw (lit , t);
349
347
new_lits.push_back (t);
350
348
}
351
349
else if (is_eq) {
@@ -354,12 +352,13 @@ class arith_project_util {
354
352
eq_term = mk_mul (-(rational::one () / c), t);
355
353
use_eq = true ;
356
354
}
357
- m_lits.push_back (lits. get (i) );
355
+ m_lits.push_back (lit );
358
356
m_coeffs.push_back (c);
359
357
m_terms.push_back (t);
360
358
m_strict.push_back (false );
361
359
m_eq.push_back (true );
362
- } else {
360
+ }
361
+ else {
363
362
if (is_diseq) {
364
363
// c*x + t != 0
365
364
// find out whether c*x + t < 0, or c*x + t > 0
@@ -376,7 +375,7 @@ class arith_project_util {
376
375
}
377
376
is_strict = true ;
378
377
}
379
- m_lits.push_back (lits. get (i) );
378
+ m_lits.push_back (lit );
380
379
m_coeffs.push_back (c);
381
380
m_terms.push_back (t);
382
381
m_strict.push_back (is_strict);
@@ -390,7 +389,7 @@ class arith_project_util {
390
389
}
391
390
else
392
391
return false ;
393
- }
392
+ }
394
393
if (use_eq) {
395
394
TRACE (" qe" , tout << " Using equality term: " << mk_pp (eq_term, m)
396
395
<< " \n " ;);
@@ -488,7 +487,8 @@ class arith_project_util {
488
487
m_strict.push_back (false );
489
488
m_eq.push_back (true );
490
489
m_divs.push_back (d);
491
- } else {
490
+ }
491
+ else {
492
492
TRACE (" qe" , tout << " not an equality term\n " ;);
493
493
if (is_diseq) {
494
494
// c*x + t != 0
@@ -513,18 +513,18 @@ class arith_project_util {
513
513
(!is_strict &&
514
514
r <= rational::zero ())) { // literal true in the
515
515
// model
516
- if (c.is_pos ()) {
516
+ if (c.is_pos ())
517
517
++num_pos;
518
- } else {
519
- ++num_neg;
520
- }
518
+ else
519
+ ++num_neg;
521
520
}
522
521
}
523
522
}
524
523
TRACE (" qe" , tout << " c: " << c << " \n " ;
525
524
tout << " t: " << mk_pp (t, m) << " \n " ;
526
525
tout << " d: " << d << " \n " ;);
527
- } else
526
+ }
527
+ else
528
528
return false ;
529
529
}
530
530
@@ -573,13 +573,14 @@ class arith_project_util {
573
573
map.insert (m_var->x (), eq_term, nullptr );
574
574
TRACE (" qe" , tout << " Using equality term: " << mk_pp (eq_term, m)
575
575
<< " \n " ;);
576
- } else {
576
+ }
577
+ else {
577
578
// find substitution term for (lcm_coeffs * x)
578
- if (m_coeffs[eq_idx].is_pos ()) {
579
+ if (m_coeffs[eq_idx].is_pos ())
579
580
x_term_val = a.mk_uminus (m_terms.get (eq_idx));
580
- } else {
581
+ else
581
582
x_term_val = m_terms.get (eq_idx);
582
- }
583
+
583
584
m_rw (x_term_val);
584
585
TRACE (" qe" , tout << " Using equality literal: "
585
586
<< mk_pp (m_lits.get (eq_idx), m) << " \n " ;
0 commit comments