preprocessing/passes/bv_to_bool.h \
preprocessing/passes/real_to_int.cpp \
preprocessing/passes/real_to_int.h \
+ preprocessing/passes/rewrite.cpp \
+ preprocessing/passes/rewrite.h \
preprocessing/passes/static_learning.cpp \
preprocessing/passes/static_learning.h \
preprocessing/passes/symmetry_breaker.cpp \
--- /dev/null
+/********************* */
+/*! \file rewrite.cpp
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Caleb Donovick
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief The rewrite preprocessing pass
+ **
+ ** Calls the rewriter on every assertion
+ **/
+
+#include "preprocessing/passes/rewrite.h"
+
+#include "theory/rewriter.h"
+
+namespace CVC4 {
+namespace preprocessing {
+namespace passes {
+
+using namespace CVC4::theory;
+
+
+Rewrite::Rewrite(PreprocessingPassContext* preprocContext)
+ : PreprocessingPass(preprocContext, "rewrite"){};
+
+
+PreprocessingPassResult Rewrite::applyInternal(
+ AssertionPipeline* assertionsToPreprocess)
+{
+ for (unsigned i = 0; i < assertionsToPreprocess->size(); ++i) {
+ assertionsToPreprocess->replace(i, Rewriter::rewrite((*assertionsToPreprocess)[i]));
+ }
+
+ return PreprocessingPassResult::NO_CONFLICT;
+}
+
+} // namespace passes
+} // namespace preprocessing
+} // namespace CVC4
--- /dev/null
+/********************* */
+/*! \file rewrite.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Caleb Donovick
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief The rewrite preprocessing pass
+ **
+ ** Calls the rewriter on every assertion
+ **/
+
+#include "cvc4_private.h"
+
+#ifndef __CVC4__PREPROCESSING__PASSES__REWRITE_H
+#define __CVC4__PREPROCESSING__PASSES__REWRITE_H
+
+#include "preprocessing/preprocessing_pass.h"
+#include "preprocessing/preprocessing_pass_context.h"
+
+namespace CVC4 {
+namespace preprocessing {
+namespace passes {
+
+class Rewrite : public PreprocessingPass
+{
+ public:
+ Rewrite(PreprocessingPassContext* preprocContext);
+
+ protected:
+ PreprocessingPassResult applyInternal(
+ AssertionPipeline* assertionsToPreprocess) override;
+};
+
+} // namespace passes
+} // namespace preprocessing
+} // namespace CVC4
+
+#endif /* __CVC4__PREPROCESSING__PASSES__REWRITE_H */
+
#include "preprocessing/passes/int_to_bv.h"
#include "preprocessing/passes/pseudo_boolean_processor.h"
#include "preprocessing/passes/real_to_int.h"
+#include "preprocessing/passes/rewrite.h"
#include "preprocessing/passes/static_learning.h"
#include "preprocessing/passes/symmetry_breaker.h"
#include "preprocessing/passes/symmetry_detect.h"
new PseudoBooleanProcessor(d_preprocessingPassContext.get()));
std::unique_ptr<RealToInt> realToInt(
new RealToInt(d_preprocessingPassContext.get()));
+ std::unique_ptr<Rewrite> rewrite(
+ new Rewrite(d_preprocessingPassContext.get()));
std::unique_ptr<StaticLearning> staticLearning(
new StaticLearning(d_preprocessingPassContext.get()));
std::unique_ptr<SymBreakerPass> sbProc(
d_preprocessingPassRegistry.registerPass("pseudo-boolean-processor",
std::move(pbProc));
d_preprocessingPassRegistry.registerPass("real-to-int", std::move(realToInt));
+ d_preprocessingPassRegistry.registerPass("rewrite", std::move(rewrite));
d_preprocessingPassRegistry.registerPass("static-learning",
std::move(staticLearning));
d_preprocessingPassRegistry.registerPass("sym-break", std::move(sbProc));
if(options::unconstrainedSimp()) {
Trace("smt-proc") << "SmtEnginePrivate::processAssertions() : pre-unconstrained-simp" << endl;
dumpAssertions("pre-unconstrained-simp", d_assertions);
- Chat() << "...doing unconstrained simplification..." << endl;
- for (unsigned i = 0; i < d_assertions.size(); ++ i) {
- d_assertions.replace(i, Rewriter::rewrite(d_assertions[i]));
- }
+ d_preprocessingPassRegistry.getPass("rewrite")->apply(&d_assertions);
unconstrainedSimp();
Trace("smt-proc") << "SmtEnginePrivate::processAssertions() : post-unconstrained-simp" << endl;
dumpAssertions("post-unconstrained-simp", d_assertions);
{
// special rewriting pass for unsat cores, since many of the passes below
// are skipped
- for (unsigned i = 0; i < d_assertions.size(); ++i)
- {
- d_assertions.replace(i, Rewriter::rewrite(d_assertions[i]));
- }
+ d_preprocessingPassRegistry.getPass("rewrite")->apply(&d_assertions);
}
else
{