Skip to content

Commit da614c6

Browse files
remove m_level attribute, use s->get_scope_level directly
1 parent 6bd46b0 commit da614c6

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/solver/slice_solver.cpp

+8-15
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class slice_solver : public solver {
4040
ptr_vector<func_decl> m_used_funs_trail;
4141
unsigned_vector m_used_funs_lim;
4242
bool m_has_query = false;
43-
unsigned m_level = 0;
4443

4544
ast_mark m_mark;
4645

@@ -210,18 +209,17 @@ class slice_solver : public solver {
210209
return;
211210
unsigned idx = m_new_idx[0];
212211
auto const& f0 = m_assertions[idx];
213-
if (f0.level < m_level) {
212+
if (f0.level < s->get_scope_level()) {
214213

215214
// pop to f.level
216215
// add m_new_idx within f.level
217216
// replay push and assertions above f.level
218-
s->pop(m_level - f0.level);
219-
m_level = f0.level;
217+
s->pop(s->get_scope_level() - f0.level);
220218
unsigned last_idx = idx;
221219
for (unsigned idx : m_new_idx) {
222220
// add only new assertions within lowest scope level.
223221
auto const& f = m_assertions[idx];
224-
if (m_level != f.level)
222+
if (s->get_scope_level() != f.level)
225223
break;
226224
last_idx = idx;
227225
assert_expr(f);
@@ -231,21 +229,18 @@ class slice_solver : public solver {
231229
auto const& f = m_assertions[i];
232230
if (f0.level == f.level)
233231
continue;
234-
while (f.level > m_level) {
232+
while (f.level > s->get_scope_level())
235233
s->push();
236-
++m_level;
237-
}
234+
238235
if (f.active)
239236
assert_expr(f);
240237
}
241238
}
242239
else {
243240
for (unsigned idx : m_new_idx) {
244241
auto const& f = m_assertions[idx];
245-
while (f.level > m_level) {
242+
while (f.level > s->get_scope_level())
246243
s->push();
247-
++m_level;
248-
}
249244
assert_expr(f);
250245
}
251246
}
@@ -294,10 +289,8 @@ class slice_solver : public solver {
294289
unsigned old_sz = m_assertions_lim[m_assertions_lim.size() - n];
295290
for (unsigned i = m_assertions.size(); i-- > old_sz; ) {
296291
auto const& f = m_assertions[i];
297-
if (f.level < m_level) {
298-
s->pop(m_level - f.level);
299-
m_level = f.level;
300-
}
292+
if (f.level < s->get_scope_level())
293+
s->pop(s->get_scope_level() - f.level);
301294
}
302295
m_assertions_lim.shrink(m_assertions_lim.size() - n);
303296
m_assertions.shrink(old_sz);

0 commit comments

Comments
 (0)