Abstract
In older languages lists, trees and graphs are represented with sets of arrays where indices of elements correspond to pointers to the nodes of the data structure. We present an algorithm that replaces such arrays with objects allocated dynamically from the heap, and indices with true pointers. Generated pointers are strongly typed and elements of logically related arrays are combined into records. The algorithm is potentially useful, especially in automatic translation between high-level programming languages.
Similar content being viewed by others
References
H. Partsch and R. Steinbrüggen,Program transformation systems, ACM Computing Surveys15, 3, 199–236 (1983).
M. S. Feather,A survey and classification of some program transformation approaches and techniques, USC/Information Sciences Institute (1986).
A. Prudom and M. A. Hennell,Some problems concerning the automatic translation of Fortran to Algol 68, SIGPLAN Notices12, 6, 138–143 (1977).
R. A. Freak,A Fortran to Pascal translator, Software — Practice & Experience11, 7, 717–732 (1981).
E. A. Ashcroft and Z. Manna,Translating program schemas to while-schemas, SIAM, J. Comput.4, 2, 125-146 (1975).
G. Urschler,Automatic structuring of programs, IBM J. Res. Develop.19, 181–194 (1975).
E. S. Bainbridge,Minimal while programs, Mathematical Foundations of Programming, Lecture Notes in Computer Science45, 180–186, Springer-Verlag, Berlin (1976).
B. S. Baker,An algorithm for structuring flowgraphs, J. ACM24, 1, 98–120 (1977).
M. H. Williams and H. L. Ossher,Conversion of unstructured flow diagrams to structured form, The Computer Journal21, 2, 161–167 (1978).
J. Keohane, J. C. Cherniavsky and P. B. Henderson,On transforming control structures, SIAM J. Comput.11, 2, 268–286 (1982).
G. Ouslman,Unraveling unstructured programs, The Computer Journal25, 3, 379–387 (1982).
U. Lichtblau,Decompilation of control structures by means of graph transformations, Mathematical Foundations of Software Development, Proc. Conf. on Trees and Algebras in Programming, Berlin, Lecture Notes in Computer Science185, 284–297, Springer-Verlag (1985).
L. Ramshaw,Eliminating go to's while preserving program structure, Digital Systems Research Center (1985).
N. D. Jones and S. S. Muchnick,Binding time optimization in proramming languages: Some thoughts toward the design of an ideal language, 3rd ACM Symp. on Principles of Programming Languages, 77–94, Atlanta, Georgia (1976).
P. Cousot and R. Cousot,Static determination of dynamic properties of generalized type unions, Proc. ACM Conf. on Language Design for Reliable Software, SIGPLAN Notices12, 3, 77–94 (1977).
P. Cousot and R. Cousot,Abstract interpretation: A unified lattice model for static analysis of programs by construction of approximation fixpoints, 4th ACM Symp. on Principles of Programming Languages, 238–252 (1977).
M. A. Kaplan and J. D. Ullman,A scheme for the automatic inference of variable types, J. ACM27, 1, 128–145 (1980).
N. D. Jones and S. S. Muchnick,Flow-analysis and optimization of LISP-like structures, inProgram Flow Analysis: Theory and Applications, 102–131, N. D. Jones and S. S. Muchnick (editors), Prentice-Hall, Englewood Cliffs, New Jersey (1981).
E. Schonberg, J. T. Schwartz and M. Sharir,An automatic technique for selection of data representation in SETL programs, ACM Trans. Prog. Lang. Sys.3, 2, 126–143 (1981).
G. Weiss and E. Schonberg,Typefinding recursive structures: A data-flow analysis in the presence of infinite type sets, Proc. IEEE Int. Conf. on Computer Languages, 170–181, Washington D.C. (1986).
Specification for Compuer Programming Language Pascal, report BS6192: 1982, British Standards Institution (1982).
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Jokinen, M.O. Automatically replacing indices into parallel arrays with pointers to records. BIT 29, 227–238 (1989). https://doi.org/10.1007/BF01952678
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF01952678