Abstract
We consider the problem of tree template matching in ranked ordered trees, and propose a solution based on the bottom-up technique. Specifically, we transform the tree pattern matching problem to a string matching problem, by transforming the tree template and the subject tree to strings representing their postfix notation, and then use pushdown automata as the computational model. The method is analogous to the construction of string pattern matchers. The given tree template is preprocessed once, by constructing a nondeterministic pushdown automaton, which is then transformed to the equivalent deterministic one. Although we prove that the space required for preprocessing is exponential to the size of the tree template in the general case, the space required for a specific class of tree templates is linear. The time required for the searching phase is linear to the size of the subject tree in both cases.
This research has been partially supported by the Ministry of Education, Youth and Sports of Czech Republic under research program MSM 6840770014, and by the Czech Science Foundation as project No. 201/09/0807.
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
Aho, A.V., Ganapathi, M.: Efficient tree pattern matching (extended abstract): an aid to code generation. In: POPL, pp. 334–340. ACM, New York (1985)
Chase, D.R.: An improvement to bottom-up tree pattern matching. In: POPL 1987, pp. 168–177. ACM, New York (1987)
Cleophas, L.G.W.A.: Tree Algorithms: Two Taxonomies and a Toolkit. Ph.D. thesis, Eindhoven University of Technology (April 2008)
Crochemore, M., Rytter, W.: Jewels of Stringology. World Scientific, Singapore (1994)
Flouri, T., Janoušek, J., Melichar, B.: Subtree matching by pushdown automata. Computer Science and Information Systems 7, 331–358 (2010)
Fraser, C.W., Henry, R.R., Proebsting, T.A.: Burg: fast optimal instruction selection and tree parsing. SIGPLAN Notices 27(4), 68–76 (1992)
Glanville, R.S., Graham, S.L.: A new method for compiler code generation. In: POPL, pp. 231–240 (1978)
Hoffmann, C.M., O’Donnell, M.J.: Pattern matching in trees. J. ACM 29, 68–95 (1982)
Janoušek, J., Melichar, B.: On regular tree languages and deterministic pushdown automata. Acta Informatica 46, 533–547 (2009)
Kuboyama, T.: Matching and Learning in Trees. Phd thesis (2007)
Mauri, G., Pavesi, G.: Algorithms for pattern matching and discovery in rna secondary structure. Theor. Comput. Sci. 335(1), 29–51 (2005)
Melichar, B.: Arbology: Trees and pushdown automata. In: Dediu, A.-H., Fernau, H., Martín-Vide, C. (eds.) LATA 2010. LNCS, vol. 6031, pp. 32–49. Springer, Heidelberg (2010)
Nowotka, D., Srba, J.: Height-deterministic pushdown automata. In: Kučera, L., Kučera, A. (eds.) MFCS 2007. LNCS, vol. 4708, pp. 125–134. Springer, Heidelberg (2007)
Shankar, P., Gantait, A., Yuvaraj, A.R., Madhavan, M.: A new algorithm for linear regular tree pattern matching. Theor. Comput. Sci. 242(1-2), 125–142 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Flouri, T., Janoušek, J., Melichar, B., Iliopoulos, C.S., Pissis, S.P. (2011). Tree Template Matching in Ranked Ordered Trees by Pushdown Automata. In: Bouchou-Markhoff, B., Caron, P., Champarnaud, JM., Maurel, D. (eds) Implementation and Application of Automata. CIAA 2011. Lecture Notes in Computer Science, vol 6807. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22256-6_25
Download citation
DOI: https://doi.org/10.1007/978-3-642-22256-6_25
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-22255-9
Online ISBN: 978-3-642-22256-6
eBook Packages: Computer ScienceComputer Science (R0)