4 ms·
Mentioning that this problem is generally undecidable would have been nice, together with an analysis of which heuristics are then used. As I see it, they more
by maweki 9y ago
Mentioning that this problem is generally undecidable would have been nice, together with an analysis of which heuristics are then used.
As I see it, they more or less just time the loops and if it was running too long it's an infinite loop.
The author suggests one edge case for this where the loop waits for user input.
So for some definition of infinity this might be okay.
- amasad 9y agoTime the loops plus an iteration counter. Together they work well. If something is taking long AND is looping a lot then there's a good chance we're running up against an infinite loop. Additionally we setTimeout and reset the counter so that we don't stop infinite generators. Good point re undecidability, it's a knowledge curse mistake.