17#include <core/Solver.h>
18#include <simp/SimpSolver.h>
21#error "Expected HAVE_GLUCOSE"
24void convert(
const bvt &bv, Glucose::vec<Glucose::Lit> &dest)
26 dest.capacity(bv.size());
37 dest.capacity(bv.size());
56 if(
a.var_no()>=(
unsigned)
solver->model.size())
82 solver->setPolarity(
a.var_no(), value);
84 catch(Glucose::OutOfMemoryException)
86 log.error() <<
"SAT checker ran out of memory" <<
messaget::eom;
87 status = statust::ERROR;
88 throw std::bad_alloc();
94 return "Glucose Syrup without simplifier";
99 return "Glucose Syrup with simplifier";
105 while((
unsigned)
solver->nVars()<no_variables())
124 "variable not added yet");
128 Glucose::vec<Glucose::Lit>
c;
152 solver_hardness->register_clause(
158 catch(Glucose::OutOfMemoryException)
160 log.error() <<
"SAT checker ran out of memory" <<
messaget::eom;
161 status = statust::ERROR;
162 throw std::bad_alloc();
172 log.statistics() << (no_variables() - 1) <<
" variables, "
181 log.status() <<
"SAT checker inconsistent: instance is UNSATISFIABLE"
189 for(
const auto &
literal : assumptions)
197 log.status() <<
"got FALSE as assumption: instance is UNSATISFIABLE"
207 log.status() <<
"SAT checker: instance is SATISFIABLE"
209 status = statust::SAT;
210 return resultt::P_SATISFIABLE;
214 log.status() <<
"SAT checker: instance is UNSATISFIABLE"
220 status = statust::UNSAT;
221 return resultt::P_UNSATISFIABLE;
223 catch(Glucose::OutOfMemoryException)
225 log.error() <<
"SAT checker ran out of memory" <<
messaget::eom;
226 status = statust::ERROR;
227 throw std::bad_alloc();
238 unsigned v =
a.var_no();
239 bool sign =
a.sign();
242 solver->model.growTo(v + 1);
244 solver->model[v] = Glucose::lbool(value);
246 catch(Glucose::OutOfMemoryException)
248 log.error() <<
"SAT checker ran out of memory" <<
messaget::eom;
249 status = statust::ERROR;
250 throw std::bad_alloc();
269 for(
int i=0; i<
solver->conflict.size(); i++)
270 if(var(
solver->conflict[i])==v)
286 solver->setFrozen(
a.var_no(),
true);
289 catch(Glucose::OutOfMemoryException)
293 throw std::bad_alloc();
301 return solver->isEliminated(
a.var_no());
static bool convert(const irep_idt &identifier, const std::ostringstream &s, symbol_table_baset &symbol_table, message_handlert &message_handler)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
bool is_in_conflict(literalt a) const override
Returns true if an assumption is in the final conflict.
~satcheck_glucose_baset() override
A default destructor defined in the .cpp is used to ensure the unique_ptr to the solver is correctly ...
void lcnf(const bvt &bv) override
std::unique_ptr< Glucose::SimpSolver > solver
void set_polarity(literalt a, bool value)
satcheck_glucose_baset(message_handlert &message_handler)
tvt l_get(literalt a) const override
resultt do_prop_solve(const bvt &assumptions) override
void set_assignment(literalt a, bool value) override
std::string solver_text() const override
void set_frozen(literalt a) override
std::string solver_text() const override
bool is_eliminated(literalt a) const
std::vector< literalt > bvt
std::unique_ptr< T > util_make_unique(Ts &&... ts)
void convert(const bvt &bv, Glucose::vec< Glucose::Lit > &dest)
void convert_assumptions(const bvt &bv, Glucose::vec< Glucose::Lit > &dest)
void solver(std::vector< framet > &frames, const std::unordered_set< symbol_exprt, irep_hash > &address_taken, const solver_optionst &solver_options, const namespacet &ns, std::vector< propertyt > &properties, std::size_t property_index)
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.