summaryrefslogtreecommitdiff
path: root/src/smt
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2018-05-08 15:18:15 -0700
committerGitHub <noreply@github.com>2018-05-08 15:18:15 -0700
commit08ddea9c91fc5c481642c4911d4af562ac2a88e1 (patch)
tree4c6f039f1a7d65d13526d7b1f3de59d32b8df2a9 /src/smt
parentcfaa03f3db71dc2805b695f98b073431d0430e43 (diff)
Refactor bv-abstraction preprocessing pass. (#1860)
Diffstat (limited to 'src/smt')
-rw-r--r--src/smt/smt_engine.cpp35
1 files changed, 8 insertions, 27 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index 565f99ec5..113d53507 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -69,6 +69,7 @@
#include "options/theory_options.h"
#include "options/uf_options.h"
#include "preprocessing/passes/bool_to_bv.h"
+#include "preprocessing/passes/bv_abstraction.h"
#include "preprocessing/passes/bv_gauss.h"
#include "preprocessing/passes/bv_intro_pow2.h"
#include "preprocessing/passes/bv_to_bool.h"
@@ -613,10 +614,6 @@ public:
*/
bool checkForBadSkolems(TNode n, TNode skolem, NodeToBoolHashMap& cache);
- // Abstract common structure over small domains to UF
- // return true if changes were made.
- void bvAbstraction();
-
// Simplify ITE structure
bool simpITE();
@@ -2588,6 +2585,8 @@ void SmtEnginePrivate::finishInit() {
// actually assembling preprocessing pipelines).
std::unique_ptr<BoolToBV> boolToBv(
new BoolToBV(d_preprocessingPassContext.get()));
+ std::unique_ptr<BvAbstraction> bvAbstract(
+ new BvAbstraction(d_preprocessingPassContext.get()));
std::unique_ptr<BVGauss> bvGauss(
new BVGauss(d_preprocessingPassContext.get()));
std::unique_ptr<BvIntroPow2> bvIntroPow2(
@@ -2601,6 +2600,8 @@ void SmtEnginePrivate::finishInit() {
std::unique_ptr<RealToInt> realToInt(
new RealToInt(d_preprocessingPassContext.get()));
d_preprocessingPassRegistry.registerPass("bool-to-bv", std::move(boolToBv));
+ d_preprocessingPassRegistry.registerPass("bv-abstraction",
+ std::move(bvAbstract));
d_preprocessingPassRegistry.registerPass("bv-gauss", std::move(bvGauss));
d_preprocessingPassRegistry.registerPass("bv-intro-pow2",
std::move(bvIntroPow2));
@@ -3184,24 +3185,6 @@ bool SmtEnginePrivate::nonClausalSimplify() {
return true;
}
-void SmtEnginePrivate::bvAbstraction() {
- Trace("bv-abstraction") << "SmtEnginePrivate::bvAbstraction()" << endl;
- std::vector<Node> new_assertions;
- bool changed = d_smt.d_theoryEngine->ppBvAbstraction(d_assertions.ref(), new_assertions);
- for (unsigned i = 0; i < d_assertions.size(); ++ i) {
- d_assertions.replace(i, Rewriter::rewrite(new_assertions[i]));
- }
- // if we are using the lazy solver and the abstraction
- // applies, then UF symbols were introduced
- if (options::bitblastMode() == theory::bv::BITBLAST_MODE_LAZY &&
- changed) {
- LogicRequest req(d_smt);
- req.widenLogic(THEORY_UF);
- }
-}
-
-
-
bool SmtEnginePrivate::simpITE() {
TimerStat::CodeTimer simpITETimer(d_smt.d_stats->d_simpITETime);
@@ -4042,11 +4025,9 @@ void SmtEnginePrivate::processAssertions() {
d_smt.d_theoryEngine->mkAckermanizationAssertions(d_assertions.ref());
}
- if ( options::bvAbstraction() &&
- !options::incrementalSolving()) {
- dumpAssertions("pre-bv-abstraction", d_assertions);
- bvAbstraction();
- dumpAssertions("post-bv-abstraction", d_assertions);
+ if (options::bvAbstraction() && !options::incrementalSolving())
+ {
+ d_preprocessingPassRegistry.getPass("bv-abstraction")->apply(&d_assertions);
}
Debug("smt") << " d_assertions : " << d_assertions.size() << endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback