3 ms·
You can detect some infinite loops with basic static analysis, but detecting all infinite loops would mean that you’ve solved the halting problem.
by jhardy54 3y ago
You can detect some infinite loops with basic static analysis, but detecting all infinite loops would mean that you’ve solved the halting problem.
- ben_w 3y agoI think you can detect either all infinite loops or only infinite loops, but there are many loops which might or might not be infinite under any possible test? So you could refuse to run any code with a loop whose termination isn't easily proven to be guaranteed[0], without violating the halting problem. [0] And, in practice, terminating quickly. I doubt they want people to start mining bitcoin on all of those expensive H100s.
- DonHopkins 3y agoWay back in the day, I heard a rumor that the Cray 1 could execute an infinite loop in 7.6 seconds.