The BoundInference class did not properly handle rewrites that yield constant Booleans. This PR fixes this issue by explicitly checking for this case.
const std::map<Node, Bounds>& BoundInference::get() const { return d_bounds; }
bool BoundInference::add(const Node& n)
{
+ Node tmp = Rewriter::rewrite(n);
+ if (tmp.getKind() == Kind::CONST_BOOLEAN)
+ {
+ return false;
+ }
// Parse the node as a comparison
- auto comp = Comparison::parseNormalForm(Rewriter::rewrite(n));
+ auto comp = Comparison::parseNormalForm(tmp);
auto dec = comp.decompose(true);
if (std::get<0>(dec).isVariable())
{
std::vector<Candidate> ICPSolver::constructCandidates(const Node& n)
{
- auto comp =
- Comparison::parseNormalForm(Rewriter::rewrite(n)).decompose(false);
+ Node tmp = Rewriter::rewrite(n);
+ if (tmp.isConst())
+ {
+ return {};
+ }
+ auto comp = Comparison::parseNormalForm(tmp).decompose(false);
Kind k = std::get<1>(comp);
if (k == Kind::DISTINCT)
{