Skip to main content
Log in

Proving correctness of coroutines without history variables

  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

We examine the question of whether history variables are necessary in formal proofs of correctness for coroutines. History variables are special variables, which are added to a program to facilitate its proof by recording the sequence of states reached by the program during a computation; after the proof has been completed the history variables may be deleted. The use of such variables in correctness proofs was first suggested by Clint [CL73] in a paper entitled “Program Proving: Coroutines;” subsequently, history variables have been used by Owicki [OW76a] and Howard [HO75] in verifying concurrent programs and by Apt [APT77] in verifying sequential programs. We argue that recording the entire history of a computation in a single set of variables can actually complicate a correctness proof and should be avoided if possible. We propose a modification of Clint's axiom system and a strategy for constructing proofs that eliminates the need for history variables in verifying simple coroutines. Examples (including Clint's program “Histo”) are given to illustrate this technique of verifying coroutines, and our axiom system is shown to be sound and relatively complete with respect to an operational semantics for coroutines. Finally, we discuss extensions of the coroutine concept for which history variables do appear to be needed; we also discuss the question of whether such variables are necessary in verifying concurrent programs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Apt, K.R., Bergstra, J.A., Meertens, L.G.L.T.: Recursive assertions are not enough — or are they? Mathematical Centre IW 92, 1977

  2. Clarke, E.M.: Programming language constructs for which it is impossible to obtain good Hoare-like axiom systems. Proceedings of the 4th POPL, 1977

  3. Clarke, E.M.: Program invariants as fixed points. Proceedings of the 18th FOCS, 1977

  4. Clint, M.: Program proving: Coroutines. Acta Informatica, 2, 50–63 (1973)

    Article  Google Scholar 

  5. Cook, S.A.: Axiomatic and interpretative semantics for an Algol fragment. Technical Report 79, Department of Computer Science, University of Toronto, 1975 (to be published in SCICOMP)

  6. deBakker, J.W., Meertens, L.G.L.T.: On the completeness of the inductive assertion method. Mathematical Centre, December 1973

  7. Floyd, R.W.: Assigning meaning to programs. In: Mathematical Aspects of Computer Science. Proc. Symposia in Applied Mathematics (J.T. Schwartz, ed.) Amer. Math. Soc., 19, 19–32 (1976)

  8. Gerhart, S.L.: Proof techniques for transferral of program correctness. Technical Report CS-1976-13, Computer Science Department, Duke University, Durham, NC

  9. Gorelick, G.: A complete axiomatic system for proving assertions about recursive and non-recursive programs. Technical Report No. 75, Department of Computer Science, University of Toronto, January 1975

  10. Hoare, C.A.R.: An axiomatic approach to computer programming. CACM, 12, 322–329 (1969)

    Article  Google Scholar 

  11. Hoare, C.A.R., Lauer, P.E.: Consistent and complementary formal theories of the semantics of programming languages. Acta Informatica, 3, 135–154 (1974)

    MathSciNet  MATH  Google Scholar 

  12. Howard, J.H.: Proving monitors. COMM ACM, 19, 273–279 (1976)

    Article  Google Scholar 

  13. Manna, Z., Pneuli, A.: Formalization of properties of functional programs. JACM, 17, 555–569 (1970)

    Article  MathSciNet  Google Scholar 

  14. Owicki, S.: A consistent and complete deductive system for the verification of parallel programs. 8th Annual Symposium on Theory of Computing, 1976

  15. Owicki, S., Gries, D.: An axiomatic proof technique for parallel programs I. Acta Informatica 6, 319–339 (1976)

    Article  MathSciNet  Google Scholar 

  16. Van Wijngaarden, A.: Recursive definition of syntax and semantics. In: Formal Language Description Languages for Computer Programming (T.B. Steel, Jr., ed.) Amsterdam: North Holland 1966

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

The preparation of this paper was supported by NSF Grant MCS-75-08146.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Clarke, E.M. Proving correctness of coroutines without history variables. Acta Informatica 13, 169–188 (1980). https://doi.org/10.1007/BF00263992

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00263992

Keywords

Navigation