{
// check if we should replace the current node
TrustNode newLem;
- Node currt = runCurrent(curr, newLem);
+ bool inQuant, inTerm;
+ RtfTermContext::getFlags(nodeVal, inQuant, inTerm);
+ Debug("ite") << "removeITEs(" << node << ")"
+ << " " << inQuant << " " << inTerm << std::endl;
+ Assert(!inQuant);
+ Node currt = runCurrentInternal(node, inTerm, newLem);
// if we replaced by a skolem, we do not recurse
if (!currt.isNull())
{
return (*itc).second;
}
-Node RemoveTermFormulas::runCurrent(std::pair<Node, uint32_t>& curr,
- TrustNode& newLem)
+TrustNode RemoveTermFormulas::runCurrent(TNode node,
+ bool inTerm,
+ TrustNode& newLem)
{
- TNode node = curr.first;
- uint32_t cval = curr.second;
- bool inQuant, inTerm;
- RtfTermContext::getFlags(curr.second, inQuant, inTerm);
- Debug("ite") << "removeITEs(" << node << ")"
- << " " << inQuant << " " << inTerm << std::endl;
- Assert(!inQuant);
+ Node k = runCurrentInternal(node, inTerm, newLem);
+ if (!k.isNull())
+ {
+ return TrustNode::mkTrustRewrite(node, k, d_tpg.get());
+ }
+ return TrustNode::null();
+}
+Node RemoveTermFormulas::runCurrentInternal(TNode node,
+ bool inTerm,
+ TrustNode& newLem)
+{
NodeManager *nodeManager = NodeManager::currentNM();
TypeNode nodeType = node.getType();
// since a formula-term may rewrite to the same skolem in multiple contexts.
if (isProofEnabled())
{
+ uint32_t cval = RtfTermContext::getValue(false, inTerm);
// justify the introduction of the skolem
// ------------------- MACRO_SR_PRED_INTRO
// t = witness x. x=t
*/
static Node getAxiomFor(Node n);
+ /**
+ * This is called on a term node that occurs in a term context (see
+ * RtfTermContext) if inTerm is true. If node should be replaced by a skolem,
+ * this method returns this skolem k. If this was the first time that node
+ * was encountered, we set newLem to the lemma for the skolem that
+ * axiomatizes k.
+ *
+ * Otherwise, if t should not be replaced in the term context, this method
+ * returns the null node.
+ */
+ TrustNode runCurrent(TNode node, bool inTerm, TrustNode& newLem);
+
private:
typedef context::CDInsertHashMap<
std::pair<Node, uint32_t>,
Node runInternal(TNode assertion,
std::vector<theory::SkolemLemma>& newAsserts);
/**
- * This is called on curr of the form (t, val) where t is a term and val is
- * a term context identifier computed by RtfTermContext. If curr should be
- * replaced by a skolem, this method returns this skolem k. If this was the
- * first time that t was encountered, we set newLem to the lemma for the
- * skolem that axiomatizes k.
+ * This is called on a term node that occurs in a term context (see
+ * RtfTermContext) if inTerm is true. If node should be replaced by a skolem,
+ * this method returns this skolem k. If this was the first time that node
+ * was encountered, we set newLem to the lemma for the skolem that
+ * axiomatizes k.
*
* Otherwise, if t should not be replaced in the term context, this method
* returns the null node.
*/
- Node runCurrent(std::pair<Node, uint32_t>& curr, TrustNode& newLem);
+ Node runCurrentInternal(TNode node, bool inTerm, TrustNode& newLem);
/** Is proof enabled? True if proofs are enabled in any mode. */
bool isProofEnabled() const;
}; /* class RemoveTTE */