Z3_solver Z3_API Z3_mk_simple_solver(Z3_context c) { Z3_TRY; LOG_Z3_mk_simple_solver(c); RESET_ERROR_CODE(); Z3_solver_ref * s = alloc(Z3_solver_ref, mk_smt_solver_factory()); mk_c(c)->save_object(s); Z3_solver r = of_solver(s); RETURN_Z3(r); Z3_CATCH_RETURN(0); }
unsigned read_smtlib2_commands(char const * file_name) { g_start_time = clock(); register_on_timeout_proc(on_timeout); signal(SIGINT, on_ctrl_c); cmd_context ctx; ctx.set_solver_factory(mk_smt_strategic_solver_factory()); ctx.set_interpolating_solver_factory(mk_smt_solver_factory()); install_dl_cmds(ctx); install_dbg_cmds(ctx); install_polynomial_cmds(ctx); install_subpaving_cmds(ctx); install_opt_cmds(ctx); g_cmd_context = &ctx; signal(SIGINT, on_ctrl_c); bool result = true; if (file_name) { std::ifstream in(file_name); if (in.bad() || in.fail()) { std::cerr << "(error \"failed to open file '" << file_name << "'\")" << std::endl; exit(ERR_OPEN_FILE); } result = parse_smt2_commands(ctx, in); } else { result = parse_smt2_commands(ctx, std::cin, true); } #pragma omp critical (g_display_stats) { display_statistics(); g_cmd_context = 0; } return result ? 0 : 1; }