Abstract
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.
Similar content being viewed by others
References
Dijkstra, E. W. and Scholten, C. S.: Predicate calculus and program semantics. Springer V. 1990.
Gallier, J.H.: Logic for Computer Science. Foundations of automatic theorem proving. Wiley & Sons 1987.
Gries, D.: The science of programming. Springer V. 1981.
Hehner, E.C.R.:do Consideredod: a contribution to programming calculus. Acta Informatica11 (1979) 287–304.
Hesselink, W.H.: Command algebras, recursion and program transformation. Formal Aspects of Computing2 (1990) 60–104.
Hesselink, W.H.: Repetitions, known or unknown? Information Processing Letters40 (1991) 51–57.
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).
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.
Jensen, K. and Wirth, N.: Pascal User Manual and Report, third edition. Springer V. 1985.
Jonker, J.E.: On-the-fly garbage collection for several mutators. Distr. Comput.5 (1992) 187–199.
Kaldewaij, A.: Programming: the Derivation of Algrithms. Prentice Hall International, 1990.
Martin, A.J.: A general proof rule for procedures in predicate transformer semantics. Acta Informatica20 (1983), 301–313.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Hesselink, W.H. Proof rules for recursive procedures. Formal Aspects of Computing 5, 554–570 (1993). https://doi.org/10.1007/BF01211249
Received:
Accepted:
Issue Date:
DOI: https://doi.org/10.1007/BF01211249