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.
Similar content being viewed by others
References
Apt, K.R., Bergstra, J.A., Meertens, L.G.L.T.: Recursive assertions are not enough — or are they? Mathematical Centre IW 92, 1977
Clarke, E.M.: Programming language constructs for which it is impossible to obtain good Hoare-like axiom systems. Proceedings of the 4th POPL, 1977
Clarke, E.M.: Program invariants as fixed points. Proceedings of the 18th FOCS, 1977
Clint, M.: Program proving: Coroutines. Acta Informatica, 2, 50–63 (1973)
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)
deBakker, J.W., Meertens, L.G.L.T.: On the completeness of the inductive assertion method. Mathematical Centre, December 1973
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)
Gerhart, S.L.: Proof techniques for transferral of program correctness. Technical Report CS-1976-13, Computer Science Department, Duke University, Durham, NC
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
Hoare, C.A.R.: An axiomatic approach to computer programming. CACM, 12, 322–329 (1969)
Hoare, C.A.R., Lauer, P.E.: Consistent and complementary formal theories of the semantics of programming languages. Acta Informatica, 3, 135–154 (1974)
Howard, J.H.: Proving monitors. COMM ACM, 19, 273–279 (1976)
Manna, Z., Pneuli, A.: Formalization of properties of functional programs. JACM, 17, 555–569 (1970)
Owicki, S.: A consistent and complete deductive system for the verification of parallel programs. 8th Annual Symposium on Theory of Computing, 1976
Owicki, S., Gries, D.: An axiomatic proof technique for parallel programs I. Acta Informatica 6, 319–339 (1976)
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
Author information
Authors and Affiliations
Additional information
The preparation of this paper was supported by NSF Grant MCS-75-08146.
Rights 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
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1007/BF00263992