Skip to content

Commit 528efbb

Browse files
fixes to failure conditions for unification
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
1 parent fe27ca1 commit 528efbb

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/qe/mbp/mbp_euf.cpp

+13-6
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ namespace mbp {
214214
expr* x = a->get_arg(i);
215215
expr* y = b->get_arg(i);
216216
todo.push_back({x, y});
217-
}
217+
}
218+
bool failed = false;
218219
while (!todo.empty()) {
219220
auto [x, y] = todo.back();
220221
todo.pop_back();
@@ -223,8 +224,10 @@ namespace mbp {
223224
SASSERT(ry);
224225
if (rx == ry)
225226
continue;
226-
if (rx)
227-
break; // fail
227+
if (rx) {
228+
failed = true;
229+
break;
230+
}
228231
if (m_parents[x].size() > 1)
229232
// a crude safey hatch to preserve models
230233
// we could require that every parent of x
@@ -233,16 +236,20 @@ namespace mbp {
233236
break;
234237
expr* s = nullptr;
235238
if (soln.find(x, s)) {
236-
if (s != ry)
239+
if (s != ry) {
240+
failed = true;
237241
break;
242+
}
238243
continue;
239244
}
240245
if (is_var(x)) {
241246
soln.insert(x, ry);
242247
continue;
243248
}
244-
if (!same_decl(x, y))
249+
if (!same_decl(x, y)) {
250+
failed = true;
245251
break;
252+
}
246253
app* ax = to_app(x);
247254
app* ay = to_app(y);
248255
for (unsigned i = 0; i < ax->get_num_args(); ++i)
@@ -257,7 +264,7 @@ namespace mbp {
257264
);
258265

259266

260-
if (todo.empty() && !soln.empty()) {
267+
if (!failed && todo.empty() && !soln.empty()) {
261268
for (auto [key, value] : soln) {
262269
vars.erase(to_app(key));
263270
defs.push_back( { expr_ref(key, m), expr_ref(value, m) });

0 commit comments

Comments
 (0)