Termination Measures and Well-Founded Orders
Prove progress with a measure in a well-founded order, including a lexicographic example where one counter increases.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A quantity needs a lower bound
An integer that strictly decreases can still run forever if negative values remain legal. A ranking function into the natural numbers must decrease on each iteration in which execution continues. This excludes an infinite run, since every finite decrease is at least one. Compare loop invariants, which describe facts preserved by the same transition. Together an invariant, a decrease argument and the exit condition establish total correctness.
One component can reset when another decreases
Consider a scheduler with \(b\) additional batches and \(r\) remaining jobs in the current batch. A job step decreases \(r\). At zero, starting the next batch decreases \(b\) and can reset \(r\) to any finite batch size. Rank states by the pair \((b,r)\) in lexicographic order on \(\mathbb N^2\). An infinite descending sequence would require infinitely many decreases of \(b\), or eventually infinitely many decreases of \(r\) after \(b\) stabilizes. Neither is possible. This proof establishes termination without a common upper bound on batch size. Bounding total work separately requires the job counts or an amortized analysis.[1]