diff options
author | Tim King <taking@google.com> | 2016-01-05 16:29:44 -0800 |
---|---|---|
committer | Tim King <taking@google.com> | 2016-01-05 16:29:44 -0800 |
commit | 5eabda0f55cee3be81aa7ae126269c32e818322f (patch) | |
tree | b873e4cb8e5d37ff3bb70596494bc5964aaef135 /src/theory/bv/lazy_bitblaster.cpp | |
parent | b717513e2a1d956c4456d13e0625957fc84c2449 (diff) |
Add SmtGlobals Class
- The options replayStream, lemmaInputChannel, lemmaOutputChannel have been removed due to their datatypes. These datatypes were previously pointers to types that were not usable from the options/ library.
- The option replayLog has been removed due to inconsistent memory management.
- SmtGlobals is a class that wraps a pointer to each of these removed options. These can each be set independently.
- There is a single SmtGlobals per SmtEngine with the lifetime of the SmtEngine.
- A pointer to this is freely given to the user of an SmtEngine to parameterize the solver after construction.
- Selected classes have been given a copy of this pointer in their constructors.
- Removed the dependence on Node from Result. Moving Result back into util/.
Diffstat (limited to 'src/theory/bv/lazy_bitblaster.cpp')
-rw-r--r-- | src/theory/bv/lazy_bitblaster.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/theory/bv/lazy_bitblaster.cpp b/src/theory/bv/lazy_bitblaster.cpp index 3c2b4ed78..b8173cb8b 100644 --- a/src/theory/bv/lazy_bitblaster.cpp +++ b/src/theory/bv/lazy_bitblaster.cpp @@ -26,12 +26,13 @@ #include "theory/theory_model.h" #include "theory_bv_utils.h" -using namespace CVC4; -using namespace CVC4::theory; -using namespace CVC4::theory::bv; +namespace CVC4 { +namespace theory { +namespace bv { -TLazyBitblaster::TLazyBitblaster(context::Context* c, bv::TheoryBV* bv, const std::string name, bool emptyNotify) +TLazyBitblaster::TLazyBitblaster(context::Context* c, bv::TheoryBV* bv, + const std::string name, bool emptyNotify) : TBitblaster<Node>() , d_bv(bv) , d_ctx(c) @@ -44,13 +45,13 @@ TLazyBitblaster::TLazyBitblaster(context::Context* c, bv::TheoryBV* bv, const st , d_satSolverFullModel(c, false) , d_name(name) , d_statistics(name) { + d_satSolver = prop::SatSolverFactory::createMinisat(c, name); d_nullRegistrar = new prop::NullRegistrar(); d_nullContext = new context::Context(); - d_cnfStream = new prop::TseitinCnfStream(d_satSolver, - d_nullRegistrar, - d_nullContext); - + d_cnfStream = new prop::TseitinCnfStream(d_satSolver, d_nullRegistrar, + d_nullContext, d_bv->globals()); + d_satSolverNotify = d_emptyNotify ? (prop::BVSatSolverInterface::Notify*) new MinisatEmptyNotify() : (prop::BVSatSolverInterface::Notify*) new MinisatNotify(d_cnfStream, bv, this); @@ -59,7 +60,7 @@ TLazyBitblaster::TLazyBitblaster(context::Context* c, bv::TheoryBV* bv, const st } void TLazyBitblaster::setAbstraction(AbstractionModule* abs) { - d_abstraction = abs; + d_abstraction = abs; } TLazyBitblaster::~TLazyBitblaster() throw() { @@ -103,8 +104,8 @@ void TLazyBitblaster::bbAtom(TNode node) { if (expansion.getKind() == kind::CONST_BOOLEAN) { atom_bb = expansion; } else { - Assert (expansion.getKind() == kind::AND); - std::vector<Node> atoms; + Assert (expansion.getKind() == kind::AND); + std::vector<Node> atoms; for (unsigned i = 0; i < expansion.getNumChildren(); ++i) { Node normalized_i = Rewriter::rewrite(expansion[i]); Node atom_i = normalized_i.getKind() != kind::CONST_BOOLEAN ? @@ -481,7 +482,7 @@ void TLazyBitblaster::collectModelInfo(TheoryModel* m, bool fullModel) { } void TLazyBitblaster::clearSolver() { - Assert (d_ctx->getLevel() == 0); + Assert (d_ctx->getLevel() == 0); delete d_satSolver; delete d_satSolverNotify; delete d_cnfStream; @@ -492,16 +493,19 @@ void TLazyBitblaster::clearSolver() { d_bbAtoms.clear(); d_variables.clear(); d_termCache.clear(); - - invalidateModelCache(); + + invalidateModelCache(); // recreate sat solver d_satSolver = prop::SatSolverFactory::createMinisat(d_ctx); - d_cnfStream = new prop::TseitinCnfStream(d_satSolver, - d_nullRegistrar, - d_nullContext); + d_cnfStream = new prop::TseitinCnfStream(d_satSolver, d_nullRegistrar, + d_nullContext, d_bv->globals()); d_satSolverNotify = d_emptyNotify ? (prop::BVSatSolverInterface::Notify*) new MinisatEmptyNotify() : (prop::BVSatSolverInterface::Notify*) new MinisatNotify(d_cnfStream, d_bv, this); d_satSolver->setNotify(d_satSolverNotify); } + +} /* namespace CVC4::theory::bv */ +} /* namespace CVC4::theory */ +} /* namespace CVC4 */ |