Skip to main content

Derivation of a parallel matching algorithm

  • Conference paper
  • First Online:
  • 153 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 669))

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.

Unable to display preview. Download preview PDF.

References

  1. Bird, R. S., Gibbons, J., Jones, G.: Formal derivation of a pattern matching algorithm. Sci. Comput. Programming 12 (1989) 93–104

    Google Scholar 

  2. Boyer, R. S., Moore, J. S.: A fast string searching algorithm. Commun. ACM 20, 10 (Oct. 1977) 762–772

    Google Scholar 

  3. Dijkstra, E. W. A Discipline of Programming. Prentice Hall, Englewood Cliffs, NJ, 1976

    Google Scholar 

  4. Galil, Z. Optimal parallel algorithms for string matching. Inf. and Comput. 67 (1985) 144–157

    Google Scholar 

  5. Knuth, D. E., Morris, Jr., J. H., Pratt, V. R.: Fast pattern matching in strings. SIAM J. Comput. 6, 2 (June 1977) 323–350

    Google Scholar 

  6. 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

    Google Scholar 

  7. 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

    Google Scholar 

  8. Smith, D. R., Lowry, M. R.: Algorithm theories and design tactics. Sci. Comput. Programming 14 (1990) 305–321

    Google Scholar 

  9. Smith, D. R.: Top-down synthesis of divide-and-conquer algorithms. Artificial Intelligence 27 (1985) 43–96

    Article  MathSciNet  Google Scholar 

  10. 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.

    Google Scholar 

  11. Smith, D. R.: KIDS: A semiautomatic program development system. IEEE Trans. Softw. Eng. 16 (1990) 1024–1043

    Google Scholar 

  12. 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.

    Google Scholar 

  13. Turski, W. M., Maibaum, T. S. E.: The Specification of Computer Programs. Addison-Wesley, 1987

    Google Scholar 

  14. van der Woude, J.: Playing with patterns, searching for strings. Sci. Comput. Programming 12 (1989) 177–190

    Google Scholar 

  15. Vishkin, U.: Optimal parallel pattern matching in strings. Inf. and Comput. 67 (1985) 91–113

    Google Scholar 

  16. Vishkin, U.: Deterministic sampling: A new technique for fast pattern matching. In 22nd Symposium on Theory of Computing Baltimore, MD (1990) 170–180

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

R. S. Bird C. C. Morgan J. C. P. Woodcock

Rights and permissions

Reprints 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

Publish with us

Policies and ethics