An improvement to bottom-up tree pattern matching
POPL '87 Proceedings of the 14th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
BURG: fast optimal instruction selection and tree parsing
ACM SIGPLAN Notices
Efficient tree pattern matching (extended abstract): an aid to code generation
POPL '85 Proceedings of the 12th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Journal of the ACM (JACM)
A new algorithm for linear regular tree pattern matching
Theoretical Computer Science
A new method for compiler code generation
POPL '78 Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Tree templates and subtree transformational grammars.
Tree templates and subtree transformational grammars.
Algorithms for pattern matching and discovery in RNA secondary structure
Theoretical Computer Science - Pattern discovery in the post genome
On regular tree languages and deterministic pushdown automata
Acta Informatica
Tree template matching in ranked ordered trees by pushdown automata
CIAA'11 Proceedings of the 16th international conference on Implementation and application of automata
Tree template matching in ranked ordered trees by pushdown automata
Journal of Discrete Algorithms
Hi-index | 0.00 |
We consider the problem of tree template matching, a type of tree pattern matching, where the tree templates have some of their leaves denoted as ''don@?t care'', and propose a solution based on the bottom-up technique. Specifically, we transform the tree pattern matching problem for unranked ordered trees to a string matching problem, by transforming the tree template and the subject tree to strings representing their postfix bar notation, and then propose a table-driven algorithm to solve it. The proposed algorithm is divided into two phases: the preprocessing and the searching phase. The tree template is preprocessed once, and the searching phase can be applied to many subject trees, without the need of preprocessing the tree template again. Although we prove that the space required for preprocessing is exponential in the size of the tree template in the worst case, we show that for a specific class of tree templates, the space required is linear in the size of the tree template. The time for the searching phase is linear in the size of the subject tree in the worst case. Thus, the algorithm is asymptotically optimal when one needs to search for a given tree template, of constant to logarithmic size, in many subject trees.