From 4d433317483d5db3087037619bb681a6e917fc7d Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 25 Nov 2013 02:50:34 +0100 Subject: [PATCH] Removed undef feature from ezsat api --- libs/ezsat/ezminisat.cc | 10 ++-------- libs/ezsat/ezsat.h | 3 --- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/libs/ezsat/ezminisat.cc b/libs/ezsat/ezminisat.cc index 05eb2af5d..d545834cf 100644 --- a/libs/ezsat/ezminisat.cc +++ b/libs/ezsat/ezminisat.cc @@ -146,7 +146,7 @@ contradiction: return false; modelValues.clear(); - modelValues.resize(2 * modelIdx.size()); + modelValues.resize(modelIdx.size()); for (size_t i = 0; i < modelIdx.size(); i++) { @@ -158,13 +158,7 @@ contradiction: 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; diff --git a/libs/ezsat/ezsat.h b/libs/ezsat/ezsat.h index 3fb5fcaf6..abec0b239 100644 --- a/libs/ezsat/ezsat.h +++ b/libs/ezsat/ezsat.h @@ -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 // 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 &modelExpressions, std::vector &modelValues, const std::vector &assumptions); bool solve(const std::vector &modelExpressions, std::vector &modelValues, const std::vector &assumptions) {