Abstract
We propose a new technique to construct left-to-right matching automata for trees. Our method is based on the novel concept of prefix unifcation which is used to compute a certain closure of the pattern set. From the closure a kind of deterministic matching automaton can be derived immediately. We also point out how to perform the construction incrementally which makes our approach suitable for applications in which pattern sets change dynamically, such as in the Knuth-Bendix completion algorithm.
Our method, like most others, is restricted to linear patterns (the case of non-linear matching can be handled as usual by checking the consistency of variable bindings in a separate pass following the matching phase).
Preview
Unable to display preview. Download preview PDF.
References
Augustsson, Lennart: Compiling pattern matching. Proc. Functional Programming Languages and Architectures '85. Berlin (etc.): Springer, 1985, pp. 369–381. (Lecture Notes in Computer Science 201).
Birkhoff, G.: Lattice theory. New York: American Mathematical Society, 1948.
Christian, Jim: Fast Knuth-Bendix completion: summary. Proc. Rewriting Techniques and Applications '89. Berlin (etc.): Springer, 1989, pp. 551–555. (Lecture Notes in Computer Science 355).
Gécseg, Ferenc; Magnus Steinby: Tree automata. Budapest: Akadémia Kiadó, 1984.
Gräf, Albert: Efficient pattern matching for term rewriting. Johannes Gutenberg-Universität Mainz, 1990. (Technical Report 3/90).
Hemerik, C.; J.P. Katoen: Bottom-up tree acceptors. Science of Computer Programming, 13, 1989, pp. 51–72.
Hoffmann, C.M.; M.J. O'Donnell: Pattern matching in trees. Journal of the ACM, 29, 1, 1982, pp. 68–95.
Knuth, D.E.; P.B. Bendix: Simple word problems in universal algebras. Proc. of the Conference on Computational Problems in Abstract Algebra 1967. Oxford: Pergamon Press, 1970, pp. 263–298.
Laville, A.: Implementation of lazy pattern matching algorithms. Proc. European Symposium on Programming '88. Berlin (etc.): Springer, 1988, pp. 298–316. (Lecture Notes in Computer Science 300).
Peyton Jones, Simon L.: The implementation of functional programming languages. Englewood Cliffs, N.J. (etc.): Prentice Hall, 1987. (International Series in Computer Science).
Schnoebelen, Ph.: Refined compilation of pattern matching for functional languages. Science of Computer Programming, 11, 1988, pp. 133–159.
Toyama, Yoshihito: Fast Knuth-Bendix completion with a term rewriting system compiler. Information Processing Letters, 32, 1989, pp. 325–328.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Gräf, A. (1991). Left-to-right tree pattern matching. In: Book, R.V. (eds) Rewriting Techniques and Applications. RTA 1991. Lecture Notes in Computer Science, vol 488. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-53904-2_107
Download citation
DOI: https://doi.org/10.1007/3-540-53904-2_107
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53904-9
Online ISBN: 978-3-540-46383-2
eBook Packages: Springer Book Archive