RW_IDENTITY,
// theory preRewrite, note this is only intended to be used as an argument
// to THEORY_REWRITE in the final proof. It is not implemented in
- // applyRewrite below, see documentation in proof_rule.h for THEORY_REWRITE.
+ // Rewriter::rewriteViaMethod, see documentation in proof_rule.h for
+ // THEORY_REWRITE.
RW_REWRITE_THEORY_PRE,
// same as above, for theory postRewrite
RW_REWRITE_THEORY_POST,
rargs.push_back(args[3]);
}
}
- builtin::BuiltinProofRuleChecker* builtinPfC =
- static_cast<builtin::BuiltinProofRuleChecker*>(
- d_pnm->getChecker()->getCheckerFor(PfRule::MACRO_SR_EQ_INTRO));
- Node tr = builtinPfC->applyRewrite(ts, idr);
+ Rewriter* rr = d_env.getRewriter();
+ Node tr = rr->rewriteViaMethod(ts, idr);
Trace("smt-proof-pp-debug")
<< "...eq intro rewrite equality is " << ts << " == " << tr << ", from "
<< idr << std::endl;
{
getMethodId(args[1], idr);
}
- builtin::BuiltinProofRuleChecker* builtinPfC =
- static_cast<builtin::BuiltinProofRuleChecker*>(
- d_pnm->getChecker()->getCheckerFor(PfRule::REWRITE));
- Node ret = builtinPfC->applyRewrite(args[0], idr);
+ Rewriter* rr = d_env.getRewriter();
+ Node ret = rr->rewriteViaMethod(args[0], idr);
Node eq = args[0].eqNode(ret);
if (idr == MethodId::RW_REWRITE || idr == MethodId::RW_REWRITE_EQ_EXT)
{
// rewrites from theory::Rewriter
bool isExtEq = (idr == MethodId::RW_REWRITE_EQ_EXT);
// use rewrite with proof interface
- Rewriter* rr = d_env.getRewriter();
TrustNode trn = rr->rewriteWithProof(args[0], isExtEq);
std::shared_ptr<ProofNode> pfn = trn.toProofNode();
if (pfn == nullptr)
MethodId idr)
{
Node nks = applySubstitution(n, exp, ids, ida);
- return applyRewrite(nks, idr);
-}
-
-Node BuiltinProofRuleChecker::applyRewrite(TNode n, MethodId idr)
-{
- return d_env.getRewriter()->rewriteViaMethod(n, idr);
+ return d_env.getRewriter()->rewriteViaMethod(nks, idr);
}
bool BuiltinProofRuleChecker::getSubstitutionForLit(Node exp,
{
return Node::null();
}
- Node res = applyRewrite(args[0], idr);
+ Node res = d_env.getRewriter()->rewriteViaMethod(args[0], idr);
if (res.isNull())
{
return Node::null();
{
Assert(children.empty());
Assert(args.size() == 1);
- Node res = applyRewrite(args[0], MethodId::RW_EVALUATE);
+ Node res = d_env.getRewriter()->rewriteViaMethod(args[0], MethodId::RW_EVALUATE);
if (res.isNull())
{
return Node::null();
BuiltinProofRuleChecker(Env& env);
/** Destructor. */
~BuiltinProofRuleChecker() {}
- /**
- * Apply rewrite on n (in skolem form). This encapsulates the exact behavior
- * of a REWRITE step in a proof.
- *
- * @param n The node to rewrite,
- * @param idr The method identifier of the rewriter, by default RW_REWRITE
- * specifying a call to Rewriter::rewrite.
- * @return The rewritten form of n.
- */
- Node applyRewrite(TNode n, MethodId idr = MethodId::RW_REWRITE);
/**
* Get substitution for literal exp. Updates vars/subs to the substitution
* specified by exp for the substitution method ids.