arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2601.03020cs.CCcs.DScs.FL
收藏

带有扩展的正则表达式匹配的难度

Hardness of Regular Expression Matching with Extensions

Waseda University(早稻田大学);Chiba University(千叶大学)

Taisei Nogami, Yoshiki Nakamura, Tachio Terauchi

AI总结:

本文研究了带有回溯、平方、交集和补集等扩展的正则表达式匹配问题,证明了在不同假设下这些扩展无法在特定时间内解决,揭示了ERE匹配算法的最优性。

摘要:

正则表达式匹配问题询问给定的正则表达式长度为m是否匹配给定的字符串长度为n。众所周知,Thompson算法可以在O(nm)时间内解决该问题。此外,最近的研究表明,带有实用扩展lookaround的正则表达式匹配可以在相同的时间复杂度内解决。在本文中,我们考虑了四个众所周知的正则表达式扩展:回溯、平方、交集和补集。我们证明了在正交向量猜想(OVC)、k-OVC、k- clique假设和组合k- clique假设下,带有这些扩展的正则表达式匹配问题的时间复杂度下限。一些亮点结果包括,对于回溯,即使限制在单个捕获组内,也无法在n^{2-ε} poly(m)时间内解决(对于回溯,即使限制在单个捕获组内)在OVC下,且补集问题,也称为扩展正则表达式(ERE)匹配问题,无法在OVC下以n^{2-ε} tower(o(√m))的时间复杂度解决,在k- clique假设下无法在n^{ω-ε} tower(o(√m))的时间复杂度解决,在组合k- clique假设下无法在n^{3-ε} tower(o(√m))的时间复杂度解决。特别是,后两个结果表明,Hopcroft和Ullman于1979年提出的O(n^3 m)时间的ERE匹配算法,以及Bille、Gørtz和Jessen最近改进到O(n^ω m)时间的算法,已经是最优的,在一定程度上揭示了理论计算机科学界为何在超过45年的时间里难以改进ERE匹配相对于n和m的时间复杂度。

英文摘要:

Regular expression matching asks whether a given regular expression of length $m$ matches a given string of length $n$, and its time complexity is fairly well understood. Meanwhile, regular expressions have been extended to support various extensions for both theoretical and practical reasons, which can substantially change the time complexity of the matching problem. In this work, we consider four well-known extensions to regular expressions called intersection, squaring, complement and backreference, and we prove a number of novel conditional time complexity lower bounds for the regular expression matching problems with these extensions under the Orthogonal Vectors Conjecture, the $k$-Orthogonal Vectors Conjecture or the $k$-Clique hypotheses. Our lower bounds significantly narrow the gaps to the known upper bounds, with some even being (conditionally) optimal in that the dependence on $n$ cannot be polynomially reduced while keeping the dependence on $m$ polynomial (or even elementary, for complement). Additionally, to obtain our results for intersection, squaring and complement in a unified manner, we introduce novel problems called Dyck Selection, Orthogonal Dyck Selection and Generalized Dyck Selection. They are arguably natural formal language and stringology problems that are based on Greibach's hardest context-free language and capture the essence of why the regular expression matching problems with these extensions are hard.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑