From: Dejan Jovanović Date: Wed, 28 Mar 2012 01:28:08 +0000 (+0000) Subject: adding an extra cache check in the rewriter, speeds things a bit X-Git-Tag: cvc5-1.0.0~8260 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2eec05ba299532c663fffc4262467a9b6771c2c4;p=cvc5.git adding an extra cache check in the rewriter, speeds things a bit http://church.cims.nyu.edu/regress-results/compare_jobs.php?job_id=3828&category=&p=5&reference_id=3820 --- diff --git a/src/theory/rewriter.cpp b/src/theory/rewriter.cpp index fddbbcd13..4f9075f52 100644 --- a/src/theory/rewriter.cpp +++ b/src/theory/rewriter.cpp @@ -71,6 +71,12 @@ Node Rewriter::rewriteTo(theory::TheoryId theoryId, Node node) { Trace("rewriter") << "Rewriter::rewriteTo(" << theoryId << "," << node << ")"<< std::endl; + // Check if it's been cached already + Node cached = getPostRewriteCache(theoryId, node); + if (!cached.isNull()) { + return cached; + } + // Put the node on the stack in order to start the "recursive" rewrite vector rewriteStack; rewriteStack.push_back(RewriteStackElement(node, theoryId));