return false;
modelValues.clear();
- modelValues.resize(2 * modelIdx.size());
+ modelValues.resize(modelIdx.size());
for (size_t i = 0; i < modelIdx.size(); i++)
{
using namespace Minisat;
lbool value = minisatSolver->modelValue(minisatVars.at(idx-1));
- if (value == l_Undef) {
- modelValues[i] = false;
- modelValues[modelIdx.size() + i] = true;
- } else {
- modelValues[i] = value == Minisat::lbool(refvalue);
- modelValues[modelIdx.size() + i] = false;
- }
+ modelValues[i] = (value == Minisat::lbool(refvalue));
}
return true;
// If you are planning on using the solver API (and not simply create a CNF) you must use a child class
// of ezSAT that actually implements a solver backend, such as ezMiniSAT (see ezminisat.h).
- // Note: Solvers that can output don't-care values for model variables return a twice as big modelValues
- // vector. The first half contains the values and the second half the don't-care flags.
-
virtual bool solver(const std::vector<int> &modelExpressions, std::vector<bool> &modelValues, const std::vector<int> &assumptions);
bool solve(const std::vector<int> &modelExpressions, std::vector<bool> &modelValues, const std::vector<int> &assumptions) {