Abstract
A calculus for developing programs from specifications written as predicates that describe the relationship between the initial and final state is proposed. Such specifications are well known from the specification language Z. All elements of a simple sequential programming notation are defined in terms of predicates. Hence programs form a subset of specifications. In particular, sequential composition is defined by ‘demonic composition’, non-deterministic choice by ‘demonic disjunction’, and iteration by fixed points. Laws are derived which allow proving equivalence and refinement of specifications and programs by a series of steps. The weakest precondition calculus is also included. The approach is compared to the predicative programming approach of E. Hehner and to other refinement calculi.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Back, R. J. R. A Calculus of Refinement for Program Derivations. Acta Informatica 23 (1988).
Dijkstra, E. W. A Discipline of Programming. Prentice Hall, 1976.
Dijkstra, E. W. and C. S. Scholten. Predicate Calculus and Program Semantics. Springer-Verlag, 1990.
Gravell, A. Constructive Refinement of First Order Specifications. to appear in Proceedings of the 5th Refinement Workshop, Springer-Verlag, 1992.
Hehner, E. C. R. Predicative Programming — Parts I and II. Communications of the ACM 27, 2 (1984).
Hehner, E. C. R., L. E. Gupta, and A. J. Malton. Predicative Methodology. Acta Informatica 23 (1986).
Hehner, E. C. R. Termination is Timing. In J. L. A. van de Snepscheut (Ed.) Mathematics of Program Construction, Springer-Verlag, 1989.
Hoare, C. A. R. and He Jifeng. The weakest prespecification. Fundamenta Informaticae 9 (1986).
Hoare, C. A. R., I. J. Hayes, He Jifeng, C. C. Morgan, A. W. Roscoe, J. W. Sanders, I. H. Sorensen, J. M. Spivey, and B. A. Sufrin. Laws of Programming. Communications of the ACM 30, 8 (1987).
King, S. Z and the Refinement Calculus. In D. Bjorner, C. A. R. Hoare, J. Langmaack (Eds.) VDM '90: VDM and Z — Formal Methods in Software Development Springer-Verlag, 1990.
Morgan, C. The Specification Statement. ACM Transactions on Programming Languages and Systems 10, 3 (1988).
Morgan, C. Programming from Specifications. Prentice Hall, 1990.
Morris, J. M. Programs from Specifications. In Dijkstra, E. W. (Ed.) Formal Development of Programs and Proofs. Addison Wesley, 1990.
Nelson, G. A Generalization of Dijkstra's Calculus. ACM Transactions on Programming Languages and Systems 11, 4 (1989).
Spivey, J. M. The Z Reference Manual. Prentice Hall, 1989.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sekerinski, E. (1993). A calculus for predicative programming. In: Bird, R.S., Morgan, C.C., Woodcock, J.C.P. (eds) Mathematics of Program Construction. MPC 1992. Lecture Notes in Computer Science, vol 669. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-56625-2_20
Download citation
DOI: https://doi.org/10.1007/3-540-56625-2_20
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-56625-0
Online ISBN: 978-3-540-47613-9
eBook Packages: Springer Book Archive