Required for fixing a bug in CNF stream's ensureLiteral, which was crashing when combined with unsat-cores-mode=assumptions.
With this PR, we assign a formula like (= (= x y) (= z w)) to have theoryOf THEORY_BOOL. Previously, it mistaken was assigned THEORY_UF if e.g. x,y z, w were terms whose type was an uninterpreted sort.
We should retest unsat-cores-mode=assumptions after this PR is merged.
TNode r = node[1];
TypeNode ltype = l.getType();
TypeNode rtype = r.getType();
- if (ltype != rtype)
+ // If the types are different, we must assign based on type due
+ // to handling subtypes (limited to arithmetic). Also, if we are
+ // a Boolean equality, we must assign THEORY_BOOL.
+ if (ltype != rtype || ltype.isBoolean())
{
- tid = Theory::theoryOf(l.getType());
+ tid = Theory::theoryOf(ltype);
}
else
{