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.
Similar content being viewed by others
References
A. van Wijngaarden, ed., “Report on the algorithmic language ALGOL 68,”Num. Math. 14:79–218 (1969).
“PL/I Language Specifications,” IBM Order Number GY33-6003-2.
P. Naur, ed., “Report on the algorithmic language ALGOL 60,”Num. Math. 1960:106–136.
N. Wirth and C. A. R. Hoare, “A contribution to the development of ALGOL,”Comm. ACM 9 (June):6 (1966).
N. Wirth, “The programming language PASCAL,”Acta Informatica 1(1):35–63 (1971).
D. E. Knuth, “A review of structured programming,” CS-73-371, Department of Computer Science, Stanford University (June 1973).
J. McCarthy, “A basis for a mathematical theory of computation,” in Braffort and Hirschberg, eds.,Computer Programming and Formal Systems (North-Holland, Amsterdam, 1963).
F. V. McBride, D. J. T. Morrison, and R. M. Pengelby, “A symbol manipulation system,” inMachine Intelligence 5 (Edinburgh University Press, 1970).
D. B. Anderson, Private Communication.
J. McCarthy, “Recursive functions of symbolic expressions and their computation by machine,”Comm. ACM 3(4):184–195 (1960).
D. T. Ross, “A generalized technique for symbol manipulation and numerical calculation,”Comm. ACM (March 1961).
C. A. R. Hoare, “Proof of correctness of data representations,”Acta Informatica 1:271–281 (1972).
D. Michie, “Memo functions: a language feature with rote learning properties,” DMIP Memorandum MIP-R-29 (November 1967).
R. Waldinger and K. N. Levitt, “Reasoning about programs,” inProceedings of ACM Sigact/Sigplan Symposium on Principles of Programming Language Design (Boston, 1973).
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.
E. W. Dijkstra, “Notes on structured programming,” inStructured Programming (Academic Press, New York, 1972), pp. 1–82.
G. M. Birthwhistle, O. J. Dahl, B. Myhrhang, and K. Nygaard, SIMULABEGIN (Student Literatur, Auerbach, 1973).
S. C. Kleene,Introduction to Metamathematics (Van Nostrand, 1952).
C. A. R. Hoare, A Note on Indirect Addressing, ALGOL Bulletin (June 1966).
P. M. Cohn,Universal Algebra (Harper and Row, New York, 1965).
R. M. Burstall, “Proving programs by structural induction,”Comp. J. 12(1):41–48 (1969).
D. S. Scott, “The lattice of flow diagrams,” in E. Engeler, ed.,Symposium on Semantics of Algorithmic Languages (Springer Verlag, 1971).
C. A. R. Hoare, “Record handling,” in F. Genuys, ed.,Programming Languages (Academic Press, New York, 1968), pp. 291–347.
Author information
Authors and Affiliations
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
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
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF00976239