mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-25 12:36:02 +00:00
Added ezSAT api support for don't care values in models
This commit is contained in:
parent
b7ba90910d
commit
41932e8b64
3 changed files with 23 additions and 6 deletions
|
@ -108,14 +108,25 @@ contradiction:
|
|||
return false;
|
||||
|
||||
modelValues.clear();
|
||||
modelValues.reserve(modelIdx.size());
|
||||
for (auto idx : modelIdx) {
|
||||
modelValues.resize(2 * modelIdx.size());
|
||||
|
||||
for (size_t i = 0; i < modelIdx.size(); i++)
|
||||
{
|
||||
int idx = modelIdx[i];
|
||||
bool refvalue = true;
|
||||
|
||||
if (idx < 0)
|
||||
idx = -idx, refvalue = false;
|
||||
auto value = minisatSolver->modelValue(minisatVars.at(idx-1));
|
||||
// FIXME: Undef values
|
||||
modelValues.push_back(value == Minisat::lbool(refvalue));
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue