43 temp_file_stdout(
"smt2_dec_stdout_",
""),
44 temp_file_stderr(
"smt2_dec_stderr_",
"");
48 std::ofstream problem_out(
49 temp_file_problem(), std::ios_base::out | std::ios_base::trunc);
54 std::vector<std::string> argv;
55 std::string stdin_filename;
60 argv = {
"boolector",
"--smt2", temp_file_problem(),
"-m"};
64 argv = {
"smt2_solver"};
65 stdin_filename = temp_file_problem();
81 argv = {
"cvc4",
"-L",
"smt2", temp_file_problem()};
90 "-preprocessor.toplevel_propagation=true",
91 "-preprocessor.simplification=7",
92 "-dpll.branching_random_frequency=0.01",
93 "-dpll.branching_random_invalidate_phase_cache=true",
94 "-dpll.restart_strategy=3",
95 "-dpll.glucose_var_activity=true",
96 "-dpll.glucose_learnt_minimization=true",
97 "-theory.bv.eager=true",
98 "-theory.bv.bit_blast_mode=1",
99 "-theory.bv.delay_propagated_eqs=true",
101 "-theory.fp.bit_blast_mode=2",
102 "-theory.arr.mode=1"};
104 stdin_filename = temp_file_problem();
110 argv = {
"yices-smt2", temp_file_problem()};
114 argv = {
"z3",
"-smt2", temp_file_problem()};
122 run(argv[0], argv, stdin_filename, temp_file_stdout(), temp_file_stderr());
131 std::ifstream in(temp_file_stdout());
143 typedef std::unordered_map<irep_idt, irept> valuest;
150 if(!parsed_opt.has_value())
153 const auto &parsed = parsed_opt.value();
155 if(parsed.id()==
"sat")
157 else if(parsed.id()==
"unsat")
160 parsed.id().empty() && parsed.get_sub().size() == 1 &&
161 parsed.get_sub().front().get_sub().size() == 2)
175 parsed.id().empty() && parsed.get_sub().size() == 2 &&
176 parsed.get_sub().front().id() ==
"error")
183 log.error() <<
"SMT2 solver returned error message:\n"
184 <<
"\t\"" << parsed.get_sub()[1].id() <<
"\""
194 const irept &value=values[conv_id];
195 assignment.second.value=
parse_rec(value, assignment.second.type);
resultt
Result of running the decision procedure.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
const irep_idt & id() const
Class that provides messages with a built-in verbosity 'level'.
std::size_t number_of_solver_calls
std::string convert_identifier(const irep_idt &identifier)
exprt parse_rec(const irept &s, const typet &type)
void write_footer(std::ostream &)
std::vector< bool > boolean_assignment
identifier_mapt identifier_map
std::size_t no_boolean_variables
message_handlert & message_handler
std::string decision_procedure_text() const override
Return a textual description of the decision procedure.
resultt dec_solve() override
Run the decision procedure to solve the problem.
resultt read_result(std::istream &in)
std::stringstream stringstream
int run(const std::string &what, const std::vector< std::string > &argv)
optionalt< irept > smt2irep(std::istream &in, message_handlert &message_handler)
returns an irep for an SMT-LIB2 expression read from a given stream returns {} when EOF is encountere...
#define UNREACHABLE
This should be used to mark dead code.
API to expression classes.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.