| 2406 | } |
| 2407 | |
| 2408 | set<expr> expr::get_apps_of(const char *fn_name, const char *prefix) const { |
| 2409 | C(); |
| 2410 | vector<expr> worklist = { *this }; |
| 2411 | unordered_set<Z3_ast> seen; |
| 2412 | set<expr> ret; |
| 2413 | do { |
| 2414 | auto val = std::move(worklist.back()); |
| 2415 | worklist.pop_back(); |
| 2416 | |
| 2417 | for (unsigned i = 0, e = val.getFnNumArgs(); i < e; ++i) { |
| 2418 | expr arg = val.getFnArg(i); |
| 2419 | if (arg.isApp() && seen.emplace(arg()).second) |
| 2420 | worklist.emplace_back(std::move(arg)); |
| 2421 | } |
| 2422 | |
| 2423 | auto str = val.fn_name(); |
| 2424 | if (str == fn_name || str.starts_with(prefix)) { |
| 2425 | ret.emplace(std::move(val)); |
| 2426 | } |
| 2427 | } while (!worklist.empty()); |
| 2428 | |
| 2429 | return ret; |
| 2430 | } |
| 2431 | |
| 2432 | void expr::printUnsigned(ostream &os) const { |
| 2433 | os << numeral_string(); |
nothing calls this directly
no test coverage detected