Abstract
The meaning of an imperative program is defined to be the precondition of the executions as a function of proposed behaviour. In the case of Dijkstra's weakest precondition, the proposed behaviour is termination in a state with a given postcondition. For the temporal predicate transformers of Lukkien, the proposed behaviour is specified in terms of predicates on the intermediate states. For example, for a command c and predicates p, q and r, the predicate wto.p.q.c.r is the precondition such that, for every execution sequence of c, a state in which p holds is eventually followed by a state in which q holds or by termination in a state in which r holds.
We present these precondition functions for a language with operators for sequential composition, unbounded demonic choice and recursive procedures. Recursion is interpreted by means of extreme fixpoints. The treatment of “eventually” is a straightforward generalization of the ordinary wp-calculus. For the treatment of “leads-to”, the new concept of accumulator turns out to be useful. The proofs of Lukkien's healthiness laws lead to insights in fixpoint induction. Some of the laws require the recursion to be guarded. It is shown that unfolding of the declaration preserves the semantics.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
R.J.R. Back, J. von Wright: Refinement calculus, Part I: Sequential Nondeterministic Programs. In: J.W. de Bakker, W.-P. de Roever, G. Rozenberg (eds.): Stepwise Refinement of Distributed Systems. Lecture Notes in Computer Science 430 (Springer, Berlin, 1990) pp. 42–66.
J.W. de Bakker: Mathematical theory of program correctness. Prentice-Hall, 1980. [CM] K.M. Chandy, J. Misra [1988]: Parallel Program Design, A Foundation (Addison-Wesley, 1988).
E.W. Dijkstra: A discipline of programming. Prentice-Hall 1976.
E.W. Dijkstra, C.S. Scholten: Predicate calculus and program semantics. Springer V. 1990.
W.H. Hesselink: Programs, Recursion and Unbounded Choice, predicate transformation semantics and transformation rules. Cambridge University Press 1992.
W.H. Hesselink: Nondeterminacy and recursion via stacks and queues. Computing Science Notes Groningen CS 9109.
J.J. Lukkien: Parallel Program Design and Generalized Weakest Preconditions. Thesis, Groningen, 1991.
J.J. Lukkien, J.L.A. van de Snepscheut: Weakest preconditions for progress. Formal Aspects of Computing 4 (1992) 195–236.
C. Morgan: Programming from Specifications. Prentice Hall, 1990.
C. Morgan, P.H.B. Gardiner: Data refinement by calculation. Acta Informatica 27 (1990) 481–503.
J.M. Morris: A theoretical basis for stepwise refinement and the programming calculus. Science of Comp. Programming 9 (1987) 287–306.
J.M. Morris: Temporal predicate transformers and fair termination. Acta Informatica 27 (1990) 287–313.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hesselink, W.H., Reinds, R. (1993). Temporal preconditions of recursive procedures. In: de Bakker, J.W., de Roever, W.P., Rozenberg, G. (eds) Semantics: Foundations and Applications. REX 1992. Lecture Notes in Computer Science, vol 666. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-56596-5_36
Download citation
DOI: https://doi.org/10.1007/3-540-56596-5_36
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-56596-3
Online ISBN: 978-3-540-47595-8
eBook Packages: Springer Book Archive