adding an extra cache check in the rewriter, speeds things a bit
authorDejan Jovanović <dejan.jovanovic@gmail.com>
Wed, 28 Mar 2012 01:28:08 +0000 (01:28 +0000)
committerDejan Jovanović <dejan.jovanovic@gmail.com>
Wed, 28 Mar 2012 01:28:08 +0000 (01:28 +0000)
http://church.cims.nyu.edu/regress-results/compare_jobs.php?job_id=3828&category=&p=5&reference_id=3820

src/theory/rewriter.cpp

index fddbbcd136fb8e5a339f5b84ef8dd02b9b81e5ac..4f9075f522588ff5959d46574999e41aae3174ab 100644 (file)
@@ -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<RewriteStackElement> rewriteStack;
   rewriteStack.push_back(RewriteStackElement(node, theoryId));