Create and explore imaginative 3D worlds with our new product Dreamfield (opens in a new tab)
Papers
Topics
Authors
Recent
Search
2000 character limit reached

State Complexity of Pattern Matching in Regular Languages

Published 12 Jun 2018 in cs.FL | (1806.04645v2)

Abstract: In a simple pattern matching problem one has a pattern ww and a text tt, which are words over a finite alphabet Σ\Sigma. One may ask whether ww occurs in tt, and if so, where? More generally, we may have a set PP of patterns and a set TT of texts, where PP and TT are regular languages. We are interested whether any word of TT begins with a word of PP, ends with a word of PP, has a word of PP as a factor, or has a word of PP as a subsequence. Thus we are interested in the languages (PΣ∗)∩T(P\Sigma^*)\cap T, (Σ∗P)∩T(\Sigma^*P)\cap T, (Σ∗PΣ∗)∩T(\Sigma^* P\Sigma^*)\cap T, and (Σ∗shu⁡P)∩T(\Sigma^* \mathbin{\operatorname{shu}} P)\cap T, where shu⁡\operatorname{shu} is the shuffle operation. The state complexity κ(L)\kappa(L) of a regular language LL is the number of states in the minimal deterministic finite automaton recognizing LL. We derive the following upper bounds on the state complexities of our pattern-matching languages, where κ(P)≤m\kappa(P)\le m, and κ(T)≤n\kappa(T)\le n: κ((PΣ∗)∩T)≤mn\kappa((P\Sigma^*)\cap T) \le mn; κ((Σ∗P)∩T)≤2m−1n\kappa((\Sigma^*P)\cap T) \le 2^{m-1}n; κ((Σ∗PΣ∗)∩T)≤(2m−2+1)n\kappa((\Sigma^*P\Sigma^*)\cap T) \le (2^{m-2}+1)n; and κ((Σ∗shu⁡P)∩T)≤(2m−2+1)n\kappa((\Sigma^*\mathbin{\operatorname{shu}} P)\cap T) \le (2^{m-2}+1)n. We prove that these bounds are tight, and that to meet them, the alphabet must have at least two letters in the first three cases, and at least m−1m-1 letters in the last case. We also consider the special case where PP is a single word ww, and obtain the following tight upper bounds: κ((wΣ∗)∩Tn)≤m+n−1\kappa((w\Sigma^*)\cap T_n) \le m+n-1; κ((Σ∗w)∩Tn)≤(m−1)n−(m−2)\kappa((\Sigma^*w)\cap T_n) \le (m-1)n-(m-2); κ((Σ∗wΣ∗)∩Tn)≤(m−1)n\kappa((\Sigma^*w\Sigma^*)\cap T_n) \le (m-1)n; and κ((Σ∗shu⁡w)∩Tn)≤(m−1)n\kappa((\Sigma^*\mathbin{\operatorname{shu}} w)\cap T_n) \le (m-1)n. For unary languages, we have a tight upper bound of m+n−2m+n-2 in all eight of the aforementioned cases.

Citations (2)

Summary

No one has generated a summary of this paper yet.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Continue Learning

We haven't generated follow-up questions for this paper yet.