42 bool _output_xml_in_refinement)
45 message_handler(_message_handler),
46 output_xml_in_refinement(_output_xml_in_refinement)
51 : decision_procedure_ptr(std::move(p))
56 std::unique_ptr<decision_proceduret> p1,
57 std::unique_ptr<propt> p2)
58 : prop_ptr(std::move(p2)), decision_procedure_ptr(std::move(p1))
63 std::unique_ptr<decision_proceduret> p1,
64 std::unique_ptr<std::ofstream> p2)
65 : ofstream_ptr(std::move(p2)), decision_procedure_ptr(std::move(p1))
72 return *decision_procedure_ptr;
94 const int timeout_seconds =
97 if(timeout_seconds > 0)
104 log.
warning() <<
"cannot set solver time limit on "
110 solver->set_time_limit_seconds(timeout_seconds);
115 std::unique_ptr<decision_proceduret> p)
117 decision_procedure_ptr = std::move(p);
122 prop_ptr = std::move(p);
127 ofstream_ptr = std::move(p);
144 const auto incremental_smt2_solver =
146 if(!incremental_smt2_solver.empty())
182 template <
typename SatcheckT>
183 static std::unique_ptr<SatcheckT>
192 hardness_collector->enable_hardness_collection();
193 hardness_collector->with_solver_hardness(
202 <<
"Configured solver does not support --write-solver-stats-to. "
211 auto solver = util_make_unique<solvert>();
225 bool get_array_constraints =
227 auto bv_pointers = util_make_unique<bv_pointerst>(
236 solver->set_decision_procedure(std::move(bv_pointers));
253 return util_make_unique<solvert>(std::move(bv_dimacs), std::move(prop));
267 return util_make_unique<solvert>(std::move(bv_pointers), std::move(prop));
272 std::unique_ptr<propt> prop = [
this]() -> std::unique_ptr<propt> {
279 return make_satcheck_prop<satcheck_no_simplifiert>(
285 info.
prop = prop.get();
297 auto decision_procedure = util_make_unique<bv_refinementt>(info);
299 return util_make_unique<solvert>(
300 std::move(decision_procedure), std::move(prop));
306 std::unique_ptr<solver_factoryt::solvert>
313 info.
prop = prop.get();
323 auto decision_procedure = util_make_unique<string_refinementt>(info);
325 return util_make_unique<solvert>(
326 std::move(decision_procedure), std::move(prop));
329 std::unique_ptr<solver_factoryt::solvert>
334 return util_make_unique<solvert>(
335 util_make_unique<smt2_incremental_decision_proceduret>(
336 std::move(solver_command)));
339 std::unique_ptr<solver_factoryt::solvert>
351 "required filename not provided",
353 "provide a filename with --outfile");
356 auto smt2_dec = util_make_unique<smt2_dect>(
365 smt2_dec->use_FPA_theory =
true;
368 return util_make_unique<solvert>(std::move(smt2_dec));
370 else if(filename ==
"-")
372 auto smt2_conv = util_make_unique<smt2_convt>(
381 smt2_conv->use_FPA_theory =
true;
384 return util_make_unique<solvert>(std::move(smt2_conv));
389 auto out = util_make_unique<std::ofstream>(
widen(filename));
391 auto out = util_make_unique<std::ofstream>(filename);
397 "failed to open file: " + filename,
"--outfile");
400 auto smt2_conv = util_make_unique<smt2_convt>(
409 smt2_conv->use_FPA_theory =
true;
412 return util_make_unique<solvert>(std::move(smt2_conv), std::move(out));
421 "the chosen solver does not support beautification",
"--beautify");
429 const bool incremental_loop =
options.
is_set(
"incremental-loop");
434 "the chosen solver does not support incremental solving",
440 "the chosen solver does not support incremental solving",
"--cover");
442 else if(incremental_loop)
445 "the chosen solver does not support incremental solving",
446 "--incremental-loop");
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_incremental_smt2(std::string solver_command)
std::unique_ptr< solvert > get_bv_refinement()
Allows calling an external SAT solver to allow faster integration of newer SAT solvers.
Decision procedure with incremental SMT2 solving.
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