Abstract
Regularly controlled term rewriting allows the efficient implementation of a class of non—deterministic term rewriting systems by using regular tree automata to control rule applications. This makes it possible to describe code selectors using very high level specifications: The mapping from intermediate to target code is described by term rewriting rules or by equations. A tree grammar is used to specify the set of target terms and their costs. The paper presents an algorithm to generate efficient tree transducers that map intermediate code terms to cost minimal target terms. First practical experiences using the proposed algorithm are reported.
This work was partly carried out within the Esprit Project #5399 (COMPARE)
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
A.V. Aho, M. Ganapathi, S.W. Tjiang, Code Generation Using Tree Matching and Dynamic Programming, Technical Report, Bell Laboratories, Murray Hill, NJ, January 1986
A Balachandran, D. M. Dhamdhere, S. Biswas, Efficient Retargetable Code Generation Using Bottom-up Tree Pattern Matching, Computer Languages, 15 (3): 127–140, 1990
H. Emmelmann, F-W. Schröer, R. Landwehr, BEG - a Generator for Efficient Back Ends, Proc. of the Sigplan’89 Conference on Programming Language Design and Implementation, Sigplan Notices, Vol. 24, Number 7, July 1989
M.Ganapathi, C. N. Fischer, J.L. Hennessy, Retargetable Compiler Code Generation, Computing Surveys Vol.14 No.4, Dec 82
R.S.Glanville, S.L.Graham, A New Method for Compiler Code Generation, Proceedings 5th ACM Symposium on Principles of Programming Languages, pp. 231–240, 1977
P.J. Hatcher, T.W. Christopher, High-Quality Code Generation Via Bottom Up Tree Pattern Matching, Proceedings 13th ACM Symposium on Principles of Programming Languages pp. 119–130, 1986
R. Henry, P.Damron, Performance of Table–Driven Code Generators Using Tree–Pattern Matching, Technical Report # 89–02–02 Computer Science Department, FR–35 University of Washington, Seattle, WA 98195 USA
R. Henry, P. Damron, Algorithms for Table–Driven Code Generators Using Tree–Pattern Matching, Technical Report # 89–02–03 Computer Science Department, FR–35 University of Washington, Seattle, WA 98195 USA
R. Henry, Encoding Optimal Pattern Selection in a Table–Driven Bottom–Up Tree–Pattern Matcher, Technical Report # 89–02–04 Computer Science Department, FR–35 University of Washington, Seattle, WA 98195 USA
B.Weisgerber, R.Wilhelm, Two Tree Pattern Matchers for Code Selection (Including Targeting), Technical Report, Universität des Saarlandes, Saarbrücken, W. Germany, February 1986
R.G.G. Cattell, Automatic Derivation of Code Generators from Machine Descriptions, ACM Transactions on Programming Languages and Systems, April 1980, Volume 2, Number 2, p. 173–190
E. Pelegri-Llopart, S. Graham, Optimal Code Generation for Expression Trees: An Application of BURS Theory, Proc. of the 15th ACM Symposium on Principles of Programming Languages, 1988, p. 294–308
C.W. Fraser, R.R. Henry, Hard-coding Bottom-up Code Generation Tables to Save Time and Space, Software Practice & Experience, January 1991, Volume 21, No. 1
R.Giegerich, Code Selection by Inversion of Order-Sorted Derivors, Theoretical Computer Science 73 (1990), p. 177–211
R. Giegerich, On the Structure of Verifiable Code Generator Specifications, Proc. of the ACM SIGPLAN’90 Conference on Programming Language Design and Implementation, p.1–8, Sigplan Notices, Vol. 25, Number 6, June 1990
C. Hoffmann, J.O’Donnell, Pattern Matching in Trees, Journal of the ACM Vol. 29, No. 1, January 1982, pp. 68–95
E. Pelegri-Llopart, Rewrite Systems, Pattern Matching and Codé Generation, Dissertation, EECS-Report, UC Berkeley, 1987
J.R. Büchi, Finite Automata, Their Algebras and Grammars, Towards a Theory of Formal Expressions, Springer-Verlag, New York, 1989
J.W.Thatcher, Tree Automata: An Informal Survey, Currents in the Theory of Computing, A.V. Aho (editor), Prentice Hall, Englewood CLiffs, NJ, 1973, 143–172
W.S.Brainerd, Minimalization of Tree Automata, Information and Control 13 (1968) p. 484–491
D.R.Chase, An Improvement to Bottom-up Tree Pattern Matching, POPL87, Munich, Germany, January 1987
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1992 Springer-Verlag London
About this paper
Cite this paper
Emmelmann, H. (1992). Code Selection by Regularly Controlled Term Rewriting. In: Giegerich, R., Graham, S.L. (eds) Code Generation — Concepts, Tools, Techniques. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3501-2_1
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3501-2_1
Publisher Name: Springer, London
Print ISBN: 978-3-540-19757-7
Online ISBN: 978-1-4471-3501-2
eBook Packages: Springer Book Archive