Abstract
We present a derivation of a parallel version of the Knuth-Morris-Pratt algorithm for finding occurrences of a pattern string in a target string. We show that the failure function, the source of efficiency of the sequential algorithm, is a form of search in an ordered domain. This view enables the generalization of the algorithm both beyond sequential execution and the string data structure. Our derivation systematically uses a divide-and-conquer strategy. The computation tree so generated can be mapped onto time, yielding a naive sequential algorithm, onto a processor tree, yielding a parallel algorithm, or onto a data structure, yielding the failure function.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
Bird, R. S., Gibbons, J., Jones, G.: Formal derivation of a pattern matching algorithm. Sci. Comput. Programming 12 (1989) 93–104
Boyer, R. S., Moore, J. S.: A fast string searching algorithm. Commun. ACM 20, 10 (Oct. 1977) 762–772
Dijkstra, E. W. A Discipline of Programming. Prentice Hall, Englewood Cliffs, NJ, 1976
Galil, Z. Optimal parallel algorithms for string matching. Inf. and Comput. 67 (1985) 144–157
Knuth, D. E., Morris, Jr., J. H., Pratt, V. R.: Fast pattern matching in strings. SIAM J. Comput. 6, 2 (June 1977) 323–350
Morris, J. M.: Programming by expression refinement: The KMP algorithm. In Beauty is Our Business: A Birthday Salute to Edsger W. Dijkstra. Springer-Verlag, New York (1990) 327–338
Partsch, H. A., Völker, N.: Another case study on reusability of transformational developments: Pattern matching according to Knuth, Morris, and Pratt. Tech. rep., KU Nijmegen, 1990
Smith, D. R., Lowry, M. R.: Algorithm theories and design tactics. Sci. Comput. Programming 14 (1990) 305–321
Smith, D. R.: Top-down synthesis of divide-and-conquer algorithms. Artificial Intelligence 27 (1985) 43–96
Smith, D. R.: The structure and design of global search algorithms. Tech. Rep. KES.U.87.12, Kestrel Institute, Palo Alto, California, July 1988. To appear in Acta Informatica.
Smith, D. R.: KIDS: A semiautomatic program development system. IEEE Trans. Softw. Eng. 16 (1990) 1024–1043
Srinivas, Y. V.: A sheaf-theoretic approach to pattern matching and related problems. Tech. Rep. KES.U.91.10, Kestrel Institute, Palo Alto, California, Oct. 1991. To appear in Theoretical Computer Science.
Turski, W. M., Maibaum, T. S. E.: The Specification of Computer Programs. Addison-Wesley, 1987
van der Woude, J.: Playing with patterns, searching for strings. Sci. Comput. Programming 12 (1989) 177–190
Vishkin, U.: Optimal parallel pattern matching in strings. Inf. and Comput. 67 (1985) 91–113
Vishkin, U.: Deterministic sampling: A new technique for fast pattern matching. In 22nd Symposium on Theory of Computing Baltimore, MD (1990) 170–180
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Srinivas, Y.V. (1993). Derivation of a parallel matching algorithm. In: Bird, R.S., Morgan, C.C., Woodcock, J.C.P. (eds) Mathematics of Program Construction. MPC 1992. Lecture Notes in Computer Science, vol 669. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-56625-2_21
Download citation
DOI: https://doi.org/10.1007/3-540-56625-2_21
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-56625-0
Online ISBN: 978-3-540-47613-9
eBook Packages: Springer Book Archive