|
ABSTRACT
This paper extends the predicate calculus formalization of the partial correctness properties of programs (Ki, Go) to include the preservation of correctness under program transformations. The general notion of "program transformations which preserve properties" is fundamental to the theory of programming and programming languages. In the context of proofs of program correctness, transformations which preserve correctness can be used to improve less efficient, but easier to prove, programs. The basic argument in the use of correctness-preserving program transformations (hereafter CPTs) is:Assume that G is a program (with attached assertions) which has been proved correct with respect to some input-output relation Ain-Aout. Now suppose that S is some part of G, e.g. an expression, assertion, statement, etc., which is to be replaced by some other such part S' to produce the program G'. The goal is to prove that G' is also correct with respect to Ain-Aout and therefore the replacement preserves overall program correctness. Moreover, if the replacement has only a local effect, e.g. the body of a loop, then the proof of correctness-preservation should be restricted to that part of the program affected by the replacement.Section 2 reviews the current paradigm for proving program correctness. An example in section 3 illustrates CPTs in a sequence of improvements on a correct and simple, but inefficient, initial program. In section 4, the formalization of partial correctness properties of programs is recast as a semantic language definition using Knuth's semantic method (Kn1). This formalization is then used in section 5 to describe the mechanics of performing CPTs. In section 6, several questions about the formalization of sections 4 and 5 are discussed and a generalization is proposed. Finally, section 7 returns to a concrete example and suggests that the most effective use of CPTs is by identification of schematic forms. Related work is mentioned in section 8.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
(Bu) Burstall, R. M. "Proving properties of programs by structural induction," Computer Journal 12, (1969), 41-48.
|
| |
2
|
(DB) Darlington, J., and R. M. Burstall. "A System which automatically improves programs," Proc. 3rd Intl. Conf. on Artificial Intelligence, 479-485.
|
| |
3
|
(De) Deutsch, L. P. "An interactive program verifier," Ph.D. thesis, Univ. of California, Berkeley, 1973.
|
| |
4
|
(Di) Dijkstra, E. W. "A simple axiomatic basis for programming language constructs," EWD 372, Eindhoven, May, 1973.
|
| |
5
|
(Fl) Floyd, R. W. "Assigning meanings to programs," Proc. Symp. Appl. Math., Amer. Math. Soc., Vol. 19, 1967.
|
| |
6
|
(Ge) Gerhart, S. L. "Knowledge about programs: a model and case study," forthcoming technical report, Duke U.
|
| |
7
|
|
 |
8
|
|
| |
9
|
(Ho2) Hoare, C. A. R. "Proof of correctness of data representations," Acta Informatica 1, 271-281.
|
| |
10
|
|
| |
11
|
(Kn1) Knuth, D. E. "Semantics of context-free languages," Math. Systems Theory 2, 2, 127-145.
|
| |
12
|
(Kn2) Knuth, D. E. "Examples of formal semantics," Lecture Notes in Mathematics, Vol. 188, E. Engeler, Ed., Springer-Verlag, 212-235.
|
| |
13
|
(Kn3) Knuth, D. E. "Structured programming with GOTO statements," Stanford University Report STAN-CS-74-416, May, 1974.
|
| |
14
|
|
| |
15
|
(We) Wegbreit, B. "Multiple evaluators in an extensible programming system," FJCC 1972, 905-915.
|
CITED BY 29
|
|
|
|
|
David Harel , Amir Puneli , Jonathan Stavi, A complete axiomatic system for proving deductions about recursive programs, Proceedings of the ninth annual ACM symposium on Theory of computing, p.249-260, May 04-04, 1977, Boulder, Colorado, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thomas E. Cheatham, Jr. , Glenn H. Holloway , Judy A. Townley, Program refinement by transformation, Proceedings of the 5th international conference on Software engineering, p.430-437, March 09-12, 1981, San Diego, California, United States
|
|
|
|
|
|
C. J. Lucena , R. C. B. Martins , P. A. S. Veloso , D. D. Cowan, The data transform programming method: An example for file processing problems, Proceedings of the 7th international conference on Software engineering, p.388-397, March 26-29, 1984, Orlando, Florida, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
F. L. Bauer , M. Broy , R. Gnatz , W. Hesse , B. Krieg-Brückner , H. Partsch , P. Pepper , H. Wössner, Towards a wide spectrum language to support program specification and program development, ACM SIGPLAN Notices, v.13 n.12, p.15-24, December 1978
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|