Abstract
A system called BURS that is based on term rewrite systems and a search algorithm A* are combined to produce a code generator that generates optimal code. The theory underlying BURS is re-developed, formalised and explained in this work. The search algorithm uses a cost heuristic that is derived from the term rewrite system to direct the search. The advantage of using a search algorithm is that we need to compute only those costs that may be part of an optimal rewrite sequence.
Chapter PDF
Similar content being viewed by others
References
A. V. Aho, M. Ganapathi, and S. W. K. Tjiang. Code generation using tree matching and dynamic programming. ACM Transactions on Programming Languages and Systems, 11(4):491–516, October 1989.
A. Balachandran, D. M. Dhamdhere, and S. Biswas. Efficient retargetable code generation using bottom-up tree pattern matching. Computer Languages, 15(3): 127–140, 1990.
J. Cai, R. Paige, and R. Tarjan. More efficient bottom-up multi-pattern matching in trees. Theoretical Computer Science, 106:21–60, 1992.
R. G. G. Cattell. Code generation in a machine-independent compiler. Proceedings of the ACM SIGPLAN 1979 Symposium on Compiler Construction, ACM SIGPLAN Notices, 14(8):65–75, August 1979.
R. G. G. Cattell. Automatic derivation of code generators from machine descriptions. ACM Transactions on Programming Languages and Systems, 2(2): 173–190, April 1980.
R. G. G. Cattell. Formalization and Automatic Derivation of Code Generators. UMI Research Press, Ann Arbor, Michigan, 1982.
D. R. Chase. An improvement to bottom-up tree pattern matching. In Proceedings of the Fourteenth Annual ACM Symposium on Principles of Programming Languages, pages 168–177, Munich, Germany, January 1987.
T. W. Christopher, P. J. Hatcher, and R. C. Kukuk. Using dynamic programming to generate optimised code in a Graham-Glanville style code generator. Proceedings of the ACM SIGPLAN 1984 Symposium on Compiler Construction, ACM SIGPLAN Notices, 19(6):25–36, June 1984.
N. Dershowitz and J.-P. Jouannaud. Rewrite systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science (Vol. B: Formal Models and Semantics), chapter 6, pages 245–320. Elsevier Science Publishers B.V., 1990.
H. Emmelmann. Code selection by regularly controlled term rewriting. In R. Giegerich and S. L. Graham, editors, Code generation—concepts, tools, techniques, Workshops in Computing Series, pages 3–29. Springer-Verlag, New York-Heidelberg-Berlin, 1991.
H. Emmelmann, F. W. Schröer, and R. Landwehr. BEG—a generator for efficient back ends. ACM SIGPLAN Notices, 24(7):246–257, July 1989.
C. Ferdinand, H. Seidl, and R. Wilhelm. Tree automata for code selection. Acta Informatica, 31(8):741–760, 1994.
C. W. Fraser, D. R. Hanson, and T. A. Proebsting. Engineering a simple, efficient code-generator generator. ACM Letters on Programming Languages and Systems, 1(3): 213–226, September 1992.
C. W. Fraser, R. R. Henry, and T. A. Proebsting. BURG—fast optimal instruction selection and tree parsing. ACM SIGPLAN Notices, 27(4):68–76, July 1992.
R. Giegerich. Code selection by inversion of order-sorted derivors. Theoretical Computer Science, 73:177–211, 1990.
R. Giegerich and K. Schmal. Code selection techniques: pattern matching, tree parsing, and inversion of derivors. In H. Ganzinger, editor, Proc. 2nd European Symp. on Programming, volume 300 of Lecture Notes in Computer Science, pages 247–268. Springer-Verlag, New York-Heidelberg-Berlin, 1988.
P. J. Hatcher and T. W. Christopher. High-quality code generation via bottom-up tree pattern matching. In Proceedings of the Thirteenth Annual ACM Symposium on Principles of Programming Languages, pages 119–130, Tampa Bay, Florida, January 1986.
C. Hemerik and J.-P. Katoen. Bottom-up tree acceptors. Science of Computer Programming, 13:51–72, January 1990.
R. R. Henry. The codegen user's manual. Technical report 87-08-04, Computer Science Department, University of Washington, Seattle, Washington, October 1988.
R. R. Henry. Encoding optimal pattern selection in a table-driven bottom-up tree-pattern matcher. Technical report 89-02-04, Computer Science Department, University of Washington, Seattle, Washington, February 1989.
R. R. Henry and P. C. Damron. Algorithms for table-driven generators using tree-pattern matching. Technical report 89-02-03, Computer Science Department, University of Washington, Seattle, Washington, February 1989.
R. R. Henry and P. C. Damron. Performance of table-driven code generators using treepattern matching. Technical report 89-02-02, Computer Science Department, University of Washington, Seattle, Washington, February 1989.
C. M. Hoffmann and M. J. O'Donnell. Pattern matching in trees. Journal of the ACM, 29(1):68–95, January 1982.
L. Kanal and V. Kumar, editors. Search in Artificial Intelligence. Springer, 1988.
H. Kron. Tree Templates and Subtree Transformational Grammars. PhD thesis, Information Sciences Department, University of California, Santa Cruz, CA, 1975.
N. J. Nilsson. Problem-solving methods in artificial intelligence. McGraw-Hill, New York, 1971.
N. J. Nilsson. Principles of artificial intelligence, Morgan Kaufmann Publishers, Palo Alto, CA, 1980.
A. Nymeyer and J.-P. Katoen. Code generation based on formal BURS theory and heuristic search. Technical report 95-42, Department of Computer Science, University of Twente, Enschede, The Netherlands, November 1995.
E. PelegrÃ-Llopart. Rewrite systems, pattern matching, and code generation. PhD thesis, University of California, Berkeley, December 1987. (Also as Technical Report CSD-88-423).
E. PelegrÃ-Llopart and S. L. Graham. Optimal code generation for expression trees: An application of BURS theory. In Proceedings of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, pages 294–308, San Diego, CA, January 1988.
T. A. Proebsting. BURS automata generation. ACM Transactions on Programming Languages and Systems, 3(17):461–486, 1995.
B. Weisgerber and R. Wilhelm. Two tree pattern matchers for code selection. In D. Hammer, editor, Compiler compilers and high speed compilation, volume 371 of Lecture Notes in Computer Science, pages 215–229. Springer-Verlag, New York-Heidelberg-Berlin, October 1989.
W. A. Wulf, B. W. Leverett, R. G. G. Cattell, S. O. Hobbs, J. M. Newcomer, A. H. Reiner, and B. R. Schatz. An overview of the production-quality compiler compiler project. IEEE Computer, 13(8):38–49, August 1980.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nymeyer, A., Katoen, J.P., Westra, Y., Alblas, H. (1996). Code generation = A* + BURS. In: Gyimóthy, T. (eds) Compiler Construction. CC 1996. Lecture Notes in Computer Science, vol 1060. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61053-7_60
Download citation
DOI: https://doi.org/10.1007/3-540-61053-7_60
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61053-3
Online ISBN: 978-3-540-49939-8
eBook Packages: Springer Book Archive