🤖 AI Summary
This paper investigates Hoare logic and its dual—reverse Hoare logic—within partial and total correctness semantics, focusing on cyclic proof systems for loops. Addressing the limitation of traditional axiomatic methods, which require explicit loop invariants and termination measures, the paper introduces four unified cyclic proof systems: forward and backward variants for both partial and total correctness. It identifies a fundamental distinction: partial correctness systems satisfy coinductive soundness, whereas total correctness systems satisfy inductive soundness. All four systems are rigorously proven sound; relative completeness is established via a faithful translation from standard axiomatic systems to the cyclic ones. The work thus provides a unified, theoretically complete framework for loop reasoning that dispenses with explicit invariants and termination metrics, advancing foundational techniques for program verification under both partial and total correctness.
📝 Abstract
We examine the relationships between axiomatic and cyclic proof systems for the partial and total versions of Hoare logic and those of its dual, known as reverse Hoare logic (or sometimes incorrectness logic). In the axiomatic proof systems for these logics, the proof rules for looping constructs involve an explicit loop invariant, which in the case of the total versions additionally require a well-founded termination measure. In the cyclic systems, these are replaced by rules that simply unroll the loops, together with a principle allowing the formation of cycles in the proof, subject to a global soundness condition that ensures the well-foundedness of the circular reasoning. Interestingly, the cyclic soundness conditions for partial Hoare logic and its reverse are similar and essentially coinductive in character, while those for the total versions are also similar and essentially inductive. We show that these cyclic systems are sound, by direct argument, and relatively complete, by translation from axiomatic to cyclic proofs.