The co-invariant generator: An aid in deriving loop bodies
David Perkins Billington, R. Geoff Dromey · Formal Aspects of Computing · 1996
Abstract Given a loop invariant, I , and an assignment, α , which decreases the variant, we define a constructive function, cg, called the co-invariant generator, which has the property that I Λ cg ( α, I ) ⇒ wp ( α, I ), where wp ( α, I ) is the weakest precondition for α to establish I. Several results about the co-invariant generator are proved, important special cases are considered, and a non-trivial example of its use in deriving the body of a loop is given. We also define a function which performs a related constructive action on terms formed from binary operations. The coinvariant generator makes a useful contribution to formalising and automating a key step in program derivation.