Proving correctness of coroutines without history variables
- 29 Downloads
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.
KeywordsInformation System Operating System Data Structure Communication Network Information Theory
Unable to display preview. Download preview PDF.
- [APT77]Apt, K.R., Bergstra, J.A., Meertens, L.G.L.T.: Recursive assertions are not enough — or are they? Mathematical Centre IW 92, 1977Google Scholar
- [CK77a]Clarke, E.M.: Programming language constructs for which it is impossible to obtain good Hoare-like axiom systems. Proceedings of the 4th POPL, 1977Google Scholar
- [CK77b]Clarke, E.M.: Program invariants as fixed points. Proceedings of the 18th FOCS, 1977Google Scholar
- [CO75]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)Google Scholar
- [DE73]deBakker, J.W., Meertens, L.G.L.T.: On the completeness of the inductive assertion method. Mathematical Centre, December 1973Google Scholar
- [FL67]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)Google Scholar
- [GE76]Gerhart, S.L.: Proof techniques for transferral of program correctness. Technical Report CS-1976-13, Computer Science Department, Duke University, Durham, NCGoogle Scholar
- [GO75]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 1975Google Scholar
- [OW76a]Owicki, S.: A consistent and complete deductive system for the verification of parallel programs. 8th Annual Symposium on Theory of Computing, 1976Google Scholar
- [WI76]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 1966Google Scholar