SatLiteral l = curr.second.literal;
if(!sign(l)) {
Node n = curr.first;
- SatLiteralValue value = d_satSolver->value(l);
+ SatLiteralValue value = d_satSolver->modelValue(l);
Debug("prop-value") << "'" << l << "' " << value << " " << n << endl;
}
}
Node PropEngine::getValue(TNode node) {
Assert(node.getType().isBoolean());
- SatLiteralValue v = d_satSolver->value(d_cnfStream->getLiteral(node));
+ SatLiteral lit = d_cnfStream->getLiteral(node);
+
+ SatLiteralValue v = d_satSolver->value(lit);
if(v == l_True) {
return NodeManager::currentNM()->mkConst(true);
} else if(v == l_False) {
void setCnfStream(CnfStream* cnfStream);
+ /** Call value() during the search.*/
SatLiteralValue value(SatLiteral l);
+ /** Call value() when the search is done.*/
+ SatLiteralValue modelValue(SatLiteral l);
+
int getLevel() const;
void push();
}
inline SatLiteralValue SatSolver::value(SatLiteral l) {
+ return d_minisat->value(l);
+}
+
+inline SatLiteralValue SatSolver::modelValue(SatLiteral l) {
return d_minisat->modelValue(l);
}
Node Valuation::getSatValue(TNode n) {
if(n.getKind() == kind::NOT) {
- return NodeManager::currentNM()->mkConst(! d_engine->getPropEngine()->getValue(n[0]).getConst<bool>());
+ Node atomRes = d_engine->getPropEngine()->getValue(n[0]);
+ if(atomRes.getKind() == kind::CONST_BOOLEAN){
+ return NodeManager::currentNM()->mkConst(!atomRes.getConst<bool>());
+ }else{
+ Assert(atomRes.isNull());
+ return atomRes;
+ }
} else {
return d_engine->getPropEngine()->getValue(n);
}