First page Back Continue Last page Graphics
LOOP INVARIENT ASSERTION
An intellectual tool to help in designing loops.
Invarient means the same at each position
- Just before the while tests its condition for the first time.
- Just before reaching the end of the loop body.
- Also, before the loop runs and after the loop finishes.
- If all these are the same, the loop is guaranteed to work!