Skip to content

Commit

Permalink
fix #5980
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Apr 19, 2022
1 parent b7169e2 commit a180254
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ast/recfun_decl_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ namespace recfun {
}

// does `e` contain any `ite` construct?
// subject to the then/else branch using a recursive call,
// but the guard does not.
bool def::contains_ite(util& u, expr * e) {
struct ite_find_p : public i_expr_pred {
ast_manager & m;
def& d;
util& u;
ite_find_p(ast_manager & m, def& d, util& u) : m(m), d(d), u(u) {}
bool operator()(expr * e) override { return m.is_ite(e) && d.contains_def(u, e); }
bool operator()(expr * e) override { return m.is_ite(e) && !d.contains_def(u, to_app(e)->get_arg(0)) && d.contains_def(u, e); }
};
// ignore ites under quantifiers.
// this is redundant as the code
Expand Down Expand Up @@ -273,9 +275,9 @@ namespace recfun {
// explore arguments
for (expr * arg : *to_app(e)) {
if (contains_ite(u, arg)) {
for (expr * arg : *to_app(e))
if (contains_ite(u, arg))
stack.push_back(arg);
}
}
}
}
}
Expand Down

0 comments on commit a180254

Please sign in to comment.