}
-void UnconstrainedSimplifier::removeExpr(TNode expr)
-{
- ++d_numUnconstrainedElim;
- // TNodeCountMap::iterator find = d_visited.find(expr);
- // Assert(find != d_visited.end());
- // find->second = find->second - 1;
- // if (find->second == 0) {
- // for(TNode::iterator child_it = current.begin(); child_it != current.end(); ++ child_it) {
- // TNode childNode = *child_it;
- // toVisit.push_back(unc_preprocess_stack_element(childNode, current));
- // !!!
- // }
-}
-
-
void UnconstrainedSimplifier::processUnconstrained()
{
TNodeSet::iterator it = d_unconstrained.begin(), iend = d_unconstrained.end();
if ((uCond && uThen) || (uCond && uElse) || (uThen && uElse)) {
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (uThen) {
if (parent[1] != current) {
if (parent[1].isVar()) {
test = Rewriter::rewrite(parent[1].eqNode(parent[2]));
}
if (test == NodeManager::currentNM()->mkConst<bool>(false)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
{
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
Assert(parent[0] != parent[1] &&
(parent[0] == current || parent[1] == current));
if (currentSub.isNull()) {
case kind::BITVECTOR_NOT:
case kind::BITVECTOR_NEG:
case kind::UMINUS:
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
Assert(parent[0] == current);
if (currentSub.isNull()) {
currentSub = current;
// Unary operators that propagate unconstrainedness and return a different type
case kind::BITVECTOR_EXTRACT:
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
Assert(parent[0] == current);
if (currentSub.isNull()) {
currentSub = current;
if (allUnconstrained) {
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
if (allUnconstrained && allDifferent) {
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
if (allUnconstrained && allDifferent) {
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
case kind::BITVECTOR_SUB:
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
break;
}
}
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
break;
}
}
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
if (d_unconstrained.find(other) != d_unconstrained.end()) {
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
if (Rewriter::rewrite(test) != nm->mkConst<bool>(true)) {
break;
}
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
}
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}
// Array select - if array is unconstrained, so is result
case kind::SELECT:
if (parent[0] == current) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
Assert(current.getType().isArray());
if (currentSub.isNull()) {
currentSub = current;
d_unconstrained.find(parent[0]) != d_unconstrained.end()))) {
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (parent[0] != current) {
Assert(d_substitutions.hasSubstitution(parent[0]));
currentSub = d_substitutions.apply(parent[0]);
if (d_unconstrained.find(other) != d_unconstrained.end()) {
if (d_unconstrained.find(parent) == d_unconstrained.end() &&
!d_substitutions.hasSubstitution(parent)) {
- removeExpr(parent);
+ ++d_numUnconstrainedElim;
if (currentSub.isNull()) {
currentSub = current;
}