Boolean(ASTNodeType _type);
virtual ~Boolean() {}
virtual Boolean *clone(CSolver *solver, CloneMap *map) = 0;
- virtual bool isTrue() {return false;}
- virtual bool isFalse() {return false;}
+ virtual bool isTrue() {return boolVal == BV_MUSTBETRUE;}
+ virtual bool isFalse() {return boolVal == BV_MUSTBEFALSE;}
Polarity polarity;
BooleanValue boolVal;
Vector<Boolean *> parents;
constraints.remove(bexpr);
}
+ replaceBooleanWithTrueNoRemove(bexpr);
+}
+
+void CSolver::replaceBooleanWithTrueNoRemove(BooleanEdge bexpr) {
uint size = bexpr->parents.getSize();
for (uint i = 0; i < size; i++) {
Boolean *parent = bexpr->parents.get(i);
updateMustValue(ptr, BV_MUSTBEFALSE);
else
updateMustValue(ptr, BV_MUSTBETRUE);
+
+ if (ptr->boolVal == BV_UNSAT)
+ setUnSAT();
+
+ replaceBooleanWithTrueNoRemove(constraint);
+ constraint->parents.clear();
}
}
SATEncoder *getSATEncoder() {return satEncoder;}
void replaceBooleanWithTrue(BooleanEdge bexpr);
+ void replaceBooleanWithTrueNoRemove(BooleanEdge bexpr);
void replaceBooleanWithFalse(BooleanEdge bexpr);
void replaceBooleanWithBoolean(BooleanEdge oldb, BooleanEdge newb);
CSolver *clone();