Skip to main content
Log in

Abstract

The power and convenience of a programming language may be enhanced for certain applications by permitting treelike data structures to be defined by recursion. This paper suggests a pleasing notation by which such structures can be declared and processed; it gives the axioms which specify their properties, and suggests an efficient implementation method. It shows how a recursive data structure may be used to represent another data type, for example, a set. It then discusses two ways in which significant gains in efficiency can be made by selective updating of structures, and gives the relevant proof rules and hints for implementation. The examples show that a certain range of applications in symbol manipulation can be efficiently programmed without introducing the low-level concept of a reference into a high-level programming language.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. A. van Wijngaarden, ed., “Report on the algorithmic language ALGOL 68,”Num. Math. 14:79–218 (1969).

    Google Scholar 

  2. “PL/I Language Specifications,” IBM Order Number GY33-6003-2.

  3. P. Naur, ed., “Report on the algorithmic language ALGOL 60,”Num. Math. 1960:106–136.

  4. N. Wirth and C. A. R. Hoare, “A contribution to the development of ALGOL,”Comm. ACM 9 (June):6 (1966).

    Google Scholar 

  5. N. Wirth, “The programming language PASCAL,”Acta Informatica 1(1):35–63 (1971).

    Google Scholar 

  6. D. E. Knuth, “A review of structured programming,” CS-73-371, Department of Computer Science, Stanford University (June 1973).

  7. J. McCarthy, “A basis for a mathematical theory of computation,” in Braffort and Hirschberg, eds.,Computer Programming and Formal Systems (North-Holland, Amsterdam, 1963).

    Google Scholar 

  8. F. V. McBride, D. J. T. Morrison, and R. M. Pengelby, “A symbol manipulation system,” inMachine Intelligence 5 (Edinburgh University Press, 1970).

  9. D. B. Anderson, Private Communication.

  10. J. McCarthy, “Recursive functions of symbolic expressions and their computation by machine,”Comm. ACM 3(4):184–195 (1960).

    Google Scholar 

  11. D. T. Ross, “A generalized technique for symbol manipulation and numerical calculation,”Comm. ACM (March 1961).

  12. C. A. R. Hoare, “Proof of correctness of data representations,”Acta Informatica 1:271–281 (1972).

    Google Scholar 

  13. D. Michie, “Memo functions: a language feature with rote learning properties,” DMIP Memorandum MIP-R-29 (November 1967).

  14. R. Waldinger and K. N. Levitt, “Reasoning about programs,” inProceedings of ACM Sigact/Sigplan Symposium on Principles of Programming Language Design (Boston, 1973).

  15. J. Darlington and R. M. Burstall, “A system which automatically improves programs,” inProceedings of Third International Conference on Artificial Intelligence (Stanford, California, 1973), pp. 479–485.

  16. E. W. Dijkstra, “Notes on structured programming,” inStructured Programming (Academic Press, New York, 1972), pp. 1–82.

    Google Scholar 

  17. G. M. Birthwhistle, O. J. Dahl, B. Myhrhang, and K. Nygaard, SIMULABEGIN (Student Literatur, Auerbach, 1973).

    Google Scholar 

  18. S. C. Kleene,Introduction to Metamathematics (Van Nostrand, 1952).

  19. C. A. R. Hoare, A Note on Indirect Addressing, ALGOL Bulletin (June 1966).

  20. P. M. Cohn,Universal Algebra (Harper and Row, New York, 1965).

    Google Scholar 

  21. R. M. Burstall, “Proving programs by structural induction,”Comp. J. 12(1):41–48 (1969).

    Google Scholar 

  22. D. S. Scott, “The lattice of flow diagrams,” in E. Engeler, ed.,Symposium on Semantics of Algorithmic Languages (Springer Verlag, 1971).

  23. C. A. R. Hoare, “Record handling,” in F. Genuys, ed.,Programming Languages (Academic Press, New York, 1968), pp. 291–347.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

The work on this paper was supported in part by National Science Foundation under grant number GJ 36473X and ARPA Research Contract DAHC 15-73-0435.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Hoare, C.A.R. Recursive data structures. International Journal of Computer and Information Sciences 4, 105–132 (1975). https://doi.org/10.1007/BF00976239

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00976239

Key words

Navigation