Checking That One Loop Step Preserves an Invariant

Preservation assumes an invariant before an allowed iteration and proves it remains true afterward.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a copy loop
  2. Account for every path

Trace a copy loop

Assume the first \(i\) destination positions match their source values. Copying source position \(i\) to the matching destination and increasing \(i\) extends agreement by one. See zero-based indexing.

Account for every path

A branch skipping the copy but incrementing \(i\) can invalidate the claim unless another condition establishes agreement. Branch proofs show how to separate the paths.[1]

References

  1. Benjamin C. Pierce et al., Software Foundations ↩