Pattern Matching in Trees

ABSTgACT. Tree pattern matching is an interesting special problem which occurs as a crucial step m a number of programmmg tasks, for instance, design of interpreters for nonprocedural programming languages, automatic implementations of abstract data types, code optimization m compilers, symbohc computation, context searching in structure editors, and automatic theorem provmg. As with the sorting problem, the variations in requirements and resources for each application seem to preclude a uniform, umversal solution to the tree-pattern-matching problem. Instead, a collection of well-analyzed techmques, from which specific applications may be selected and adapted, should be sought. Five new techniques for tree pattern matching are presented, analyzed for time and space complexity, and compared with previously known methods. Particularly important are applications where the same patterns are matched against many subjects and where a subject may be modified incrementally Therefore, methods which spend some tune preprocessmg patterns in order to improve the actual matching time are included

[1]  Christoph M. Hoffmann,et al.  Programming with Equations , 1982, TOPL.

[2]  Jean-Jacques Lévy,et al.  Minimal and optimal computations of recursive programs , 1977, JACM.

[3]  Dexter Kozen,et al.  Complexity of finitely presented algebras , 1977, STOC '77.

[4]  Hans H. Kron,et al.  Tree templates and subtree transformational grammars. , 1975 .

[5]  Renzo Sprugnoli,et al.  Perfect hashing functions , 1977, Commun. ACM.

[6]  Reinhard Wilhelm,et al.  OPTRAN, a Language for the Specification of Program Transformations , 1980, Fachtagung über Programmiersprachen.

[7]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[8]  Alfred V. Aho,et al.  Efficient string matching , 1975, Commun. ACM.

[9]  Ellis Horowitz,et al.  Abstract data types and software validation , 1978, CACM.

[10]  Beate Commentz-Walter,et al.  A String Matching Algorithm Fast on the Average , 1979, ICALP.

[11]  Donald E. Knuth,et al.  Simple Word Problems in Universal Algebras††The work reported in this paper was supported in part by the U.S. Office of Naval Research. , 1970 .

[12]  Paul Chew,et al.  An improved algorithm for computing with equations , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).

[13]  Donald E. Knuth,et al.  Fast Pattern Matching in Strings , 1977, SIAM J. Comput..

[14]  Lewis Denver Baxter The complexity of unification. , 1976 .

[15]  J. A. Robinson,et al.  A Machine-Oriented Logic Based on the Resolution Principle , 1965, JACM.

[16]  Hanan Samet,et al.  Off-line and on-line algorithms for deducing equalities , 1978, POPL.

[17]  Donald E. Knuth,et al.  The Art of Computer Programming, Vol. 3: Sorting and Searching , 1974 .

[18]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[19]  Larry Carter,et al.  Universal classes of hash functions (Extended Abstract) , 1977, STOC '77.

[20]  Mike Paterson,et al.  Linear unification , 1976, STOC '76.

[21]  Arnold L. Rosenberg,et al.  Rapid identification of repeated patterns in strings, trees and arrays , 1972, STOC.

[22]  Robert S. Boyer,et al.  A fast string searching algorithm , 1977, CACM.

[23]  Joseph A. Goguen,et al.  Some design principles and theory for OBJ-O, a language to express and execute algebraic specification for programs , 1978, Mathematical Studies of Information Processing.

[24]  Robert E. Shostak,et al.  An algorithm for reasoning about equality , 1977, CACM.

[25]  D. Knuth,et al.  Simple Word Problems in Universal Algebras , 1983 .

[26]  Greg Nelson,et al.  Fast Decision Procedures Based on Congruence Closure , 1980, JACM.

[27]  George E. Collins,et al.  The SAC-1 system: An introduction and survey , 1971, SYMSAC '71.

[28]  Christoph M. Hoffmann,et al.  An interpreter generator using tree pattern matching , 1979, POPL.