|
ABSTRACT
In [12] the authors introduced the concept of binding time optimization and presented a series of data flow analytic methods for determining some of the binding time characteristics of programs. In this paper we extend that work by providing methods for determining the class of shapes which an unbounded data object may assume during execution of a LISP-like program, and describe a number of uses to which that information may be put to improve storage allocation in compilers and interpreters for advanced programming languages.We are concerned chiefly with finding, for each program point and variable a finite description of a set of graphs which includes all the shapes of values the variable could assume at that point during the execution of a program. If this set is small or regular in structure, this information can be used to optimize the program's execution, mainly by use of more efficient storage allocation schemes.In the first part we show how to construct from a program without selective updating a tree grammar whose nonterminals generate the desired sets of graphs; in this case they will all be trees. The tree grammars are of a more general form than is usually studied [8, 19], so we show that they may be converted to the usual form. The resulting tree grammar could naturally be viewed as a recursive type definition [11] of the values the variables may assume. Further, standard algorithms may be employed to test for infiniteness, emptiness or linearity of the tree structure.In the second part selective updating is allowed, so an alternate semantics is introduced which more closely resembles traditional LISP implementations, and which is equivalent to the tree model for programs without selective updating. In this model data objects are directed graphs. We devise a finite approximation method which provides enough information to detect cell sharing and cyclic structures whenever they can possibly occur. This information can be used to recognize when the use of garbage collection or of reference counts may be avoided.The work reported in the second part of this paper extends that of Schwartz [17] and Cousot and Cousot [7]. They have developed methods for determining whether the values of two or more variables share cells, while we provide information on the detailed structure of what is shared. The ability to detect cycles is also new. It also extends the work of Kaplan [13], who distinguishes only binary relations among the variables of a program, does not handle cycles, and does not distinguish selectors (so that his analysis applies to nodes representing sets rather than ordered tuples).
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
1
|
|
 |
2
|
|
| |
3
|
Brainerd, W. S., Tree Generating Regular Systems, Information and Control, vol. 14, 1969, pp. 217 - 231.
|
| |
4
|
Büchi, J. R., Regular Canonical Systems, Archiv f. Math. Logik und Grund., vol. 6, 1964, pp. 91 - 111.
|
 |
5
|
|
 |
6
|
|
 |
7
|
|
| |
8
|
Engelfriet, J., Tree Automata and Tree Grammars, DAIMI Report FN-10, Department of Computer Science, University of Aarhus, Denmark, 1975.
|
| |
9
|
|
| |
10
|
Goto, E., Monocopy and Associative Algorithms in an Extended LISP, University of Tokyo, Japan, May 1974.
|
| |
11
|
Hoare, C. A. R., Recursive Data Structures, Inter. J. Comp. and Sys. Sci., vol. 4, no. 2, 1975, pp. 105 - 132.
|
 |
12
|
|
| |
13
|
Kaplan, Marc, Relational Data Flow Analysis, Technical Report 243, Dept. of Elec. Eng. and Comp. Sci., Princeton University, April 1978 (revised).
|
 |
14
|
|
| |
15
|
|
| |
16
|
Reynolds, John C., Automatic Computation of Data Set Definitions, Proc. of IFIP Congress 68, August 1968, pp. B69 - B73.
|
| |
17
|
Schwartz, J. T., Optimization of Very High Level Languages - I: Value Transmission and Its Corollaries, Computer Languages, vol. 1, 1975, pp. 161 - 194.
|
| |
18
|
|
| |
19
|
Thatcher, J., Tree Automata: An Informal Survey, in Aho, Alfred (ed.), Currents in the Theory of Computing, Prentice-Hall, 1973, pp. 143 - 172.
|
CITED BY 32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Witold Charatonik , Andreas Podelski , Jean-Marc Talbot, Paths vs. trees in set-based program analysis, Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.330-337, January 19-21, 2000, Boston, MA, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Patrick Cousot , Radhia Cousot, Formal language, grammar and set-constraint-based program analysis by abstract interpretation, Proceedings of the seventh international conference on Functional programming languages and computer architecture, p.170-181, June 26-28, 1995, La Jolla, California, United States
|
|
|
|
|
|
Alexander Aiken , Edward L. Wimmers , T. K. Lakshman, Soft typing with conditional types, Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.163-173, January 16-19, 1994, Portland, Oregon, United States
|
|
|
|
|
|
Zhendong Su , Manuel Fähndrich , Alexander Aiken, Projection merging: reducing redundancies in inclusion constraint graphs, Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.81-95, January 19-21, 2000, Boston, MA, USA
|
|
|
|
|
|
|
|
|
|
|
|
Torben Mogensen , David Schmidt , I. Hal Sudborough, Preface, The essence of computation: complexity, analysis, transformation, Springer-Verlag New York, Inc., New York, NY, 2002
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mark Marron , Darko Stefanovic , Manuel Hermenegildo , Deepak Kapur, Heap analysis in the presence of collection libraries, Proceedings of the 7th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, p.31-36, June 13-14, 2007, San Diego, California, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|