42 temp_file_stdout(
"smt2_dec_stdout_",
""),
43 temp_file_stderr(
"smt2_dec_stderr_",
"");
47 std::ofstream problem_out(
48 temp_file_problem(), std::ios_base::out | std::ios_base::trunc);
53 std::vector<std::string> argv;
54 std::string stdin_filename;
59 argv = {
"boolector",
"--smt2", temp_file_problem(),
"-m"};
63 argv = {
"smt2_solver"};
64 stdin_filename = temp_file_problem();
80 argv = {
"cvc4",
"-L",
"smt2", temp_file_problem()};
89 "-preprocessor.toplevel_propagation=true",
90 "-preprocessor.simplification=7",
91 "-dpll.branching_random_frequency=0.01",
92 "-dpll.branching_random_invalidate_phase_cache=true",
93 "-dpll.restart_strategy=3",
94 "-dpll.glucose_var_activity=true",
95 "-dpll.glucose_learnt_minimization=true",
96 "-theory.bv.eager=true",
97 "-theory.bv.bit_blast_mode=1",
98 "-theory.bv.delay_propagated_eqs=true",
100 "-theory.fp.bit_blast_mode=2",
101 "-theory.arr.mode=1"};
103 stdin_filename = temp_file_problem();
109 argv = {
"yices-smt2", temp_file_problem()};
113 argv = {
"z3",
"-smt2", temp_file_problem()};
121 run(argv[0], argv, stdin_filename, temp_file_stdout(), temp_file_stderr());
125 error() <<
"error running SMT2 solver" <<
eom;
129 std::ifstream in(temp_file_stdout());
141 typedef std::unordered_map<irep_idt, irept> valuest;
148 if(!parsed_opt.has_value())
151 const auto &parsed = parsed_opt.value();
153 if(parsed.id()==
"sat")
155 else if(parsed.id()==
"unsat")
158 parsed.id().empty() && parsed.get_sub().size() == 1 &&
159 parsed.get_sub().front().get_sub().size() == 2)
173 parsed.id().empty() && parsed.get_sub().size() == 2 &&
174 parsed.get_sub().front().id() ==
"error")
180 error() <<
"SMT2 solver returned error message:\n"
181 <<
"\t\"" << parsed.get_sub()[1].id() <<
"\"" <<
eom;
190 const irept &value=values[conv_id];
191 assignment.second.value=
parse_rec(value, assignment.second.type);