static bool to_apps(unsigned n, Z3_app const es[], app_ref_vector& result) { for (unsigned i = 0; i < n; ++i) { if (!is_app(to_app(es[i]))) { return false; } result.push_back (to_app (es [i])); } return true; }
static void parse_fml(char const* str, app_ref_vector& vars, expr_ref& fml) { ast_manager& m = fml.get_manager(); fml = parse_fml(m, str); if (is_exists(fml)) { quantifier* q = to_quantifier(fml); for (unsigned i = 0; i < q->get_num_decls(); ++i) { vars.push_back(m.mk_const(q->get_decl_name(i), q->get_decl_sort(i))); } fml = q->get_expr(); var_subst vs(m, true); vs(fml, vars.size(), (expr*const*)vars.c_ptr(), fml); } }