{
return options::unsatCores() && options::incrementalSolving();
}
+
+//=================================================================================================
+// Helper functions for decision tree tracing
+
+// Writes to Trace macro for decision tree tracing
+static inline void dtviewDecisionHelper(size_t level,
+ const Node& node,
+ const char* decisiontype)
+{
+ Trace("dtview") << std::string(level - (options::incrementalSolving() ? 1 : 0), '*')
+ << " " << node << " :" << decisiontype << "-DECISION:" << std::endl;
+}
+
+// Writes to Trace macro for propagation tracing
+static inline void dtviewPropagationHeaderHelper(size_t level)
+{
+ Trace("dtview::prop") << std::string(level + 1 - (options::incrementalSolving() ? 1 : 0),
+ '*')
+ << " /Propagations/" << std::endl;
+}
+
} // namespace
//=================================================================================================
<< "getNextTheoryDecisionRequest(): now deciding on " << nextLit
<< std::endl;
decisions++;
+
+ // org-mode tracing -- theory decision
+ if (Trace.isOn("dtview"))
+ {
+ dtviewDecisionHelper(context->getLevel(),
+ proxy->getNode(MinisatSatSolver::toSatLiteral(nextLit)),
+ "THEORY");
+ }
+
+ if (Trace.isOn("dtview::prop"))
+ {
+ dtviewPropagationHeaderHelper(context->getLevel());
+ }
+
return nextLit;
} else {
Debug("theoryDecision")
decisions++;
Var next = var(nextLit);
if(polarity[next] & 0x2) {
- return mkLit(next, polarity[next] & 0x1);
- } else {
- return nextLit;
+ nextLit = mkLit(next, polarity[next] & 0x1);
}
+
+ // org-mode tracing -- decision engine decision
+ if (Trace.isOn("dtview"))
+ {
+ dtviewDecisionHelper(context->getLevel(),
+ proxy->getNode(MinisatSatSolver::toSatLiteral(nextLit)),
+ "DE");
+ }
+
+ if (Trace.isOn("dtview::prop"))
+ {
+ dtviewPropagationHeaderHelper(context->getLevel());
+ }
+
+ return nextLit;
}
Var next = var_Undef;
// Check with decision engine if it can tell polarity
lbool dec_pol = MinisatSatSolver::toMinisatlbool
(proxy->getDecisionPolarity(MinisatSatSolver::toSatVariable(next)));
+ Lit decisionLit;
if(dec_pol != l_Undef) {
Assert(dec_pol == l_True || dec_pol == l_False);
- return mkLit(next, (dec_pol == l_True) );
+ decisionLit = mkLit(next, (dec_pol == l_True));
}
- // If it can't use internal heuristic to do that
- return mkLit(next, rnd_pol ? drand(random_seed) < 0.5 : (polarity[next] & 0x1));
+ else
+ {
+ // If it can't use internal heuristic to do that
+ decisionLit = mkLit(
+ next, rnd_pol ? drand(random_seed) < 0.5 : (polarity[next] & 0x1));
+ }
+
+ // org-mode tracing -- decision engine decision
+ if (Trace.isOn("dtview"))
+ {
+ dtviewDecisionHelper(context->getLevel(),
+ proxy->getNode(MinisatSatSolver::toSatLiteral(decisionLit)),
+ "DE");
+ }
+
+ if (Trace.isOn("dtview::prop"))
+ {
+ dtviewPropagationHeaderHelper(context->getLevel());
+ }
+
+ return decisionLit;
}
}
void EchoCommand::invoke(SmtEngine* smtEngine, std::ostream& out)
{
out << d_output << std::endl;
+ Trace("dtview::command") << "* ~COMMAND: echo |" << d_output << "|~"
+ << std::endl;
d_commandStatus = CommandSuccess::instance();
printResult(out,
smtEngine->getOption("command-verbosity:" + getCommandName())
Expr CheckSatCommand::getExpr() const { return d_expr; }
void CheckSatCommand::invoke(SmtEngine* smtEngine)
{
+ Trace("dtview::command") << "* ~COMMAND: " << getCommandName() << "~"
+ << std::endl;
try
{
d_result = smtEngine->checkSat(d_expr);
}
else
{
+ Trace("dtview::command") << "* RESULT: " << d_result << std::endl;
out << d_result << endl;
}
}
void CheckSatAssumingCommand::invoke(SmtEngine* smtEngine)
{
+ Trace("dtview::command") << "* ~COMMAND: (check-sat-assuming ( " << d_terms
+ << " )~" << std::endl;
try
{
d_result = smtEngine->checkSat(d_terms);
Result CheckSatAssumingCommand::getResult() const
{
+ Trace("dtview::command") << "* ~RESULT: " << d_result << "~" << std::endl;
return d_result;
}