Simple real-time constant-space string matching

String matching is the classical problem of finding all occurrences of a pattern in a text. A real-time string matching algorithm takes worst-case constant-time to check if a pattern occurrence ends at each text location. We derive a real-time variation of the elegant Crochemore-Perrin constant-space string matching algorithm that has a simple and efficient control structure. We use observations about the locations of critical factorizations to deploy two tightly-coupled simplified real-time instances of the Crochemore-Perrin algorithm that search for complementary parts of the pattern whose simultaneous occurrence indicates an occurrence of the complete pattern.

[1]  Wojciech Rytter On Maximal Suffices and Constant-Space Linear-Time Versions of KMP Algorithm , 2002, LATIN.

[2]  Tao Jiang,et al.  K One-Way Heads Cannot Do String-Matching , 1996, J. Comput. Syst. Sci..

[3]  Jean Pierre Duval,et al.  Factorizing Words over an Ordered Alphabet , 1983, J. Algorithms.

[4]  Wojciech Rytter,et al.  On maximal suffixes, constant-space linear-time versions of KMP algorithm , 2003, Theor. Comput. Sci..

[5]  Wojciech Plandowski,et al.  Constant-Space String Matching with Smaller Number of Comparisons: Sequential Sampling , 1995, CPM.

[6]  Ely Porat,et al.  Exact and Approximate Pattern Matching in the Streaming Model , 2009, 2009 50th Annual IEEE Symposium on Foundations of Computer Science.

[7]  Richard M. Karp,et al.  Efficient Randomized Pattern-Matching Algorithms , 1987, IBM J. Res. Dev..

[8]  Zvi Galil,et al.  String Matching in Real Time , 1981, JACM.

[9]  Viktor K. Prasanna,et al.  Time and area efficient pattern matching on FPGAs , 2004, FPGA '04.

[10]  Maxime Crochemore,et al.  Two-way string-matching , 1991, JACM.

[11]  Wojciech Rytter,et al.  Periodic Prefixes in Texts , 1993 .

[12]  Wojciech Rytter,et al.  Text Algorithms , 1994 .

[13]  Maxime Crochemore String-Matching on Ordered Alphabets , 1992, Theor. Comput. Sci..

[14]  Tero Harju,et al.  Combinatorics on Words , 2004 .

[15]  Wojciech Rytter,et al.  Jewels of stringology , 2002 .

[16]  J. Allouche Algebraic Combinatorics on Words , 2005 .

[17]  Tao Jiang,et al.  k one-way heads cannot do string-matching , 1993, J. Comput. Syst. Sci..

[18]  Zvi Galil,et al.  Linear-Time String-Matching Using only a Fixed Number of Local Storage Locations , 1981, Theor. Comput. Sci..

[19]  Zvi Galil,et al.  Real-time recognition of substring repetition and reversal , 1977, Mathematical systems theory.

[20]  Maurice Pouzet,et al.  Une caracterisation des mots periodiques , 1979, Discret. Math..

[21]  Tao Jiang,et al.  Rotations of Periodic Strings and Short Superstrings , 1996, J. Algorithms.

[22]  Zvi Galil,et al.  Saving space in fast string-matching , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[23]  Zvi Galil,et al.  Real-Time Streaming String-Matching , 2014, TALG.

[24]  Wojciech Rytter,et al.  Squares, cubes, and time-space efficient string searching , 1995, Algorithmica.

[25]  Zvi Galil,et al.  Time-Space-Optimal String Matching , 1983, J. Comput. Syst. Sci..

[26]  Wojciech Plandowski,et al.  The Zooming Method: A Recursive Approach to Time-Space Efficient String-Matching , 1995, Theor. Comput. Sci..

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

[28]  Leszek Gasieniec,et al.  Real-Time String Matching in Sublinear Space , 2004, CPM.

[29]  Dany Breslauer,et al.  Saving Comparisons in the Crochemore-Perrin String-Matching Algorithm , 1996, Theor. Comput. Sci..

[30]  Arnaud Lefebvre,et al.  Linear-Time Computation of Local Periods , 2003, MFCS.

[31]  Funda Ergün,et al.  Periodicity in Streams , 2010, APPROX-RANDOM.