1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Caleb Donovick, Aina Niemetz |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* The rewrite preprocessing pass. |
14 |
|
* |
15 |
|
* Calls the rewriter on every assertion. |
16 |
|
*/ |
17 |
|
|
18 |
|
#include "preprocessing/passes/rewrite.h" |
19 |
|
|
20 |
|
#include "preprocessing/assertion_pipeline.h" |
21 |
|
#include "theory/rewriter.h" |
22 |
|
|
23 |
|
namespace cvc5 { |
24 |
|
namespace preprocessing { |
25 |
|
namespace passes { |
26 |
|
|
27 |
|
using namespace cvc5::theory; |
28 |
|
|
29 |
9927 |
Rewrite::Rewrite(PreprocessingPassContext* preprocContext) |
30 |
9927 |
: PreprocessingPass(preprocContext, "rewrite"){}; |
31 |
|
|
32 |
|
|
33 |
27764 |
PreprocessingPassResult Rewrite::applyInternal( |
34 |
|
AssertionPipeline* assertionsToPreprocess) |
35 |
|
{ |
36 |
243182 |
for (unsigned i = 0; i < assertionsToPreprocess->size(); ++i) { |
37 |
215418 |
assertionsToPreprocess->replace(i, Rewriter::rewrite((*assertionsToPreprocess)[i])); |
38 |
|
} |
39 |
|
|
40 |
27764 |
return PreprocessingPassResult::NO_CONFLICT; |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
} // namespace passes |
45 |
|
} // namespace preprocessing |
46 |
29505 |
} // namespace cvc5 |