}
res = res / results[currNode[i]].d_rat;
}
- if (!divbyzero)
+ if (divbyzero)
+ {
+ processUnhandled(
+ currNode, currNodeVal, evalAsNode, results, needsReconstruct);
+ }
+ else
{
results[currNode] = EvalResult(res);
}
{
Trace("evaluator") << "Kind " << currNodeVal.getKind()
<< " not supported" << std::endl;
- results[currNode] = EvalResult();
- evalAsNode[currNode] =
- needsReconstruct ? reconstruct(currNode, results, evalAsNode)
- : currNodeVal;
+ processUnhandled(
+ currNode, currNodeVal, evalAsNode, results, needsReconstruct);
}
}
}
return nn;
}
+void Evaluator::processUnhandled(TNode n,
+ TNode nv,
+ std::unordered_map<TNode, Node>& evalAsNode,
+ std::unordered_map<TNode, EvalResult>& results,
+ bool needsReconstruct) const
+{
+ results[n] = EvalResult();
+ evalAsNode[n] = needsReconstruct ? reconstruct(n, results, evalAsNode) : Node(nv);
+}
+
} // namespace theory
} // namespace cvc5
Node reconstruct(TNode n,
std::unordered_map<TNode, EvalResult>& eresults,
std::unordered_map<TNode, Node>& evalAsNode) const;
+ /**
+ * Process unhandled, called when n cannot be evaluated. This updates
+ * evalAsNode and results with the proper entries for this case. The term
+ * nv is the (Node) value of n if it exists, otherwise if needsReconstruct
+ * is true, the value of n is reconstructed based on evalAsNode and results.
+ */
+ void processUnhandled(TNode n,
+ TNode nv,
+ std::unordered_map<TNode, Node>& evalAsNode,
+ std::unordered_map<TNode, EvalResult>& results,
+ bool needsReconstruct) const;
/** The (optional) rewriter to be used */
Rewriter* d_rr;
/** The cardinality of the alphabet of strings */