{
// Setup information about n, including if it is equal to a constant.
ExtfInfoTmp& einfo = d_extfInfoTmp[n];
+ Assert(einfo.d_exp.empty());
Node r = d_state.getRepresentative(n);
einfo.d_const = d_bsolver.getConstantEqc(r);
// Get the current values of the children of n.
Node sn = nm->mkNode(n.getKind(), schildren);
Trace("strings-extf-debug")
<< "Check extf " << n << " == " << sn
- << ", constant = " << einfo.d_const << ", effort=" << effort << "..."
- << std::endl;
+ << ", constant = " << einfo.d_const << ", effort=" << effort
+ << ", exp " << exp << std::endl;
einfo.d_exp.insert(einfo.d_exp.end(), exp.begin(), exp.end());
// inference is rewriting the substituted node
Node nrc = Rewriter::rewrite(sn);
return;
}
NodeManager* nm = NodeManager::currentNM();
- Trace("strings-extf-infer") << "checkExtfInference: " << n << " : " << nr
- << " == " << in.d_const << std::endl;
+ Trace("strings-extf-infer")
+ << "checkExtfInference: " << n << " : " << nr << " == " << in.d_const
+ << " with exp " << in.d_exp << std::endl;
// add original to explanation
if (n.getType().isBoolean())
if (inferEqrr != inferEqr)
{
inferEqrr = Rewriter::rewrite(inferEqrr);
- Trace("strings-extf-infer") << "checkExtfInference: " << inferEq
- << " ...reduces to " << inferEqrr << std::endl;
+ Trace("strings-extf-infer")
+ << "checkExtfInference: " << inferEq << " ...reduces to " << inferEqrr
+ << " with explanation " << in.d_exp << std::endl;
d_im.sendInternalInference(in.d_exp, inferEqrr, InferenceId::STRINGS_EXTF_EQ_REW);
}
}
Node src = ps.d_children[ps.d_children.size() - 1];
std::vector<Node> expe(ps.d_children.begin(), ps.d_children.end() - 1);
// start with a default rewrite
+ Trace("strings-ipc-core")
+ << "Generate proof for STRINGS_EXTF_EQ_REW, starting with " << src
+ << std::endl;
Node mainEqSRew = psb.applyPredElim(src, expe);
+ Trace("strings-ipc-core")
+ << "...after pred elim: " << mainEqSRew << std::endl;
if (mainEqSRew == conc)
{
+ Trace("strings-ipc-core") << "...success" << std::endl;
useBuffer = true;
break;
}
+ else if (mainEqSRew.getKind() != EQUAL)
+ {
+ // Note this can happen in rare cases where substitution+rewriting
+ // is more powerful than congruence+rewriting. We fail to reconstruct
+ // the proof in this case.
+ Trace("strings-ipc-core")
+ << "...failed, not equality after rewriting" << std::endl;
+ break;
+ }
// may need the "extended equality rewrite"
Node mainEqSRew2 = psb.applyPredElim(mainEqSRew,
{},
MethodId::SB_DEFAULT,
MethodId::SBA_SEQUENTIAL,
MethodId::RW_REWRITE_EQ_EXT);
+ Trace("strings-ipc-core")
+ << "...after extended equality rewrite: " << mainEqSRew2 << std::endl;
if (mainEqSRew2 == conc)
{
useBuffer = true;