}
}
}
+
}
void scanTerm(const ASTNode& varphi)
void convertFormulaToCNFPosXOR(const ASTNode& varphi, BeevMgr::ClauseList* defs)
{
+ ASTVec::const_iterator it = varphi.GetChildren().begin();
+ for (; it != varphi.GetChildren().end(); it++)
+ {
+ convertFormulaToCNF(*it, defs); // make pos and neg clause sets
+ }
BeevMgr::ClauseList* psi = convertFormulaToCNFPosXORAux(varphi, 0, defs);
info[varphi]->clausespos = psi;
+ ASTVec::const_iterator it2 = varphi.GetChildren().begin();
+ for (; it2 != varphi.GetChildren().end(); it2++){
+ reduceMemoryFootprintPos(*it2);
+ reduceMemoryFootprintNeg(*it2);
+ }
}
BeevMgr::ClauseList* convertFormulaToCNFPosXORAux(const ASTNode& varphi, unsigned int idx, BeevMgr::ClauseList* defs)
// (PRODUCT [idx] ; [idx+1])
// ; (PRODUCT NOT [idx] ; NOT [idx+1])
//****************************************
- convertFormulaToCNF(varphi[idx], defs);
renamesibs = (info[varphi[idx]]->clausespos)->size() > 1 ? true : false;
if (renamesibs)
{
{
setDoSibRenamingNeg(*info[varphi[idx + 1]]);
}
- convertFormulaToCNF(varphi[idx + 1], defs);
psi1 = PRODUCT(*(info[varphi[idx]]->clausespos), *(info[varphi[idx + 1]]->clausespos));
psi2 = PRODUCT(*(info[varphi[idx]]->clausesneg), *(info[varphi[idx + 1]]->clausesneg));
NOCOPY_INPLACE_UNION(psi1, psi2);
- reduceMemoryFootprintPos(varphi[idx]);
- reduceMemoryFootprintPos(varphi[idx + 1]);
- reduceMemoryFootprintNeg(varphi[idx]);
- reduceMemoryFootprintNeg(varphi[idx + 1]);
psi = psi1;
}
{
setDoSibRenamingNeg(*info[varphi[idx]]);
}
- convertFormulaToCNF(varphi[idx], defs);
psi1 = PRODUCT(*(info[varphi[idx]]->clausespos), *theta1);
psi2 = PRODUCT(*(info[varphi[idx]]->clausesneg), *theta2);
DELETE(theta1);
DELETE(theta2);
NOCOPY_INPLACE_UNION(psi1, psi2);
- reduceMemoryFootprintPos(varphi[idx]);
- reduceMemoryFootprintNeg(varphi[idx]);
psi = psi1;
}
void convertFormulaToCNFNegXOR(const ASTNode& varphi, BeevMgr::ClauseList* defs)
{
+ ASTVec::const_iterator it = varphi.GetChildren().begin();
+ for (; it != varphi.GetChildren().end(); it++)
+ {
+ convertFormulaToCNF(*it, defs); // make pos and neg clause sets
+ }
BeevMgr::ClauseList* psi = convertFormulaToCNFNegXORAux(varphi, 0, defs);
info[varphi]->clausesneg = psi;
+ ASTVec::const_iterator it2 = varphi.GetChildren().begin();
+ for (; it2 != varphi.GetChildren().end(); it2++){
+ reduceMemoryFootprintPos(*it2);
+ reduceMemoryFootprintNeg(*it2);
+ }
}
BeevMgr::ClauseList* convertFormulaToCNFNegXORAux(const ASTNode& varphi, unsigned int idx, BeevMgr::ClauseList* defs)
{
setDoSibRenamingPos(*info[varphi[idx + 1]]);
}
- convertFormulaToCNF(varphi[idx + 1], defs);
convertFormulaToCNF(varphi[idx], defs);
renamesibs = (info[varphi[idx]]->clausespos)->size() > 1 ? true : false;
{
setDoSibRenamingNeg(*info[varphi[idx + 1]]);
}
- convertFormulaToCNF(varphi[idx + 1], defs);
psi1 = PRODUCT(*(info[varphi[idx]]->clausesneg), *(info[varphi[idx + 1]]->clausespos));
psi2 = PRODUCT(*(info[varphi[idx]]->clausespos), *(info[varphi[idx + 1]]->clausesneg));
NOCOPY_INPLACE_UNION(psi1, psi2);
- reduceMemoryFootprintNeg(varphi[idx]);
- reduceMemoryFootprintPos(varphi[idx + 1]);
- reduceMemoryFootprintPos(varphi[idx]);
- reduceMemoryFootprintNeg(varphi[idx + 1]);
psi = psi1;
}
else
{
-
//****************************************
// (neg) XOR ~> UNION
// (PRODUCT NOT [idx] ; XOR [idx+1..])
{
setDoSibRenamingPos(*info[varphi[idx]]);
}
- convertFormulaToCNF(varphi[idx], defs);
psi1 = PRODUCT(*(info[varphi[idx]]->clausesneg), *theta1);
psi2 = PRODUCT(*(info[varphi[idx]]->clausespos), *theta2);
DELETE(theta1);
DELETE(theta2);
NOCOPY_INPLACE_UNION(psi1, psi2);
- reduceMemoryFootprintNeg(varphi[idx]);
- reduceMemoryFootprintPos(varphi[idx]);
psi = psi1;
}