3 ms·
You're asking for a loop invariant to prove that a non-terminating loop terminates? That seems... somewhat contradictory. Either you can't prove that with a l
by AnimalMuppet 11y ago
You're asking for a loop invariant to prove that a non-terminating loop terminates? That seems... somewhat contradictory. Either you can't prove that with a loop invariant, or the proof must be invalid.
As you said, the machine eventually runs out of memory. But "loop invariants" don't usually include the machine running out of memory as the termination condition, because that's more a crash than a loop termination. (That is, whatever part of the program you wanted to execute after the zeno loop won't execute, because the program terminated, not just the loop.) So when we talk about loop termination, program-crashing events are usually out of scope. (That's something we also need to prove - no undesirable side effects - but that's actually a separate issue.)