BVDebug("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n";
BVDebug("bitvector-bb") << " with bits " << toString(bits);
}
- // this is not necessairily a variable, but it is a term the theory of bitvectors treads as one
- // e.g. a select over a bv array
- bb->storeVariable(node);
+
+ if (Theory::theoryOf(node) == theory::THEORY_BV ||
+ bb->isSharedTerm(node)) {
+ bb->storeVariable(node);
+ }
}
/////// Bitblaster
Bitblaster::Bitblaster(context::Context* c, bv::TheoryBV* bv) :
+ d_bv(bv),
d_bvOutput(bv->d_out),
d_termCache(),
d_bitblastedAtoms(),
}
}
+
+bool Bitblaster::isSharedTerm(TNode node) {
+ return d_bv->d_sharedTermsSet.find(node) != d_bv->d_sharedTermsSet.end();
+}
+
Node Bitblaster::getVarValue(TNode a) {
Assert (d_termCache.find(a) != d_termCache.end());
Bits bits = d_termCache[a];
void safePoint();
};
+
typedef __gnu_cxx::hash_map <Node, Bits, TNodeHashFunction > TermDefMap;
typedef __gnu_cxx::hash_set<TNode, TNodeHashFunction> AtomSet;
typedef __gnu_cxx::hash_set<TNode, TNodeHashFunction> VarSet;
typedef void (*TermBBStrategy) (TNode, Bits&, Bitblaster*);
typedef Node (*AtomBBStrategy) (TNode, Bitblaster*);
+ TheoryBV *d_bv;
+
// sat solver used for bitblasting and associated CnfStream
theory::OutputChannel* d_bvOutput;
prop::BVSatSolverInterface* d_satSolver;
*/
void storeVariable(TNode var) {
d_variables.insert(var);
- }
+ }
+
+ bool isSharedTerm(TNode node);
private: