Iterate/Loop algebra
Jump to navigation
Jump to search
refers to any value independent of the current state of the block. Visit count specifically refers to the inner body, shown with an ellipsis.
| Theorem | Structure | Claim | Proof |
|---|---|---|---|
| Given |
*x< ... > |
By definition of the loop construct. | |
| Theorem 1 |
*c1<
*c2<
...
>
>
|
The inner body is executed times per each outer iteration, of which there are such. | |
| Theorem 2 |
*c1<
⋱
*cn<
...
>
⋰
>
|
Repeated application of Theorem 1. | |
| Theorem 3 |
*c<
*n<
...
>
>
|
On the -th iteration of the outer body, the inner body executes times. | |
| Theorem 4 |
*c<
*~n<
...
>
>
|
On the -th iteration of the outer body, the inner body executes times. | |
| Theorem 5 |
*c<
*~n<
...
>
!
>
|
By Theorem 4, the first iteration of the outer loop, VC increments by . The break immediately halts further iterations of the outer loop. |
- This is still a work in progress. It may be changed in the future.