Removed undef feature from ezsat api

This commit is contained in:
Clifford Wolf 2013-11-25 02:50:34 +01:00
parent 76f7c10cfc
commit 4d43331748
2 changed files with 2 additions and 11 deletions

View File

@ -146,7 +146,7 @@ contradiction:
return false; return false;
modelValues.clear(); modelValues.clear();
modelValues.resize(2 * modelIdx.size()); modelValues.resize(modelIdx.size());
for (size_t i = 0; i < modelIdx.size(); i++) for (size_t i = 0; i < modelIdx.size(); i++)
{ {
@ -158,13 +158,7 @@ contradiction:
using namespace Minisat; using namespace Minisat;
lbool value = minisatSolver->modelValue(minisatVars.at(idx-1)); lbool value = minisatSolver->modelValue(minisatVars.at(idx-1));
if (value == l_Undef) { modelValues[i] = (value == Minisat::lbool(refvalue));
modelValues[i] = false;
modelValues[modelIdx.size() + i] = true;
} else {
modelValues[i] = value == Minisat::lbool(refvalue);
modelValues[modelIdx.size() + i] = false;
}
} }
return true; return true;

View File

@ -101,9 +101,6 @@ public:
// If you are planning on using the solver API (and not simply create a CNF) you must use a child class // 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). // 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); 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) { bool solve(const std::vector<int> &modelExpressions, std::vector<bool> &modelValues, const std::vector<int> &assumptions) {