// in the "non-variable Boolean term within term" case below.
if (node.getKind() == kind::ITE && !nodeType.isBoolean())
{
- // Here, we eliminate the ITE if we are not Boolean and if we do not contain
- // a free variable.
- if (!inQuant || !expr::hasFreeVar(node))
+ // Here, we eliminate the ITE if we are not Boolean and if we are
+ // not in a quantified formula. This policy should be in sync with
+ // the policy for when to apply theory preprocessing to terms, see PR
+ // #5497.
+ if (!inQuant)
{
skolem = getSkolemForNode(node);
if (skolem.isNull())
#include "expr/attribute.h"
#include "expr/lazy_proof.h"
#include "expr/node.h"
-#include "expr/node_algorithm.h"
#include "expr/node_builder.h"
#include "expr/node_visitor.h"
#include "options/bv_options.h"
Node TheoryEngine::ensureLiteral(TNode n) {
- Debug("ensureLiteral") << "rewriting: " << n << std::endl;
+ Trace("ensureLiteral") << "ensureLiteral rewriting: " << n << std::endl;
Node rewritten = Rewriter::rewrite(n);
- Debug("ensureLiteral") << " got: " << rewritten << std::endl;
+ Trace("ensureLiteral") << " got: " << rewritten << std::endl;
std::vector<TrustNode> newLemmas;
std::vector<Node> newSkolems;
TrustNode tpn = d_tpp.preprocess(n, newLemmas, newSkolems, true);
// send lemmas corresponding to the skolems introduced by preprocessing n
for (const TrustNode& tnl : newLemmas)
{
+ Trace("ensureLiteral") << " lemma: " << tnl.getNode() << std::endl;
lemma(tnl, LemmaProperty::NONE);
}
Node preprocessed = tpn.isNull() ? rewritten : tpn.getNode();
- Debug("ensureLiteral") << "preprocessed: " << preprocessed << std::endl;
+ Trace("ensureLiteral") << "ensureLiteral preprocessed: " << preprocessed
+ << std::endl;
d_propEngine->ensureLiteral(preprocessed);
return preprocessed;
}
// get the node
Node node = tlemma.getNode();
Node lemma = tlemma.getProven();
+ Trace("te-lemma") << "Lemma, input: " << lemma << std::endl;
Assert(!expr::hasFreeVar(lemma));
}
// now, send the lemmas to the prop engine
+ Trace("te-lemma") << "Lemma, output: " << tlemma.getProven() << std::endl;
d_propEngine->assertLemma(tlemma.getProven(), false, removable);
for (size_t i = 0, lsize = newLemmas.size(); i < lsize; ++i)
{
+ Trace("te-lemma") << "Lemma, new lemma: " << newLemmas[i].getProven()
+ << std::endl;
d_propEngine->assertLemma(newLemmas[i].getProven(), false, removable);
}
}
if (node == retNode)
{
+ Trace("tpp-debug") << "...TheoryPreprocessor::preprocess returned no change"
+ << std::endl;
// no change
Assert(newLemmas.empty());
return TrustNode::null();
Assert(!isProofEnabled() || newLemmas[i].getGenerator() != nullptr);
newLemmas[i].debugCheckClosed("tpp-debug", "TheoryPreprocessor::lemma_new");
}
- Trace("tpp-debug") << "Preprocessed: " << node << " " << retNode << std::endl;
+ Trace("tpp-debug") << "...TheoryPreprocessor::preprocess returned "
+ << tret.getNode() << std::endl;
return tret;
}