|
I read in the book somewhere that an invariant needs to be true when the program enters the body of the loop AND if the program goes all the way to the end of the body, the invariant must also be true coming out. That means the only way to get out of the loop without the invariant being true is using a break, which we shouldn't use. So what do we do???
|
Keep the invariant true by Mike O'Donnell, 2001, Oct 22
to: