Node UndefinedAtomBBStrategy(TNode node, Bitblaster* bb) {
- BVDebug("bitvector") << "TheoryBV::Bitblaster Undefined bitblasting strategy for kind: "
+ Debug("bitvector") << "TheoryBV::Bitblaster Undefined bitblasting strategy for kind: "
<< node.getKind() << "\n";
Unreachable();
}
Node DefaultEqBB(TNode node, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::EQUAL);
Bits lhs, rhs;
Node AdderUltBB(TNode node, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ULT);
Bits a, b;
bb->bbTerm(node[0], a);
Node DefaultUltBB(TNode node, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ULT);
Bits a, b;
bb->bbTerm(node[0], a);
}
Node DefaultUleBB(TNode node, Bitblaster* bb){
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_ULE);
Bits a, b;
}
Node DefaultUgtBB(TNode node, Bitblaster* bb){
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
Node DefaultUgeBB(TNode node, Bitblaster* bb){
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
// Node DefaultSltBB(TNode node, Bitblaster* bb){
-// BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+// Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
// // shoudl be rewritten in terms of ult
// Unimplemented();
// }
// Node DefaultSleBB(TNode node, Bitblaster* bb){
-// BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+// Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
// // shoudl be rewritten in terms of ule
// Unimplemented();
// }
Node DefaultSltBB(TNode node, Bitblaster* bb){
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
Bits a, b;
bb->bbTerm(node[0], a);
}
Node DefaultSleBB(TNode node, Bitblaster* bb){
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
Bits a, b;
bb->bbTerm(node[0], a);
}
Node DefaultSgtBB(TNode node, Bitblaster* bb){
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
Node DefaultSgeBB(TNode node, Bitblaster* bb){
- BVDebug("bitvector-bb") << "Bitblasting node " << node << "\n";
+ Debug("bitvector-bb") << "Bitblasting node " << node << "\n";
// should be rewritten
Unimplemented();
}
/// Term bitblasting strategies
void UndefinedTermBBStrategy(TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Undefined bitblasting strategy for kind: "
+ Debug("bitvector") << "theory::bv:: Undefined bitblasting strategy for kind: "
<< node.getKind() << "\n";
Unreachable();
}
}
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n";
- BVDebug("bitvector-bb") << " with bits " << toString(bits);
+ Debug("bitvector-bb") << "theory::bv::DefaultVarBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << " with bits " << toString(bits);
}
bb->storeVariable(node);
}
void DefaultConstBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultConstBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultConstBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::CONST_BITVECTOR);
Assert(bits.size() == 0);
}
}
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ Debug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
}
}
void DefaultNotBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultNotBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultNotBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_NOT);
Assert(bits.size() == 0);
Bits bv;
}
void DefaultConcatBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultConcatBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultConcatBB bitblasting " << node << "\n";
Assert(bits.size() == 0);
Assert (node.getKind() == kind::BITVECTOR_CONCAT);
}
Assert (bits.size() == utils::getSize(node));
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
+ Debug("bitvector-bb") << "with bits: " << toString(bits) << "\n";
}
}
void DefaultAndBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultAndBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultAndBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_AND &&
bits.size() == 0);
}
void DefaultOrBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultOrBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultOrBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_OR &&
bits.size() == 0);
}
void DefaultXorBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultXorBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultXorBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_XOR &&
bits.size() == 0);
}
void DefaultXnorBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultXnorBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultXnorBB bitblasting " << node << "\n";
Assert(node.getNumChildren() == 2 &&
node.getKind() == kind::BITVECTOR_XNOR &&
void DefaultNandBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
void DefaultNorBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
void DefaultCompBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: DefaultCompBB bitblasting "<< node << "\n";
+ Debug("bitvector") << "theory::bv:: DefaultCompBB bitblasting "<< node << "\n";
Assert(getSize(node) == 1 && bits.size() == 0 && node.getKind() == kind::BITVECTOR_COMP);
Bits a, b;
}
void DefaultMultBB (TNode node, Bits& res, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: DefaultMultBB bitblasting "<< node << "\n";
+ Debug("bitvector") << "theory::bv:: DefaultMultBB bitblasting "<< node << "\n";
Assert(res.size() == 0 &&
node.getKind() == kind::BITVECTOR_MULT);
res = newres;
}
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
void DefaultPlusBB (TNode node, Bits& res, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultPlusBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultPlusBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_PLUS &&
res.size() == 0);
void DefaultSubBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultSubBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultSubBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_SUB &&
node.getNumChildren() == 2 &&
bits.size() == 0);
}
void DefaultNegBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultNegBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultNegBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_NEG);
Bits a;
}
void DefaultUdivBB (TNode node, Bits& q, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultUdivBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_UDIV_TOTAL && q.size() == 0);
Bits a, b;
}
void DefaultUremBB (TNode node, Bits& rem, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultUremBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultUremBB bitblasting " << node << "\n";
Assert(node.getKind() == kind::BITVECTOR_UREM_TOTAL && rem.size() == 0);
Bits a, b;
void DefaultSdivBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
void DefaultSremBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
void DefaultSmodBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
void DefaultShlBB (TNode node, Bits& res, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultShlBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultShlBB bitblasting " << node << "\n";
Assert (node.getKind() == kind::BITVECTOR_SHL &&
res.size() == 0);
Bits a, b;
}
}
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
void DefaultLshrBB (TNode node, Bits& res, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultLshrBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultLshrBB bitblasting " << node << "\n";
Assert (node.getKind() == kind::BITVECTOR_LSHR &&
res.size() == 0);
Bits a, b;
}
}
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
void DefaultAshrBB (TNode node, Bits& res, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultAshrBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultAshrBB bitblasting " << node << "\n";
Assert (node.getKind() == kind::BITVECTOR_ASHR &&
res.size() == 0);
Bits a, b;
}
}
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "with bits: " << toString(res) << "\n";
+ Debug("bitvector-bb") << "with bits: " << toString(res) << "\n";
}
}
Assert (bits.size() == high - low + 1);
if(Debug.isOn("bitvector-bb")) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n";
- BVDebug("bitvector-bb") << " with bits " << toString(bits);
+ Debug("bitvector-bb") << "theory::bv::DefaultExtractBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << " with bits " << toString(bits);
}
}
void DefaultRepeatBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
// this should be rewritten
Unimplemented();
void DefaultZeroExtendBB (TNode node, Bits& res_bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultZeroExtendBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultZeroExtendBB bitblasting " << node << "\n";
// this should be rewritten
Unimplemented();
}
void DefaultSignExtendBB (TNode node, Bits& res_bits, Bitblaster* bb) {
- BVDebug("bitvector-bb") << "theory::bv::DefaultSignExtendBB bitblasting " << node << "\n";
+ Debug("bitvector-bb") << "theory::bv::DefaultSignExtendBB bitblasting " << node << "\n";
Assert (node.getKind() == kind::BITVECTOR_SIGN_EXTEND &&
res_bits.size() == 0);
}
void DefaultRotateRightBB (TNode node, Bits& res, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
void DefaultRotateLeftBB (TNode node, Bits& bits, Bitblaster* bb) {
- BVDebug("bitvector") << "theory::bv:: Unimplemented kind "
+ Debug("bitvector") << "theory::bv:: Unimplemented kind "
<< node.getKind() << "\n";
Unimplemented();
}
// make sure it is marked as an atom
addAtom(node);
- BVDebug("bitvector-bitblast") << "Bitblasting node " << node <<"\n";
+ Debug("bitvector-bitblast") << "Bitblasting node " << node <<"\n";
++d_statistics.d_numAtoms;
// the bitblasted definition of the atom
Node atom_bb = Rewriter::rewrite(d_atomBBStrategies[node.getKind()](node, this));
return;
}
- BVDebug("bitvector-bitblast") << "Bitblasting node " << node <<"\n";
+ Debug("bitvector-bitblast") << "Bitblasting node " << node <<"\n";
++d_statistics.d_numTerms;
d_termBBStrategies[node.getKind()] (node, bits,this);
markerLit = ~markerLit;
}
- BVDebug("bitvector-bb") << "TheoryBV::Bitblaster::assertToSat asserting node: " << atom <<"\n";
- BVDebug("bitvector-bb") << "TheoryBV::Bitblaster::assertToSat with literal: " << markerLit << "\n";
+ Debug("bitvector-bb") << "TheoryBV::Bitblaster::assertToSat asserting node: " << atom <<"\n";
+ Debug("bitvector-bb") << "TheoryBV::Bitblaster::assertToSat with literal: " << markerLit << "\n";
SatValue ret = d_satSolver->assertAssumption(markerLit, propagate);
Trace("bitvector") << " " << d_cnfStream->getNode(*it) << "\n";
}
}
- BVDebug("bitvector") << "Bitblaster::solve() asserted atoms " << d_assertedAtoms.size() <<"\n";
+ Debug("bitvector") << "Bitblaster::solve() asserted atoms " << d_assertedAtoms.size() <<"\n";
return SAT_VALUE_TRUE == d_satSolver->solve();
}
}
bool BitblastSolver::addAssertions(const std::vector<TNode>& assertions, Theory::Effort e) {
- BVDebug("bitvector::bitblaster") << "BitblastSolver::addAssertions (" << e << ")" << std::endl;
+ Debug("bitvector::bitblaster") << "BitblastSolver::addAssertions (" << e << ")" << std::endl;
//// Eager bit-blasting
if (options::bitvectorEagerBitblast()) {
// solving
if (e == Theory::EFFORT_FULL || options::bitvectorEagerFullcheck()) {
Assert(!d_bv->inConflict());
- BVDebug("bitvector::bitblaster") << "BitblastSolver::addAssertions solving. \n";
+ Debug("bitvector::bitblaster") << "BitblastSolver::addAssertions solving. \n";
bool ok = d_bitblaster->solve();
if (!ok) {
std::vector<TNode> conflictAtoms;
}
bool EqualitySolver::NotifyClass::eqNotifyTriggerEquality(TNode equality, bool value) {
- BVDebug("bitvector::equality") << "NotifyClass::eqNotifyTriggerEquality(" << equality << ", " << (value ? "true" : "false" )<< ")" << std::endl;
+ Debug("bitvector::equality") << "NotifyClass::eqNotifyTriggerEquality(" << equality << ", " << (value ? "true" : "false" )<< ")" << std::endl;
if (value) {
return d_solver.storePropagation(equality);
} else {
}
bool EqualitySolver::NotifyClass::eqNotifyTriggerPredicate(TNode predicate, bool value) {
- BVDebug("bitvector::equality") << "NotifyClass::eqNotifyTriggerPredicate(" << predicate << ", " << (value ? "true" : "false" ) << ")" << std::endl;
+ Debug("bitvector::equality") << "NotifyClass::eqNotifyTriggerPredicate(" << predicate << ", " << (value ? "true" : "false" ) << ")" << std::endl;
if (value) {
return d_solver.storePropagation(predicate);
} else {
const tree_entry_type& node = d_memory.back();
if(Debug.isOn("cd_set_collection")) {
- BVDebug("cd_set_collection") << "BacktrackableSetCollection::backtrack(): removing " << node.getValue()
+ Debug("cd_set_collection") << "BacktrackableSetCollection::backtrack(): removing " << node.getValue()
<< " from " << internalToString(getRoot(d_memory.size()-1)) << std::endl;
}
// Find the biggest node smaleer than value (it must exist)
while (set != null) {
if(Debug.isOn("set_collection")) {
- BVDebug("set_collection") << "BacktrackableSetCollection::getPrev(" << toString(set) << "," << value << ")" << std::endl;
+ Debug("set_collection") << "BacktrackableSetCollection::getPrev(" << toString(set) << "," << value << ")" << std::endl;
}
const tree_entry_type& node = d_memory[set];
if (node.getValue() >= value) {
// Find the smallest node bigger than value (it must exist)
while (set != null) {
if(Debug.isOn("set_collection")) {
- BVDebug("set_collection") << "BacktrackableSetCollection::getNext(" << toString(set) << "," << value << ")" << std::endl;
+ Debug("set_collection") << "BacktrackableSetCollection::getNext(" << toString(set) << "," << value << ")" << std::endl;
}
const tree_entry_type& node = d_memory[set];
if (node.getValue() <= value) {
Assert(isValid(set));
if(Debug.isOn("set_collection")) {
- BVDebug("set_collection") << "BacktrackableSetCollection::getElements(" << toString(set) << "," << lowerBound << "," << upperBound << ")" << std::endl;
+ Debug("set_collection") << "BacktrackableSetCollection::getElements(" << toString(set) << "," << lowerBound << "," << upperBound << ")" << std::endl;
}
// Empty set no elements
}
void TheoryBV::preRegisterTerm(TNode node) {
- BVDebug("bitvector-preregister") << "TheoryBV::preRegister(" << node << ")" << std::endl;
+ Debug("bitvector-preregister") << "TheoryBV::preRegister(" << node << ")" << std::endl;
if (options::bitvectorEagerBitblast()) {
// don't use the equality engine in the eager bit-blasting
if (d_conflictNode.isNull()) {
return;
} else {
- BVDebug("bitvector") << indent() << "TheoryBV::check(): conflict " << d_conflictNode;
+ Debug("bitvector") << indent() << "TheoryBV::check(): conflict " << d_conflictNode;
d_out->conflict(d_conflictNode);
d_statistics.d_avgConflictSize.addEntry(d_conflictNode.getNumChildren());
d_conflictNode = Node::null();
void TheoryBV::check(Effort e)
{
- BVDebug("bitvector") << "TheoryBV::check(" << e << ")" << std::endl;
+ Debug("bitvector") << "TheoryBV::check(" << e << ")" << std::endl;
// if we are already in conflict just return the conflict
if (inConflict()) {
Assertion assertion = get();
TNode fact = assertion.assertion;
new_assertions.push_back(fact);
- BVDebug("bitvector-assertions") << "TheoryBV::check assertion " << fact << "\n";
+ Debug("bitvector-assertions") << "TheoryBV::check assertion " << fact << "\n";
}
if (!inConflict()) {
}
void TheoryBV::propagate(Effort e) {
- BVDebug("bitvector") << indent() << "TheoryBV::propagate()" << std::endl;
+ Debug("bitvector") << indent() << "TheoryBV::propagate()" << std::endl;
if (inConflict()) {
return;
}
if (!ok) {
- BVDebug("bitvector::propagate") << indent() << "TheoryBV::propagate(): conflict from theory engine" << std::endl;
+ Debug("bitvector::propagate") << indent() << "TheoryBV::propagate(): conflict from theory engine" << std::endl;
setConflict();
}
}
bool TheoryBV::storePropagation(TNode literal, SubTheory subtheory)
{
- Debug("bitvector::propagate") << indent() << "TheoryBV::storePropagation(" << literal << ", " << subtheory << ")" << std::endl;
+ Debug("bitvector::propagate") << indent() << getSatContext()->getLevel() << " " << "TheoryBV::storePropagation(" << literal << ", " << subtheory << ")" << std::endl;
// If already in conflict, no more propagation
if (d_conflict) {
void TheoryBV::explain(TNode literal, std::vector<TNode>& assumptions) {
// Ask the appropriate subtheory for the explanation
if (propagatedBy(literal, SUB_EQUALITY)) {
- BVDebug("bitvector::explain") << "TheoryBV::explain(" << literal << "): EQUALITY" << std::endl;
+ Debug("bitvector::explain") << "TheoryBV::explain(" << literal << "): EQUALITY" << std::endl;
d_equalitySolver.explain(literal, assumptions);
} else {
Assert(propagatedBy(literal, SUB_BITBLAST));
- BVDebug("bitvector::explain") << "TheoryBV::explain(" << literal << ") : BITBLASTER" << std::endl;
+ Debug("bitvector::explain") << "TheoryBV::explain(" << literal << ") : BITBLASTER" << std::endl;
d_bitblastSolver.explain(literal, assumptions);
}
}
Node TheoryBV::explain(TNode node) {
- BVDebug("bitvector::explain") << "TheoryBV::explain(" << node << ")" << std::endl;
+ Debug("bitvector::explain") << "TheoryBV::explain(" << node << ")" << std::endl;
std::vector<TNode> assumptions;
// Ask for the explanation
template<bool checkApplies>
static inline Node run(TNode node) {
if (!checkApplies || applies(node)) {
- BVDebug("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node << ")" << std::endl;
+ Debug("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node << ")" << std::endl;
Assert(checkApplies || applies(node));
//++ s_statistics->d_ruleApplications;
Node result = apply(node);
<< CheckSatCommand(condition.toExpr());
}
}
- BVDebug("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node << ") => " << result << std::endl;
+ Debug("theory::bv::rewrite") << "RewriteRule<" << rule << ">(" << node << ") => " << result << std::endl;
return result;
} else {
return node;
template<> inline
Node RewriteRule<EmptyRule>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EmptyRule> for " << node.getKind() <<"\n";
+ Debug("bv-rewrite") << "RewriteRule<EmptyRule> for " << node.getKind() <<"\n";
Unreachable();
return node;
}
template<> inline
Node RewriteRule<EvalAnd>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<EvalAnd>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalAnd>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a & b;
template<> inline
Node RewriteRule<EvalOr>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<EvalOr>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalOr>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a | b;
template<> inline
Node RewriteRule<EvalXor>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<EvalXor>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalXor>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a ^ b;
// template<> inline
// Node RewriteRule<EvalXnor>::apply(TNode node) {
-// BVDebug("bv-rewrite") << "RewriteRule<EvalXnor>(" << node << ")" << std::endl;
+// Debug("bv-rewrite") << "RewriteRule<EvalXnor>(" << node << ")" << std::endl;
// BitVector a = node[0].getConst<BitVector>();
// BitVector b = node[1].getConst<BitVector>();
// BitVector res = ~ (a ^ b);
template<> inline
Node RewriteRule<EvalNot>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalNot>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalNot>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector res = ~ a;
return utils::mkConst(res);
// template<> inline
// Node RewriteRule<EvalComp>::apply(TNode node) {
-// BVDebug("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
+// Debug("bv-rewrite") << "RewriteRule<EvalComp>(" << node << ")" << std::endl;
// BitVector a = node[0].getConst<BitVector>();
// BitVector b = node[1].getConst<BitVector>();
// BitVector res;
template<> inline
Node RewriteRule<EvalMult>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalMult>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalMult>(" << node << ")" << std::endl;
TNode::iterator child_it = node.begin();
BitVector res = (*child_it).getConst<BitVector>();
for(++child_it; child_it != node.end(); ++child_it) {
template<> inline
Node RewriteRule<EvalPlus>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalPlus>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalPlus>(" << node << ")" << std::endl;
TNode::iterator child_it = node.begin();
BitVector res = (*child_it).getConst<BitVector>();
for(++child_it; child_it != node.end(); ++child_it) {
// template<> inline
// Node RewriteRule<EvalSub>::apply(TNode node) {
-// BVDebug("bv-rewrite") << "RewriteRule<EvalSub>(" << node << ")" << std::endl;
+// Debug("bv-rewrite") << "RewriteRule<EvalSub>(" << node << ")" << std::endl;
// BitVector a = node[0].getConst<BitVector>();
// BitVector b = node[1].getConst<BitVector>();
// BitVector res = a - b;
template<> inline
Node RewriteRule<EvalNeg>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalNeg>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalNeg>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector res = - a;
template<> inline
Node RewriteRule<EvalUdiv>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalUdiv>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalUdiv>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a.unsignedDivTotal(b);
template<> inline
Node RewriteRule<EvalUrem>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalUrem>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalUrem>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
BitVector res = a.unsignedRemTotal(b);
template<> inline
Node RewriteRule<EvalShl>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalShl>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalShl>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalLshr>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalLshr>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalLshr>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalAshr>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalAshr>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalAshr>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalUlt>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalUlt>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalUlt>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalSlt>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalSlt>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalSlt>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalUle>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalUle>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalUle>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalSle>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalSle>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalSle>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
template<> inline
Node RewriteRule<EvalExtract>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalExtract>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalExtract>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
unsigned lo = utils::getExtractLow(node);
unsigned hi = utils::getExtractHigh(node);
template<> inline
Node RewriteRule<EvalConcat>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalConcat>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalConcat>(" << node << ")" << std::endl;
unsigned num = node.getNumChildren();
BitVector res = node[0].getConst<BitVector>();
for(unsigned i = 1; i < num; ++i ) {
template<> inline
Node RewriteRule<EvalSignExtend>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalSignExtend>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalSignExtend>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
unsigned amount = node.getOperator().getConst<BitVectorSignExtend>().signExtendAmount;
BitVector res = a.signExtend(amount);
template<> inline
Node RewriteRule<EvalEquals>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<EvalEquals>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<EvalEquals>(" << node << ")" << std::endl;
BitVector a = node[0].getConst<BitVector>();
BitVector b = node[1].getConst<BitVector>();
if (a == b) {
template<> inline
Node RewriteRule<ConcatFlatten>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << node << ")" << std::endl;
NodeBuilder<> result(kind::BITVECTOR_CONCAT);
std::vector<Node> processing_stack;
processing_stack.push_back(node);
}
}
Node resultNode = result;
- BVDebug("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << resultNode << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ConcatFlatten>(" << resultNode << ")" << std::endl;
return resultNode;
}
template<> inline
Node RewriteRule<ConcatExtractMerge>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ConcatExtractMerge>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ConcatExtractMerge>(" << node << ")" << std::endl;
std::vector<Node> mergedExtracts;
template<> inline
Node RewriteRule<ConcatConstantMerge>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ")" << std::endl;
std::vector<Node> mergedConstants;
for (unsigned i = 0, end = node.getNumChildren(); i < end;) {
}
}
- BVDebug("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ") => " << utils::mkConcat(mergedConstants) << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ConcatConstantMerge>(" << node << ") => " << utils::mkConcat(mergedConstants) << std::endl;
return utils::mkConcat(mergedConstants);
}
template<> inline
Node RewriteRule<ExtractWhole>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractWhole>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractWhole>(" << node << ")" << std::endl;
return node[0];
}
template<> inline
Node RewriteRule<ExtractConstant>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractConstant>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractConstant>(" << node << ")" << std::endl;
Node child = node[0];
BitVector childValue = child.getConst<BitVector>();
return utils::mkConst(childValue.extract(utils::getExtractHigh(node), utils::getExtractLow(node)));
template<> inline
bool RewriteRule<ExtractConcat>::applies(TNode node) {
- //BVDebug("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
+ //Debug("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
if (node.getKind() != kind::BITVECTOR_EXTRACT) return false;
if (node[0].getKind() != kind::BITVECTOR_CONCAT) return false;
return true;
template<> inline
Node RewriteRule<ExtractConcat>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractConcat>(" << node << ")" << std::endl;
int extract_high = utils::getExtractHigh(node);
int extract_low = utils::getExtractLow(node);
template<> inline
Node RewriteRule<ExtractExtract>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractExtract>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractExtract>(" << node << ")" << std::endl;
// x[i:j][k:l] ~> x[k+j:l+j]
Node child = node[0];
template<> inline
bool RewriteRule<FailEq>::applies(TNode node) {
- //BVDebug("bv-rewrite") << "RewriteRule<FailEq>(" << node << ")" << std::endl;
+ //Debug("bv-rewrite") << "RewriteRule<FailEq>(" << node << ")" << std::endl;
if (node.getKind() != kind::EQUAL) return false;
if (node[0].getKind() != kind::CONST_BITVECTOR) return false;
if (node[1].getKind() != kind::CONST_BITVECTOR) return false;
template<> inline
Node RewriteRule<SimplifyEq>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SimplifyEq>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SimplifyEq>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<ReflexivityEq>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ReflexivityEq>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ReflexivityEq>(" << node << ")" << std::endl;
return node[1].eqNode(node[0]);
}
template<> inline
Node RewriteRule<ExtractBitwise>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractBitwise>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractBitwise>(" << node << ")" << std::endl;
unsigned high = utils::getExtractHigh(node);
unsigned low = utils::getExtractLow(node);
std::vector<Node> children;
template<> inline
Node RewriteRule<ExtractNot>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractNot>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractNot>(" << node << ")" << std::endl;
unsigned low = utils::getExtractLow(node);
unsigned high = utils::getExtractHigh(node);
Node a = utils::mkExtract(node[0][0], high, low);
template<> inline
Node RewriteRule<ExtractArith>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractArith>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractArith>(" << node << ")" << std::endl;
unsigned low = utils::getExtractLow(node);
Assert (low == 0);
unsigned high = utils::getExtractHigh(node);
template<> inline
Node RewriteRule<ExtractArith2>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ExtractArith2>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ExtractArith2>(" << node << ")" << std::endl;
unsigned low = utils::getExtractLow(node);
unsigned high = utils::getExtractHigh(node);
std::vector<Node> children;
template<> inline
Node RewriteRule<FlattenAssocCommut>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<FlattenAssocCommut>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<FlattenAssocCommut>(" << node << ")" << std::endl;
std::vector<Node> processingStack;
processingStack.push_back(node);
std::vector<Node> children;
template<> inline
Node RewriteRule<PlusCombineLikeTerms>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<PlusCombineLikeTerms>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<PlusCombineLikeTerms>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node);
BitVector constSum(size, (unsigned)0);
std::map<Node, BitVector> factorToCoefficient;
template<> inline
Node RewriteRule<MultSimplify>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<MultSimplify>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<MultSimplify>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node);
BitVector constant(size, Integer(1));
template<> inline
Node RewriteRule<MultDistribConst>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<MultDistribConst>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<MultDistribConst>(" << node << ")" << std::endl;
TNode constant = node[1];
TNode factor = node[0];
// Doesn't do full solving (yet), instead, if a term appears both on lhs and rhs, it subtracts from both sides so that one side's coeff is zero
template<> inline
Node RewriteRule<SolveEq>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SolveEq>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SolveEq>(" << node << ")" << std::endl;
TNode left = node[0];
TNode right = node[1];
template<> inline
Node RewriteRule<BitwiseEq>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<BitwiseEq>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<BitwiseEq>(" << node << ")" << std::endl;
TNode term;
BitVector c;
template<> inline
Node RewriteRule<NegMult>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NegMult>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NegMult>(" << node << ")" << std::endl;
TNode mult = node[0];
NodeBuilder<> nb(kind::BITVECTOR_MULT);
BitVector bv(utils::getSize(node), (unsigned)1);
template<> inline
Node RewriteRule<NegSub>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NegSub>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NegSub>(" << node << ")" << std::endl;
return utils::mkNode(kind::BITVECTOR_SUB, node[0][1], node[0][0]);
}
template<> inline
Node RewriteRule<NegPlus>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NegPlus>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NegPlus>(" << node << ")" << std::endl;
std::vector<Node> children;
for (unsigned i = 0; i < node[0].getNumChildren(); ++i) {
children.push_back(utils::mkNode(kind::BITVECTOR_NEG, node[0][i]));
template<> inline
Node RewriteRule<AndSimplify>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<AndSimplify>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<AndSimplify>(" << node << ")" << std::endl;
// this will remove duplicates
std::hash_map<TNode, Count, TNodeHashFunction> subterms;
template<> inline
Node RewriteRule<OrSimplify>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<OrSimplify>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<OrSimplify>(" << node << ")" << std::endl;
// this will remove duplicates
std::hash_map<TNode, Count, TNodeHashFunction> subterms;
template<> inline
Node RewriteRule<XorSimplify>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<XorSimplify>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<XorSimplify>(" << node << ")" << std::endl;
std::hash_map<TNode, Count, TNodeHashFunction> subterms;
// template<> inline
// Node RewriteRule<AndSimplify>::apply(TNode node) {
-// BVDebug("bv-rewrite") << "RewriteRule<AndSimplify>(" << node << ")" << std::endl;
+// Debug("bv-rewrite") << "RewriteRule<AndSimplify>(" << node << ")" << std::endl;
// return resultNode;
// }
// template<> inline
// Node RewriteRule<>::apply(TNode node) {
-// BVDebug("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl;
+// Debug("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl;
// return resultNode;
// }
template<>
Node RewriteRule<UgtEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UgtEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UgtEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
Node result = utils::mkNode(kind::BITVECTOR_ULT, b, a);
template<>
Node RewriteRule<UgeEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UgeEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UgeEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
Node result = utils::mkNode(kind::BITVECTOR_ULE, b, a);
template<>
Node RewriteRule<SgtEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SgtEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SgtEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
Node result = utils::mkNode(kind::BITVECTOR_SLT, b, a);
template<>
Node RewriteRule<SgeEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SgeEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SgeEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
Node result = utils::mkNode(kind::BITVECTOR_SLE, b, a);
template <>
Node RewriteRule<SltEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SltEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SltEliminate>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node[0]);
Node pow_two = utils::mkConst(BitVector(size, Integer(1).multiplyByPow2(size - 1)));
template <>
Node RewriteRule<SleEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SleEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SleEliminate>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node[0]);
Node pow_two = utils::mkConst(BitVector(size, Integer(1).multiplyByPow2(size - 1)));
template <>
Node RewriteRule<CompEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<CompEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<CompEliminate>(" << node << ")" << std::endl;
Node comp = utils::mkNode(kind::EQUAL, node[0], node[1]);
Node one = utils::mkConst(1, 1);
Node zero = utils::mkConst(1, 0);
template <>
Node RewriteRule<SubEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SubEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SubEliminate>(" << node << ")" << std::endl;
Node negb = utils::mkNode(kind::BITVECTOR_NEG, node[1]);
Node a = node[0];
template<>
Node RewriteRule<RepeatEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<RepeatEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<RepeatEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned amount = node.getOperator().getConst<BitVectorRepeat>().repeatAmount;
Assert(amount >= 1);
template<>
Node RewriteRule<RotateLeftEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<RotateLeftEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<RotateLeftEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned amount = node.getOperator().getConst<BitVectorRotateLeft>().rotateLeftAmount;
amount = amount % utils::getSize(a);
template<>
Node RewriteRule<RotateRightEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<RotateRightEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<RotateRightEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned amount = node.getOperator().getConst<BitVectorRotateRight>().rotateRightAmount;
amount = amount % utils::getSize(a);
template<>
Node RewriteRule<NandEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NandEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NandEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
Node andNode = utils::mkNode(kind::BITVECTOR_AND, a, b);
template<>
Node RewriteRule<NorEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NorEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NorEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
Node orNode = utils::mkNode(kind::BITVECTOR_OR, a, b);
template<>
Node RewriteRule<XnorEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<XnorEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<XnorEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
Node xorNode = utils::mkNode(kind::BITVECTOR_XOR, a, b);
template<>
Node RewriteRule<SdivEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SdivEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SdivEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
template<>
Node RewriteRule<SremEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SremEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SremEliminate>(" << node << ")" << std::endl;
TNode a = node[0];
TNode b = node[1];
unsigned size = utils::getSize(a);
template<>
Node RewriteRule<SmodEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SmodEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SmodEliminate>(" << node << ")" << std::endl;
TNode s = node[0];
TNode t = node[1];
unsigned size = utils::getSize(s);
template<>
Node RewriteRule<ZeroExtendEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ZeroExtendEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ZeroExtendEliminate>(" << node << ")" << std::endl;
TNode bv = node[0];
unsigned amount = node.getOperator().getConst<BitVectorZeroExtend>().zeroExtendAmount;
template<>
Node RewriteRule<SignExtendEliminate>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<SignExtendEliminate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<SignExtendEliminate>(" << node << ")" << std::endl;
unsigned amount = node.getOperator().getConst<BitVectorSignExtend>().signExtendAmount;
if(amount == 0) {
template<> inline
Node RewriteRule<ShlByConst>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ShlByConst>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ShlByConst>(" << node << ")" << std::endl;
Integer amount = node[1].getConst<BitVector>().toInteger();
Node a = node[0];
template<> inline
Node RewriteRule<LshrByConst>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<LshrByConst>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<LshrByConst>(" << node << ")" << std::endl;
Integer amount = node[1].getConst<BitVector>().toInteger();
Node a = node[0];
template<> inline
Node RewriteRule<AshrByConst>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<AshrByConst>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<AshrByConst>(" << node << ")" << std::endl;
Integer amount = node[1].getConst<BitVector>().toInteger();
Node a = node[0];
template<> inline
Node RewriteRule<BitwiseIdemp>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<BitwiseIdemp>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<BitwiseIdemp>(" << node << ")" << std::endl;
return node[0];
}
template<> inline
Node RewriteRule<AndZero>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<AndZero>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<AndZero>(" << node << ")" << std::endl;
return utils::mkConst(utils::getSize(node), 0);
}
template<> inline
Node RewriteRule<AndOne>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<AndOne>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<AndOne>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node);
if (node[0] == utils::mkOnes(size)) {
template<> inline
Node RewriteRule<OrZero>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<OrZero>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<OrZero>(" << node << ")" << std::endl;
unsigned size = utils::getSize(node);
if (node[0] == utils::mkConst(size, 0)) {
template<> inline
Node RewriteRule<OrOne>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<OrOne>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<OrOne>(" << node << ")" << std::endl;
return utils::mkOnes(utils::getSize(node));
}
template<> inline
Node RewriteRule<XorDuplicate>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<XorDuplicate>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<XorDuplicate>(" << node << ")" << std::endl;
return utils::mkConst(BitVector(utils::getSize(node), Integer(0)));
}
template<> inline
Node RewriteRule<XorOne>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<XorOne>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<XorOne>(" << node << ")" << std::endl;
Node ones = utils::mkOnes(utils::getSize(node));
std::vector<Node> children;
bool found_ones = false;
template<> inline
Node RewriteRule<XorZero>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<XorZero>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<XorZero>(" << node << ")" << std::endl;
std::vector<Node> children;
Node zero = utils::mkConst(utils::getSize(node), 0);
template<> inline
Node RewriteRule<BitwiseNotAnd>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<BitwiseNegAnd>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<BitwiseNegAnd>(" << node << ")" << std::endl;
return utils::mkConst(BitVector(utils::getSize(node), Integer(0)));
}
template<> inline
Node RewriteRule<BitwiseNotOr>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<BitwiseNotOr>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<BitwiseNotOr>(" << node << ")" << std::endl;
uint32_t size = utils::getSize(node);
Integer ones = Integer(1).multiplyByPow2(size) - 1;
return utils::mkConst(BitVector(size, ones));
template<> inline
Node RewriteRule<XorNot>::apply(TNode node) {
Unreachable();
- BVDebug("bv-rewrite") << "RewriteRule<XorNot>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<XorNot>(" << node << ")" << std::endl;
Node a = node[0][0];
Node b = node[1][0];
return utils::mkNode(kind::BITVECTOR_XOR, a, b);
template<> inline
Node RewriteRule<NotXor>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NotXor>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NotXor>(" << node << ")" << std::endl;
std::vector<Node> children;
TNode::iterator child_it = node[0].begin();
children.push_back(utils::mkNode(kind::BITVECTOR_NOT, *child_it));
template<> inline
Node RewriteRule<NotIdemp>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<XorIdemp>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<XorIdemp>(" << node << ")" << std::endl;
return node[0][0];
}
template<> inline
Node RewriteRule<LtSelf>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<LtSelf>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<LtSelf>(" << node << ")" << std::endl;
return utils::mkFalse();
}
template<> inline
Node RewriteRule<LteSelf>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<LteSelf>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<LteSelf>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<UltZero>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UltZero>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UltZero>(" << node << ")" << std::endl;
return utils::mkFalse();
}
template<> inline
Node RewriteRule<UltSelf>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UltSelf>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UltSelf>(" << node << ")" << std::endl;
return utils::mkFalse();
}
template<> inline
Node RewriteRule<UleZero>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UleZero>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UleZero>(" << node << ")" << std::endl;
return utils::mkNode(kind::EQUAL, node[0], node[1]);
}
template<> inline
Node RewriteRule<UleSelf>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UleSelf>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UleSelf>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<ZeroUle>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ZeroUle>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ZeroUle>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<UleMax>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UleMax>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UleMax>(" << node << ")" << std::endl;
return utils::mkTrue();
}
template<> inline
Node RewriteRule<NotUlt>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NotUlt>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NotUlt>(" << node << ")" << std::endl;
Node ult = node[0];
Node a = ult[0];
Node b = ult[1];
template<> inline
Node RewriteRule<NotUle>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NotUle>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NotUle>(" << node << ")" << std::endl;
Node ult = node[0];
Node a = ult[0];
Node b = ult[1];
template<> inline
Node RewriteRule<MultPow2>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<MultPow2>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<MultPow2>(" << node << ")" << std::endl;
std::vector<Node> children;
unsigned exponent = 0;
template<> inline
Node RewriteRule<NegIdemp>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<NegIdemp>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<NegIdemp>(" << node << ")" << std::endl;
return node[0][0];
}
template<> inline
Node RewriteRule<UdivPow2>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UdivPow2>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UdivPow2>(" << node << ")" << std::endl;
Node a = node[0];
unsigned power = utils::isPow2Const(node[1]) -1;
template<> inline
Node RewriteRule<UdivOne>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UdivOne>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UdivOne>(" << node << ")" << std::endl;
return node[0];
}
template<> inline
Node RewriteRule<UdivSelf>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UdivSelf>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UdivSelf>(" << node << ")" << std::endl;
return utils::mkConst(utils::getSize(node), 1);
}
template<> inline
Node RewriteRule<UremPow2>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UremPow2>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UremPow2>(" << node << ")" << std::endl;
TNode a = node[0];
unsigned power = utils::isPow2Const(node[1]) - 1;
if (power == 0) {
template<> inline
Node RewriteRule<UremOne>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UremOne>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UremOne>(" << node << ")" << std::endl;
return utils::mkConst(utils::getSize(node), 0);
}
template<> inline
Node RewriteRule<UremSelf>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<UremSelf>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<UremSelf>(" << node << ")" << std::endl;
return utils::mkConst(utils::getSize(node), 0);
}
template<> inline
Node RewriteRule<ShiftZero>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<ShiftZero>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<ShiftZero>(" << node << ")" << std::endl;
return node[0];
}
template<> inline
Node RewriteRule<BBPlusNeg>::apply(TNode node) {
- BVDebug("bv-rewrite") << "RewriteRule<BBPlusNeg>(" << node << ")" << std::endl;
+ Debug("bv-rewrite") << "RewriteRule<BBPlusNeg>(" << node << ")" << std::endl;
std::vector<Node> children;
unsigned neg_count = 0;
// template<> inline
// Node RewriteRule<BBFactorOut>::apply(TNode node) {
-// BVDebug("bv-rewrite") << "RewriteRule<BBFactorOut>(" << node << ")" << std::endl;
+// Debug("bv-rewrite") << "RewriteRule<BBFactorOut>(" << node << ")" << std::endl;
// std::hash_set<TNode, TNodeHashFunction> factors;
// for (unsigned i = 0; i < node.getNumChildren(); ++i) {
// template<> inline
// Node RewriteRule<>::apply(TNode node) {
-// BVDebug("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl;
+// Debug("bv-rewrite") << "RewriteRule<>(" << node << ")" << std::endl;
// return ;
// }
#include <sstream>
#include "expr/node_manager.h"
-#ifdef CVC4_DEBUG
-#define BVDebug(x) Debug(x)
-#else
-#define BVDebug(x) if (false) Debug(x)
-#endif
-
namespace CVC4 {