On Practical Regular Expressions

We report on simulation, hierarchy, and decidability results for Practical Regular Expressions (PRE), which may include back references in addition to the standard operations union, concatenation, and star. The following results are obtained: PRE can be simulated by the classical model of nondeterministic finite automata with sensing one-way heads. The number of heads depends on the number of different variables in the expressions. A space bound O(n log m) for matching a text of length m with a PRE with n variables based on the previous simulation. This improves the bound O(nm) from (C\^ampeanu and Santean 2009). PRE cannot be simulated by deterministic finite automata with at most three sensing one-way heads or deterministic finite automata with any number of non-sensing one-way heads. PRE with a bounded number of occurrences of variables in any match can be simulated by nondeterministic finite automata with one-way heads. There is a tight hierarchy of PRE with a growing number of non-nested variables over a fixed alphabet. A previously known hierarchy was based on nested variables and growing alphabets (Larsen 1998). Matching of PRE without star over a single-letter alphabet is NP-complete. This strengthens the corresponding result for expressions over larger alphabets and with star (Aho 1990). Inequivalence of PRE without closure operators is Sigma^P_2-complete. The decidability of universality of PRE over a single letter alphabet is linked to the existence of Fermat Primes. Greibach's Theorem applies to languages characterized by PRE.

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

[2]  Cezar Câmpeanu,et al.  On the intersection of regex languages with regular languages , 2009, Theor. Comput. Sci..

[3]  Ming Li,et al.  Kolmogorov Complexity and its Applications , 1991, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity.

[4]  Andrew Chi-Chih Yao,et al.  K + 1 heads are better than K , 1976, 17th Annual Symposium on Foundations of Computer Science (sfcs 1976).

[5]  Tao Jiang,et al.  A Note on the Space Complexity of Some Decision Problems for Finite Automata , 1991, Inf. Process. Lett..

[6]  Ming Li,et al.  Three One-Way Heads Cannot Do String Matching , 1994, J. Comput. Syst. Sci..

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

[8]  Dominik D. Freydenberger Extended Regular Expressions: Succinctness and Decidability , 2012, Theory of Computing Systems.

[9]  John Michael Robson The Emptiness of Complement Problem for Semi Extended Regular Expressions Requires cn Space , 1979, Inf. Process. Lett..

[10]  Markus Lohrey,et al.  Algorithmics on SLP-compressed strings: A survey , 2012, Groups Complex. Cryptol..

[11]  Sheila A. Greibach,et al.  A note on undecidable properties of formal languages , 1968, Mathematical systems theory.

[12]  N. J. A. Sloane,et al.  The On-Line Encyclopedia of Integer Sequences , 2003, Electron. J. Comb..

[13]  Harry B. Hunt,et al.  The Equivalence Problem for Regular Expressions with Intersection is Not Polynomial in Tape , 1973 .

[14]  Alfred V. Aho,et al.  Algorithms for Finding Patterns in Strings , 1991, Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity.

[15]  Kim S. Larsen Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy , 1998, Inf. Process. Lett..

[16]  S C Kleene,et al.  Representation of Events in Nerve Nets and Finite Automata , 1951 .

[17]  Paliath Narendran,et al.  On Extended Regular Expressions , 2009, LATA.

[18]  Albert R. Meyer,et al.  The Equivalence Problem for Regular Expressions with Squaring Requires Exponential Space , 1972, SWAT.

[19]  Martin Fürer Nicht-elementare untere Schranken in der Automaten-Theorie , 1978 .