The nature of loops in programming
By: Bertrand Meyer
Potential Business Impact:
Simplifies proving computer programs work correctly.
In program semantics and verification, reasoning about loops is complicated by the need to produce two separate mathematical arguments: an invariant, for functional properties (ignoring termination); and a variant, for termination (ignoring functional properties). A single and simple definition is possible, removing this split. A loop is just the limit (a variant of the reflexive transitive closure) of a Noetherian (well-founded) relation. To prove the loop correct there is no need to devise an invariant and a variant; it suffices to identify the relation, yielding both partial correctness and termination. The present note develops the (small) theory and applies it to standard loop examples and proofs of their correctness.
Similar Papers
Cyclic Proofs in Hoare Logic and its Reverse
Logic in Computer Science
Proves computer programs work correctly, even with loops.
Reasoning about concurrent loops and recursion with rely-guarantee rules
Logic in Computer Science
Helps computers check tricky programs safely.
From Affine to Polynomial: Synthesizing Loops with Branches via Algebraic Geometry
Programming Languages
Finds errors in computer programs automatically.