Abstract
We propose a practical technique to compile pattern matching for prioritised overlapping patterns in equational languages into a minimal, deterministic, adaptive, matching automaton. Compared with left-to-right matching automata, adaptive ones have a smaller size and allow shorter matching time. They may improve termination properties as well. Here, space requirements are further reduced by using directed acyclic graphs (dags) automata that shares all the isomorphic subautomata. We design an efficient method to identify such subautomata and hence avoid duplicating their construction while generating the minimised dag automaton.
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
A. Augustsson, A Compiler for Lazy ML, Proceedings ACM Conference on Lisp and Functional Programming, ACM, pp. 218–227, 1984.
J. Christian, Flatterms, Discrimination Nets and Fast Term Rewriting, Journal of Automated Reasoning, vol. 10, pp. 95–113, 1993.
N. Dershowitz and J. P. Jouannaud, Rewrite Systems, Handbook of Theoretical Computer Science, vol. 2, chap. 6, Elsevier Science Publishers, 1990.
A. J. Field and P. G. Harrison, Functional Programming, International Computer Science Series, 1988.
A. Gräf, Left-to-Right Tree Pattern matching, Proceedings Conference on Rewriting Techniques and Applications, Lecture Notes in Computer Science, vol. 488, pp. 323–334, 1991.
C. M. Hoffman and M. J. O’Donnell, Pattern matching in Trees, Journal of ACM, 29(l):68–95, 1982.
P. Hudak and al., Report on the Programming Language Haskell: a Non-Strict, Purely Functional Language, Sigplan Notices, Section S, May 1992.
A. Laville, Comparison of Priority Rules in Pattern Matching and Term Rewriting, Journal of Symbolic Computation, 11:321–347, 1991.
N. Nedjah, Pattern matching Automata for Efficient Evaluation in Equational Programming, Ph.D. Thesis, University of Manchester-Institute of Science and Technology, Manchester, UK, (Abstract and Contents in the Bulletin of the European Association of Computer Science, vol. 60, November 1997.)
N. Nedjah, C. D. Walter and S. E. Eldridge, Optimal Left-to-Right Pattern matching Automata, Proceedings of the Sixth International Conference on Algebraic and Logic Programming, Southampton, UK, Lecture Notes in Computer Science, M. Hanus, J. Heering and K. Meinke Editors, Springer-Verlag, vol. 1298, pp. 273–285, 1997.
N. Nedjah, C. D. Walter and S. E. Eldridge, Efficient Automata-Driven Pattern matching for Equational programs, Software-Practice and Experience, 29(9):793–813, John Wiley, 1999.
N. Nedjah and L. M. Mourelle, Improving Time, Space and Termination in Term Rewriting-Based Programming, Proc. International Conference on Industrial & Engineering Applications of Artificial Intelligence & Expert Systems, Budapest, Hungary, Lecture Notes in Computer Science, Springer-Verlag, vol. 2070, pp. 880–890, June 2001.
M. J. O’Donnell, Equational Logic as Programming Language, MIT Press, 1985.
R. C. Sekar, R. Ramesh and I. V. Ramakrishnan, Adaptive Pattern matching, SIAM Journal, 24(6): 1207–1234, 1995.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nedjah, N., de Macedo Mourelle, L. (2002). Optimal Adaptive Pattern Matching. In: Hendtlass, T., Ali, M. (eds) Developments in Applied Artificial Intelligence. IEA/AIE 2002. Lecture Notes in Computer Science(), vol 2358. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48035-8_74
Download citation
DOI: https://doi.org/10.1007/3-540-48035-8_74
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43781-9
Online ISBN: 978-3-540-48035-8
eBook Packages: Springer Book Archive