Can a Turing recognizable language be decidable if it is possible to enumerate its strings in non-decreasing length?
I think it's not because you can go to infinity, and this will make it undecidable right?
Can a Turing recognizable language be decidable if it is possible to enumerate its strings in non-decreasing length?
I think it's not because you can go to infinity, and this will make it undecidable right?
The question is about searching for an element in an infinite stream S of ordered elements: a very natural algorithmic question.
This problem is indeed decidable, although in a somewhat sneaky way. You need to reason by cases. If elements in S have an upper bound, then S is finite, and hence it is decidable since every finite set is decidable. On the other side, if S has no bound, it contains elements larger than any number. So, if you are looking for w, it is enough to enumerate until you find an element larger or equal to w (that must exists), and then compare it with w.
However, the proof is not constructive, since you cannot decide if a r.e. set is finite or not. This means that you know (in classical sense) that there must exist some program deciding S, but you have no way to derive it from the code enumerating S. A quite frustrating situation :)