skip to main content
research-article
Open Access

Command algebras, recursion and program transformation

Authors Info & Claims
Published:01 March 1990Publication History
Skip Abstract Section

Abstract

Abstract

Dijkstra's language of guarded commands is extended with recursion and transformed into algebra. The semantics is expressed in terms of weakest preconditions and weakest liberal preconditions. Extreme fixed points are used to deal with recursion. Unbounded nondeterminacy is allowed. The algebraic setting enables us to develop efficient transformation rules for recursive procedures. The main result is an algebraic version of the rule of computational induction. In this version, certain parts of the programs are restricted to finite nondeterminacy. It is shown that without this restriction the rule would not be valid. Some applications of the rule are presented. In particular, we prove the correctness of an iterative stack implementation of a class of simple recursive procedures.

References

  1. [Apt81] Apt K. R.Ten Years of Hoare's Logic. A Survey — Part 1ACM Transactions on Programming Languages and Systems19813431483Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. [Bac87] Back, R. J. R.: A calculus of refinements for program derivations.Dept. Comp. Sci. Abo Finland, Ser. A,54, (1987).Google ScholarGoogle Scholar
  3. [BBK87] Baeten J. C. M.Bergstra J. A.Klop J. W.On the consistency of Koomen's fair abstraction ruleTheoretical Computer Science19875112917610.1016/0304-3975(87)90052-1Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. [Bak80] Bakker, J. W. de:Mathematical Theory of Program Correctness, Prentice-Hall, 1980.Google ScholarGoogle Scholar
  5. [BaW81] Bauer, F. L. and Wossner H.:Algorithmische Sprache und Programmentwicklung, Springer-Verlag, 1981.Google ScholarGoogle Scholar
  6. [Dij76] Dijkstra, E. W.:A Discipline of Programming, Prentice-Hall, 1976.Google ScholarGoogle Scholar
  7. [Dij82] Dijkstra, E. W.:Selected Writings on Computing: a Personal Perspective, Springer-Verlag, 1982.Google ScholarGoogle Scholar
  8. [DiS90] Dijkstra, E. W. and Scholten, C. S.:Predicate Calculus and Program Semantics, Springer-Verlag (1990).Google ScholarGoogle Scholar
  9. [Gri81] Gries, D.:The Science of Programming., Springer-Verlag, 1981.Google ScholarGoogle Scholar
  10. [Hes88a] Hesselink W. H.Interpretations of Recursion Under Unbounded NondeterminacyTheoretical Computer Sceience198859211234Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. [Hes89a] Hesselink W. H.Predicate Transformer Semantics of General Recursion (WHH 8)Acta Informatica198926309332Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. [Hes88b] Hesselink, W. H.: An Algebraic Calculus of Commands (WHH 13). Tech. Rep. CS 8808, Groningen University, 1988.Google ScholarGoogle Scholar
  13. [Hes89b] Hesselink, W. H.: Modalities of Nondeterminacy. Draft, September 1989.Google ScholarGoogle Scholar
  14. [Hoa71] Hoare, C. A. R.: Procedures and Parameters: an Axiomatic Approach. In:Symposium on Semantics of Algorithmic Languages, E. Engeler (ed.), Lecture Notes in Math. 188, pp. 102–116, Springer-Verlag, 1971.Google ScholarGoogle Scholar
  15. [Hoa78] Hoare C. A. R.Some Properties of Predicate TransformersJ. ACM197825461480Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. [Kel55] Kelley, J. L.:General Topology. Van Nostrand, 1955.Google ScholarGoogle Scholar
  17. [Lak76] Lakatos, I.:Proofs and Refutations: the Logic of Mathematical Discovery J. Worrall and E. Zahar, (eds), Cambridge University Press, 1976.Google ScholarGoogle Scholar
  18. [Man74] Manna, Z.:Mathematical Theory of Computation. McGraw-Hill, 1974.Google ScholarGoogle Scholar
  19. [Mor87] Morgan C. C.Data Refinement by MiraclesInformation Processing Letters1987/8826243246Google ScholarGoogle Scholar
  20. [MoG88] Morgan, C. C. and Gardiner, P. H. B.: Data refinement by calculation. Draft, July 1988.Google ScholarGoogle Scholar
  21. [Nel87] Nelson G.A generalization of Dijkstra's CalculusACM Transactions on Programming Languages and Systems198911517561Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. [TaZ71] Takeuti, G. and Zaring, W. M.:Introduction to Axiomatic Set Theory. Graduate texts in mathematics 1, Springer-Verlag, 1971.Google ScholarGoogle Scholar

Index Terms

  1. Command algebras, recursion and program transformation
            Index terms have been assigned to the content through auto-classification.

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader