Reasoning about loops in total and general correctness

  • Authors:
  • Steve E. Dunne;Ian J. Hayes;Andy J. Galloway

  • Affiliations:
  • School of Computing, University of Teesside, Middlesbrough, UK;School of Information Technology and Electrical Engineering, University of Queensland, Brisbane, Australia;Department of Computer Science, University of York, York, UK

  • Venue:
  • UTP'08 Proceedings of the 2nd international conference on Unifying theories of programming
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

We introduce a calculus for reasoning about programs in total correctness which blends UTP designs with von Wright's notion of a demonic refinement algebra. We demonstrate its utility in verifying the familiar loop-invariant rule for refining a total-correctness specification by a while loop. Total correctness equates non-termination with completely chaotic behaviour, with the consequence that any situation which admits non-termination must also admit arbitrary terminating behaviour. General correctness is more discriminating in allowing nontermination to be specified together with more particular terminating behaviour. We therefore introduce an analogous calculus for reasoning about programs in general correctness which blends UTP prescriptions with a demonic refinement algebra. We formulate a loop-invariant rule for refining a general-correctness specification by a while loop, and we use our general-correctness calculus to verify the new rule.