summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2014-06-15 22:30:48 -0400
committerlianah <lianahady@gmail.com>2014-06-19 18:24:38 -0400
commitbb35ed4f871e4cb5d33c1030fc5547bb92ec334b (patch)
tree62d151f6be0bcf5ce2f06fbc8afb84f5d85f4fd1 /src
parentc49991b10bbf284082bb87c8094ff88a20828dfd (diff)
Fix compile errors with some versions of GCC.
Diffstat (limited to 'src')
-rw-r--r--src/theory/bv/bitblaster_template.h4
-rw-r--r--src/theory/bv/bv_quick_check.h6
-rw-r--r--src/theory/bv/lazy_bitblaster.h34
-rw-r--r--src/theory/bv/theory_bv_utils.h7
4 files changed, 25 insertions, 26 deletions
diff --git a/src/theory/bv/bitblaster_template.h b/src/theory/bv/bitblaster_template.h
index 25de81f2c..8971d289f 100644
--- a/src/theory/bv/bitblaster_template.h
+++ b/src/theory/bv/bitblaster_template.h
@@ -134,9 +134,9 @@ class TLazyBitblaster : public TBitblaster<Node> {
prop::BVSatSolverInterface* d_satSolver;
prop::CnfStream* d_cnfStream;
- AssertionList d_assertedAtoms; /**< context dependent list storing the atoms
+ AssertionList* d_assertedAtoms; /**< context dependent list storing the atoms
currently asserted by the DPLL SAT solver. */
- ExplanationMap d_explanations; /**< context dependent list of explanations for the propagated literals.
+ ExplanationMap* d_explanations; /**< context dependent list of explanations for the propagated literals.
Only used when bvEagerPropagate option enabled. */
VarSet d_variables;
AtomSet d_bbAtoms;
diff --git a/src/theory/bv/bv_quick_check.h b/src/theory/bv/bv_quick_check.h
index c09994c06..4ec9c9231 100644
--- a/src/theory/bv/bv_quick_check.h
+++ b/src/theory/bv/bv_quick_check.h
@@ -26,6 +26,7 @@
#include "context/cdo.h"
#include "prop/sat_solver_types.h"
#include "util/statistics_registry.h"
+#include "theory/bv/theory_bv_utils.h"
namespace CVC4 {
namespace theory {
@@ -34,11 +35,6 @@ class TheoryModel;
namespace bv {
-
-
-typedef __gnu_cxx::hash_set<Node, NodeHashFunction> NodeSet;
-typedef __gnu_cxx::hash_set<TNode, TNodeHashFunction> TNodeSet;
-
class TLazyBitblaster;
class TheoryBV;
diff --git a/src/theory/bv/lazy_bitblaster.h b/src/theory/bv/lazy_bitblaster.h
index 013e230f6..570549866 100644
--- a/src/theory/bv/lazy_bitblaster.h
+++ b/src/theory/bv/lazy_bitblaster.h
@@ -36,11 +36,11 @@ namespace theory {
namespace bv {
TLazyBitblaster::TLazyBitblaster(context::Context* c, bv::TheoryBV* bv, const std::string name, bool emptyNotify)
- : TBitblaster()
+ : TBitblaster<Node>()
, d_bv(bv)
, d_ctx(c)
- , d_assertedAtoms(c)
- , d_explanations(c)
+ , d_assertedAtoms(new(true) context::CDList<prop::SatLiteral>(c))
+ , d_explanations(new(true) ExplanationMap(c))
, d_variables()
, d_bbAtoms()
, d_abstraction(NULL)
@@ -192,8 +192,8 @@ void TLazyBitblaster::explain(TNode atom, std::vector<TNode>& explanation) {
++(d_statistics.d_numExplainedPropagations);
if (options::bvEagerExplanations()) {
- Assert (d_explanations.find(lit) != d_explanations.end());
- const std::vector<prop::SatLiteral>& literal_explanation = d_explanations[lit].get();
+ Assert (d_explanations->find(lit) != d_explanations->end());
+ const std::vector<prop::SatLiteral>& literal_explanation = (*d_explanations)[lit].get();
for (unsigned i = 0; i < literal_explanation.size(); ++i) {
explanation.push_back(d_cnfStream->getNode(literal_explanation[i]));
}
@@ -241,7 +241,7 @@ bool TLazyBitblaster::assertToSat(TNode lit, bool propagate) {
prop::SatValue ret = d_satSolver->assertAssumption(markerLit, propagate);
- d_assertedAtoms.push_back(markerLit);
+ d_assertedAtoms->push_back(markerLit);
return ret == prop::SAT_VALUE_TRUE || ret == prop::SAT_VALUE_UNKNOWN;
}
@@ -256,24 +256,24 @@ bool TLazyBitblaster::assertToSat(TNode lit, bool propagate) {
bool TLazyBitblaster::solve() {
if (Trace.isOn("bitvector")) {
Trace("bitvector") << "TLazyBitblaster::solve() asserted atoms ";
- context::CDList<prop::SatLiteral>::const_iterator it = d_assertedAtoms.begin();
- for (; it != d_assertedAtoms.end(); ++it) {
+ context::CDList<prop::SatLiteral>::const_iterator it = d_assertedAtoms->begin();
+ for (; it != d_assertedAtoms->end(); ++it) {
Trace("bitvector") << " " << d_cnfStream->getNode(*it) << "\n";
}
}
- Debug("bitvector") << "TLazyBitblaster::solve() asserted atoms " << d_assertedAtoms.size() <<"\n";
+ Debug("bitvector") << "TLazyBitblaster::solve() asserted atoms " << d_assertedAtoms->size() <<"\n";
return prop::SAT_VALUE_TRUE == d_satSolver->solve();
}
prop::SatValue TLazyBitblaster::solveWithBudget(unsigned long budget) {
if (Trace.isOn("bitvector")) {
Trace("bitvector") << "TLazyBitblaster::solveWithBudget() asserted atoms ";
- context::CDList<prop::SatLiteral>::const_iterator it = d_assertedAtoms.begin();
- for (; it != d_assertedAtoms.end(); ++it) {
+ context::CDList<prop::SatLiteral>::const_iterator it = d_assertedAtoms->begin();
+ for (; it != d_assertedAtoms->end(); ++it) {
Trace("bitvector") << " " << d_cnfStream->getNode(*it) << "\n";
}
}
- Debug("bitvector") << "TLazyBitblaster::solveWithBudget() asserted atoms " << d_assertedAtoms.size() <<"\n";
+ Debug("bitvector") << "TLazyBitblaster::solveWithBudget() asserted atoms " << d_assertedAtoms->size() <<"\n";
return d_satSolver->solve(budget);
}
@@ -327,10 +327,10 @@ TLazyBitblaster::Statistics::~Statistics() {
bool TLazyBitblaster::MinisatNotify::notify(prop::SatLiteral lit) {
if(options::bvEagerExplanations()) {
// compute explanation
- if (d_lazyBB->d_explanations.find(lit) == d_lazyBB->d_explanations.end()) {
+ if (d_lazyBB->d_explanations->find(lit) == d_lazyBB->d_explanations->end()) {
std::vector<prop::SatLiteral> literal_explanation;
d_lazyBB->d_satSolver->explain(lit, literal_explanation);
- d_lazyBB->d_explanations.insert(lit, literal_explanation);
+ d_lazyBB->d_explanations->insert(lit, literal_explanation);
} else {
// we propagated it at a lower level
return true;
@@ -478,8 +478,10 @@ void TLazyBitblaster::clearSolver() {
Assert (d_ctx->getLevel() == 0);
delete d_satSolver;
delete d_cnfStream;
- d_assertedAtoms = context::CDList<prop::SatLiteral>(d_ctx);
- d_explanations = ExplanationMap(d_ctx);
+ d_assertedAtoms->deleteSelf();
+ d_assertedAtoms = new(true) context::CDList<prop::SatLiteral>(d_ctx);
+ d_explanations->deleteSelf();
+ d_explanations = new(true) ExplanationMap(d_ctx);
d_bbAtoms.clear();
d_variables.clear();
d_termCache.clear();
diff --git a/src/theory/bv/theory_bv_utils.h b/src/theory/bv/theory_bv_utils.h
index 9679c0260..4dfea9d1d 100644
--- a/src/theory/bv/theory_bv_utils.h
+++ b/src/theory/bv/theory_bv_utils.h
@@ -24,10 +24,13 @@
#include <sstream>
#include "expr/node_manager.h"
-
namespace CVC4 {
namespace theory {
namespace bv {
+
+typedef __gnu_cxx::hash_set<Node, NodeHashFunction> NodeSet;
+typedef __gnu_cxx::hash_set<TNode, TNodeHashFunction> TNodeSet;
+
namespace utils {
inline uint32_t pow2(uint32_t power) {
@@ -254,8 +257,6 @@ inline unsigned isPow2Const(TNode node) {
return bv.isPow2();
}
-typedef __gnu_cxx::hash_set<TNode, TNodeHashFunction> TNodeSet;
-
inline Node mkOr(const std::vector<Node>& nodes) {
std::set<TNode> all;
all.insert(nodes.begin(), nodes.end());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback