1 /********************* */
2 /*! \file rewriter_tables_template.h
4 ** Original author: Dejan Jovanovic
5 ** Major contributors: Morgan Deters, Tim King
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2014 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
12 ** \brief Rewriter tables for various theories
14 ** This file contains template code for the rewriter tables that are generated
15 ** from the Theory kinds files.
18 #include "cvc4_private.h"
22 #include "theory/rewriter.h"
23 #include "theory/rewriter_attributes.h"
24 #include "expr/attribute_unique_id.h"
25 #include "expr/attribute.h"
32 RewriteResponse
Rewriter::callPreRewrite(theory::TheoryId theoryId
, TNode node
) {
40 RewriteResponse
Rewriter::callPostRewrite(theory::TheoryId theoryId
, TNode node
) {
48 Node
Rewriter::getPreRewriteCache(theory::TheoryId theoryId
, TNode node
) {
50 $
{pre_rewrite_get_cache
}
56 Node
Rewriter::getPostRewriteCache(theory::TheoryId theoryId
, TNode node
) {
58 $
{post_rewrite_get_cache
}
64 void Rewriter::setPreRewriteCache(theory::TheoryId theoryId
, TNode node
, TNode cache
) {
66 $
{pre_rewrite_set_cache
}
72 void Rewriter::setPostRewriteCache(theory::TheoryId theoryId
, TNode node
, TNode cache
) {
74 $
{post_rewrite_set_cache
}
80 void Rewriter::init() {
84 void Rewriter::shutdown() {
88 void Rewriter::garbageCollect() {
89 typedef CVC4::expr::attr::AttributeUniqueId AttributeUniqueId
;
90 std::vector
<AttributeUniqueId
> preids
;
91 $
{pre_rewrite_attribute_ids
}
93 std::vector
<AttributeUniqueId
> postids
;
94 $
{post_rewrite_attribute_ids
}
96 std::vector
<const AttributeUniqueId
*> allids
;
97 for(unsigned i
= 0; i
< preids
.size(); ++i
){
98 allids
.push_back(&preids
[i
]);
100 for(unsigned i
= 0; i
< postids
.size(); ++i
){
101 allids
.push_back(&postids
[i
]);
103 NodeManager::currentNM()->deleteAttributes(allids
);
106 }/* CVC4::theory namespace */
107 }/* CVC4 namespace */