I\'m reading \"Introduction to Algorithm\" by CLRS. In chapter 2, the authors mention \"loop invariants\". What is a loop invariant?
Invariant in this case means a condition that must be true at a certain point in every loop iteration.
In contract programming, an invariant is a condition that must be true (by contract) before and after any public method is called.