43 bool _output_xml_in_refinement)
46 message_handler(_message_handler),
47 output_xml_in_refinement(_output_xml_in_refinement)
52 : decision_procedure_ptr(std::move(p))
57 std::unique_ptr<decision_proceduret> p1,
58 std::unique_ptr<propt> p2)
59 : prop_ptr(std::move(p2)), decision_procedure_ptr(std::move(p1))
64 std::unique_ptr<decision_proceduret> p1,
65 std::unique_ptr<std::ofstream> p2)
66 : ofstream_ptr(std::move(p2)), decision_procedure_ptr(std::move(p1))
73 return *decision_procedure_ptr;
95 const int timeout_seconds =
98 if(timeout_seconds > 0)
105 log.
warning() <<
"cannot set solver time limit on "
111 solver->set_time_limit_seconds(timeout_seconds);
116 std::unique_ptr<decision_proceduret> p)
118 decision_procedure_ptr = std::move(p);
123 prop_ptr = std::move(p);
128 ofstream_ptr = std::move(p);
179 template <
typename SatcheckT>
180 static std::unique_ptr<SatcheckT>
189 hardness_collector->enable_hardness_collection();
190 hardness_collector->with_solver_hardness(
199 <<
"Configured solver does not support --write-solver-stats-to. "
208 auto solver = util_make_unique<solvert>();
222 bool get_array_constraints =
224 auto bv_pointers = util_make_unique<bv_pointerst>(
233 solver->set_decision_procedure(std::move(bv_pointers));
250 return util_make_unique<solvert>(std::move(bv_dimacs), std::move(prop));
264 return util_make_unique<solvert>(std::move(bv_pointers), std::move(prop));
269 std::unique_ptr<propt> prop = [
this]() -> std::unique_ptr<propt> {
276 return make_satcheck_prop<satcheck_no_simplifiert>(
282 info.
prop = prop.get();
294 auto decision_procedure = util_make_unique<bv_refinementt>(info);
296 return util_make_unique<solvert>(
297 std::move(decision_procedure), std::move(prop));
303 std::unique_ptr<solver_factoryt::solvert>
310 info.
prop = prop.get();
320 auto decision_procedure = util_make_unique<string_refinementt>(info);
322 return util_make_unique<solvert>(
323 std::move(decision_procedure), std::move(prop));
326 std::unique_ptr<solver_factoryt::solvert>
338 "required filename not provided",
340 "provide a filename with --outfile");
343 auto smt2_dec = util_make_unique<smt2_dect>(
352 smt2_dec->use_FPA_theory =
true;
355 return util_make_unique<solvert>(std::move(smt2_dec));
357 else if(filename ==
"-")
359 auto smt2_conv = util_make_unique<smt2_convt>(
368 smt2_conv->use_FPA_theory =
true;
371 return util_make_unique<solvert>(std::move(smt2_conv));
376 auto out = util_make_unique<std::ofstream>(
widen(filename));
378 auto out = util_make_unique<std::ofstream>(filename);
384 "failed to open file: " + filename,
"--outfile");
387 auto smt2_conv = util_make_unique<smt2_convt>(
396 smt2_conv->use_FPA_theory =
true;
399 return util_make_unique<solvert>(std::move(smt2_conv), std::move(out));
408 "the chosen solver does not support beautification",
"--beautify");
416 const bool incremental_check =
options.
is_set(
"incremental-check");
421 "the chosen solver does not support incremental solving",
427 "the chosen solver does not support incremental solving",
"--cover");
429 else if(incremental_check)
432 "the chosen solver does not support incremental solving",
433 "--incremental-check");
Abstraction Refinement Loop.
virtual std::string decision_procedure_text() const =0
Return a textual description of the decision procedure.
Thrown when users pass incorrect command line arguments, for example passing no files to analysis or ...
Class that provides messages with a built-in verbosity 'level'.
mstreamt & warning() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
unsigned int get_unsigned_int_option(const std::string &option) const
bool is_set(const std::string &option) const
N.B. opts.is_set("foo") does not imply opts.get_bool_option("foo")
bool get_bool_option(const std::string &option) const
const std::string get_option(const std::string &option) const
signed int get_signed_int_option(const std::string &option) const
void set_decision_procedure(std::unique_ptr< decision_proceduret > p)
decision_proceduret & decision_procedure() const
stack_decision_proceduret & stack_decision_procedure() const
void set_ofstream(std::unique_ptr< std::ofstream > p)
void set_prop(std::unique_ptr< propt > p)
message_handlert & message_handler
std::unique_ptr< solvert > get_external_sat()
std::unique_ptr< solvert > get_default()
solver_factoryt(const optionst &_options, const namespacet &_ns, message_handlert &_message_handler, bool _output_xml_in_refinement)
Note: The solver returned will hold a reference to the namespace ns.
std::unique_ptr< solvert > get_dimacs()
void no_incremental_check()
void set_decision_procedure_time_limit(decision_proceduret &decision_procedure)
Sets the timeout of decision_procedure if the solver-time-limit option has a positive value (in secon...
std::unique_ptr< solvert > get_string_refinement()
the string refinement adds to the bit vector refinement specifications for functions from the Java st...
std::unique_ptr< solvert > get_smt2(smt2_dect::solvert solver)
const bool output_xml_in_refinement
smt2_dect::solvert get_smt2_solver_type() const
Uses the options to pick an SMT 2.0 solver.
virtual std::unique_ptr< solvert > get_solver()
Returns a solvert object.
std::unique_ptr< solvert > get_bv_refinement()
Allows calling an external SAT solver to allow faster integration of newer SAT solvers.
int solver(std::istream &in)
static std::unique_ptr< SatcheckT > make_satcheck_prop(message_handlert &message_handler, const optionst &options)
Solver capability to set resource limits.
#define PRECONDITION(CONDITION)
Decision procedure with incremental solving with contexts and assumptions.
String support via creating string constraints and progressively instantiating the universal constrai...
#define DEFAULT_MAX_NB_REFINEMENT
unsigned max_node_refinement
Max number of times we refine a formula node.
bool refine_arrays
Enable array refinement.
bool refine_arithmetic
Enable arithmetic refinement.
message_handlert * message_handler
A structure that facilitates collecting the complexity statistics from a decision procedure.
void set_outfile(const std::string &file_name)
std::size_t refinement_bound
string_refinementt constructor arguments
std::wstring widen(const char *s)
const char * CBMC_VERSION