Abstract
Tree pattern matching is a fundamental operation that is used in a number of programming tasks such as mechanical theorem proving, term rewriting, symbolic computation, and nonprocedural programming languages. In this paper, we present new sequential algorithms for nonlinear pattern matching in trees. Our algorithm improves upon know tree pattern matching algorithms in important aspects such as time performance, ease of integration with several reduction strategies and ability to avoid unnecessary computation steps on match attempts that fail. The expected time complexity of our algorithm is linear in the sum of the sizes of the two trees.
- 1 AHO, A. V., HOPCROFT, J. E., AND ULLMAN, J. D. The Desigtz atzd Analysis of Computer Algorithms. Addison-Wesley, Reading, Mass, 1974. Google Scholar
- 2 AHO, A. V., AND CORASICK, M.J. Efficient string matching: An aid to bibliographic search. Commun. ACM 18, 6 (June 1975), 333-340. Google Scholar
- 3 BUCHBERGER, B., AND Loos, R. Algebraic specification, computer algebra and symbolic and algebraic computation. B. Buchberger, G. E. Collins, and R. Loos, eds. Computing Supplements Vol. 4. Springer-Verlag, New York, 1982, pp. 11-43.Google Scholar
- 4 CHASE, D.R. An Improvement to bottom-up tree pattern matching. In Proceedings of the ldth Annual ACM Symposium on Principles of Progranzmzng Languages (Munich, West Germany, Jan. 21-23). ACM, New York, 1987, pp. 168-177. Google Scholar
- 5 O'DoNNELL, M.J. Equational logic as a programming language. In Foundations of Computatzon Series. MIT Press, Cambridge, Mass., 1085. Google Scholar
- 6 DOWNEY, P. J., SETHI, R., AND TARJAN, R. E. Variations on the common subexpression problem. J. ACM 24, 4 (Oct. 1980), 758-771. Google Scholar
- 7 FUTATSUGI, K., GOGUEN, J., JOUNNAUD, J. A., ~kND MESEGUER, J. Principles of OBJ2. In Proceedings" of the 12th Annual Sympostum on Print(pies of Prograrnmb~g Languages (New Orleans, La. Jan. 14-16). ACM, New York, 1985, pp. 52-66. Google Scholar
- 8 GUTTAG, J., HOROWITZ, E., AND MUSSER. D. Abstract data types and software validation. Information Science Report ISI/RR-76-48. Univ. Southern California, Los Angeles, Calif, 1976.Google Scholar
- 9 HOFFMAN, C. M., AND O'DONNELL, M.J. Pattern matching in trees. JACM 29, 1 (Jan. 1982), 68-95. Google Scholar
- 10 KNUT~, D. E., AND BENDIX, P. Simple word problems in universal algebras. J. Leech, ed., In Computattonal Problems in Abstract Algebra. Pergammon Press, Oxford, England, 1970, pp. 263-297.Google Scholar
- 11 KaoN, H. Tree templates and subtree transformational grammars. Ph.D. Dissertation, Univ. California, Santa Cruz, Calif., 1975. Google Scholar
- 12 LANG, H., SCHIMMLER, M., AND SCHMECK, H. Matching tree patterns sublinear on the average. Tech. Rep. Dept. of Informatik, Univ. KieI, Kiel, Germany, 1980.Google Scholar
- 13 M~LNER, R. A proposal for standard ML. In Proceedmgs of the ACM Syrnposmm on LISP and Functional Programming. ACM, New York, 1984, pp. 184-197. Google Scholar
- 14 STEYAERT, J., AND FLAJOLET, P. Patterns and pattern-matching in trees: An analysis. Inf. Coptt. 58, 1983, 19-58. Google Scholar
- 15 VAN LEELIWEN, J., AND OVERMARS, M.H. Rapid subtree identification revisited. Tech. Rep. CS-79-3. Univ. Utrecht, Utrecht, The Netherlands, 1979.Google Scholar
Index Terms
- Nonlinear pattern matching in trees
Recommendations
Formal Proofs About Rewriting Using ACL2
We present an application of the ACL2 theorem prover to reason about rewrite systems theory. We describe the formalization and representation aspects of our work using the first-order, quantifier-free logic of ACL2 and we sketch some of the main points ...
Tree template matching in unranked ordered trees
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 ...
Theorem Proving Modulo
AbstractDeduction modulo is a way to remove computational arguments from proofs by reasoning modulo a congruence on propositions. Such a technique, issued from automated theorem proving, is of general interest because it permits one to separate ...
Comments