3 ms·
If you are trying to prove (formally or informally) that a program is correct, loop invariants allow you to prove that loops do what you want. Contrapositively
by mjcohen 12y ago
If you are trying to prove (formally or informally) that a program is correct, loop invariants allow you to prove that loops do what you want. Contrapositively, if you can't write a loop invariant, you probably do not really understand what the loop is doing.
I have had Dijkstra's book for many years, and love it. It's a great read, and it should be reprinted or put into the public domain.