summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-09-08 02:00:23 -0500
committerGitHub <noreply@github.com>2021-09-08 00:00:23 -0700
commit692838a334b6a0e68ecfe7e9f473a834f99ba5e6 (patch)
treeb748f20b0801428fea627ed7a426842df2497e10
parente607ce390cff26aa14862b2f9c1da727d14cdf68 (diff)
Use rewriteViaMethod instead of accessing builtin proof checker (#7146)
-rw-r--r--src/proof/method_id.h3
-rw-r--r--src/smt/proof_post_processor.cpp13
-rw-r--r--src/theory/builtin/proof_checker.cpp11
-rw-r--r--src/theory/builtin/proof_checker.h10
4 files changed, 9 insertions, 28 deletions
diff --git a/src/proof/method_id.h b/src/proof/method_id.h
index b353232f4..fe7a9a90d 100644
--- a/src/proof/method_id.h
+++ b/src/proof/method_id.h
@@ -49,7 +49,8 @@ enum class MethodId : uint32_t
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,
diff --git a/src/smt/proof_post_processor.cpp b/src/smt/proof_post_processor.cpp
index 9db8f1020..f5d0e8ee8 100644
--- a/src/smt/proof_post_processor.cpp
+++ b/src/smt/proof_post_processor.cpp
@@ -477,10 +477,8 @@ Node ProofPostprocessCallback::expandMacros(PfRule id,
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;
@@ -954,17 +952,14 @@ Node ProofPostprocessCallback::expandMacros(PfRule id,
{
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)
diff --git a/src/theory/builtin/proof_checker.cpp b/src/theory/builtin/proof_checker.cpp
index e51db4ce3..d71b3635b 100644
--- a/src/theory/builtin/proof_checker.cpp
+++ b/src/theory/builtin/proof_checker.cpp
@@ -67,12 +67,7 @@ Node BuiltinProofRuleChecker::applySubstitutionRewrite(
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,
@@ -254,7 +249,7 @@ Node BuiltinProofRuleChecker::checkInternal(PfRule id,
{
return Node::null();
}
- Node res = applyRewrite(args[0], idr);
+ Node res = d_env.getRewriter()->rewriteViaMethod(args[0], idr);
if (res.isNull())
{
return Node::null();
@@ -265,7 +260,7 @@ Node BuiltinProofRuleChecker::checkInternal(PfRule id,
{
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();
diff --git a/src/theory/builtin/proof_checker.h b/src/theory/builtin/proof_checker.h
index bb746e467..8b3988f27 100644
--- a/src/theory/builtin/proof_checker.h
+++ b/src/theory/builtin/proof_checker.h
@@ -40,16 +40,6 @@ class BuiltinProofRuleChecker : public ProofRuleChecker
/** 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.
*/
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback