3 ms·
See https://blog.regehr.org/archives/140 https://blog.regehr.org/archives/140 for a longer discussion. (And to make it closer to our situation, assume that the
by eru 7y ago
See https://blog.regehr.org/archives/140 https://blog.regehr.org/archives/140 for a longer discussion.
(And to make it closer to our situation, assume that the loop being executed was looking for something that actually has a counterexample that could be found after a long time; instead of Fermat's last theorem.)
- pingyong 7y agoWhat point is there in deleting side-effect free loops though? Literally the only use for those is to trap the control flow.
- bluGill 7y agoThe only intentional use. However when writing generic code you often have code lines that after several levels of code inline reduce to that example.
- pingyong 7y agoSo, generic code with a loop, which, depending on parameters, sometimes has side effects and sometimes doesn't, and in the case that it doesn't have side effects it is still not easy to recognize if the loop terminates? I suppose that is possible, although I'm having a hard time coming up with any reasonable examples.