Four proof rules for recursive procedures in a Pascal-like language are presented. The main rule deals with total correctness and is based on results of Gries and Martin. The rule is easier to apply than Martin's. It is introduced as an extension of a specification format for Pascal-procedures, with its associated correctness and invocation rules. It uses well-founded recursion and is proved under the postulate that a procedure is semantically equal to its body.
This rule for total correctness is compared with Hoare's rule for partial correctness of recursive procedures, in which no well-founded relation is needed. Both rules serve to prove correctness, i.e. sufficiency of certain preconditions. There are also two rules for proving necessity of preconditions. These rules can be used to give formal proofs of nontermination and refinement. They seem to be completely new.
KeywordsProof rule Recursive procedure Specification Weakest precondition Well-founded relation
Unable to display preview. Download preview PDF.
- [DiS90]Dijkstra, E. W. and Scholten, C. S.: Predicate calculus and program semantics. Springer V. 1990.Google Scholar
- [Gal87]Gallier, J.H.: Logic for Computer Science. Foundations of automatic theorem proving. Wiley & Sons 1987.Google Scholar
- [Gri8l]Gries, D.: The science of programming. Springer V. 1981.Google Scholar
- [Heh79]Hehner, E.C.R.:do Consideredod: a contribution to programming calculus. Acta Informatica11 (1979) 287–304.Google Scholar
- [Hes90]Hesselink, W.H.: Command algebras, recursion and program transformation. Formal Aspects of Computing2 (1990) 60–104.Google Scholar
- [Hes91]Hesselink, W.H.: Repetitions, known or unknown? Information Processing Letters40 (1991) 51–57.Google Scholar
- [Hes92]Hesselink, W.H.: Programs, Recursion and Unbounded Choice, predicate transformation semantics and transformation rules. Cambridge University Press, 1992 (Cambridge Tracts in Theoretical Computer Science 27).Google Scholar
- [Hoa71]Hoare, C.A.R.: Procedures and parameters: an axiomatic approach. In: Symposium on Semantics of Algorithmic Languages, (ed. E. Engeler), Springer V. (Lecture Notes in Math. 188) 1971, pp. 102–116.Google Scholar
- [JeW85]Jensen, K. and Wirth, N.: Pascal User Manual and Report, third edition. Springer V. 1985.Google Scholar
- [Jon92]Jonker, J.E.: On-the-fly garbage collection for several mutators. Distr. Comput.5 (1992) 187–199.Google Scholar
- [Kal90]Kaldewaij, A.: Programming: the Derivation of Algrithms. Prentice Hall International, 1990.Google Scholar
- [Mar83]Martin, A.J.: A general proof rule for procedures in predicate transformer semantics. Acta Informatica20 (1983), 301–313.Google Scholar