From b6ce0f23ce0aaa0552767e8067fe58dbceee11cb Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Mon, 9 Dec 2019 11:19:10 -0800 Subject: Make theory rewriters non-static (#3547) This commit changes theory rewriters to be non-static. This refactoring is needed as a stepping stone to making our rewriter configurable: If we have multiple solver objects with different rewrite configurations, we cannot use `static` variables for the rewriter table in the BV rewriter for example. It is also in line with our goal of getting rid of singletons in general. Note that the `Rewriter` class is still a singleton, which will be changed in a future commit. --- src/theory/rewriter_tables_template.h | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/theory/rewriter_tables_template.h') diff --git a/src/theory/rewriter_tables_template.h b/src/theory/rewriter_tables_template.h index 531b62a49..e1be6355b 100644 --- a/src/theory/rewriter_tables_template.h +++ b/src/theory/rewriter_tables_template.h @@ -29,22 +29,6 @@ ${rewriter_includes} namespace CVC4 { namespace theory { -RewriteResponse Rewriter::callPreRewrite(theory::TheoryId theoryId, TNode node) { - switch(theoryId) { -${pre_rewrite_calls} - default: - Unreachable(); - } -} - -RewriteResponse Rewriter::callPostRewrite(theory::TheoryId theoryId, TNode node) { - switch(theoryId) { -${post_rewrite_calls} - default: - Unreachable(); - } -} - Node Rewriter::getPreRewriteCache(theory::TheoryId theoryId, TNode node) { switch(theoryId) { ${pre_rewrite_get_cache} @@ -77,14 +61,11 @@ ${post_rewrite_set_cache} } } -void Rewriter::init() { +Rewriter::Rewriter() +{ ${rewrite_init} } -void Rewriter::shutdown() { -${rewrite_shutdown} -} - void Rewriter::clearCachesInternal() { typedef CVC4::expr::attr::AttributeUniqueId AttributeUniqueId; std::vector preids; -- cgit v1.2.3