Send external equalities from collapse selector as lemmas (#5346)
In
20e58d4, a policy change was made for datatypes to keep more inferences as internal facts.
This leads to a crash (issue #5344) where the equality status of two BV terms is asked by TheoryDatatypes, where the TheoryBV was not informed of the term, as datatypes kept it internal.
This refines the policy further such that the collapse selector rule is processed as a lemma for terms of external type. The reason is that this rule may generate new terms of external type. Other rules like unification retain the internal fact policy, as they do not generate new terms.
Fixes #5344.
FYI @barrettcw