|
|
|
|
|
by jameshart
845 days ago
|
|
If you write a program whose behavior is Collatz-like (say, in some states it queues up more work for itself, and in other states it completes work from the queue, and you believe that in general it should always ultimately complete the queue) it is actually useful to have a static analyzer tell you ‘it’s not entirely clear that this code will ever terminate’. You can make the analyzer happy by adding a max iteration limit or a recursion depth limit or something to make sure it fails out rather than looping forever. Which is probably a good idea anyway, if you’re running code that you can’t mathematically prove will always complete. |
|