arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2307.08531cs.FL
收藏

论带反向引用的正则表达式的表达能力

On the Expressive Power of Regular Expressions with Backreferences

Taisei Nogami, Tachio Terauchi

AI总结:

本文证明带反向引用的正则表达式(rewb)的语言均属于索引语言,严格改进其上界,并进一步刻画其与栈语言及非擦除栈语言的关系。

摘要:

rewb 是一种扩展了反向引用特性的正则表达式。众所周知,反向引用是正则表达式的一种实用扩展,被大多数现代正则表达式引擎所支持,例如 Java、Python 等标准库中的引擎。与此同时,索引语言是由索引文法生成的语言,索引文法是 A. V. Aho 提出的一种形式文法类。我们证明这两种模型的表达能力存在如下关系:每一个由 rewb 描述的语言都是索引语言。由于此前已知包含 rewb 的最小形式文法类是上下文相关语言类,我们的结果严格改进了已知的上界。此外,我们证明了以下两个论断:存在一个 rewb,其语言不属于栈语言类,而栈语言类是索引语言的真子类;并且,一个不含捕获引用的 rewb 所描述的语言属于非擦除栈语言类,而非擦除栈语言类是栈语言的真子类。最后,我们证明此前一项研究中所考察的层级——该层级通过嵌套层数的概念来区分 rewb 的表达能力——包含在非擦除栈语言类之中。

英文摘要:

A rewb is a regular expression extended with a feature called backreference. It is broadly known that backreference is a practical extension of regular expressions, and is supported by most modern regular expression engines, such as those in the standard libraries of Java, Python, and more. Meanwhile, indexed languages are the languages generated by indexed grammars, a formal grammar class proposed by A$.$V$.$Aho. We show that these two models' expressive powers are related in the following way: every language described by a rewb is an indexed language. As the smallest formal grammar class previously known to contain rewbs is the class of context sensitive languages, our result strictly improves the known upper-bound. Moreover, we prove the following two claims: there exists a rewb whose language does not belong to the class of stack languages, which is a proper subclass of indexed languages, and the language described by a rewb without a captured reference is in the class of nonerasing stack languages, which is a proper subclass of stack languages. Finally, we show that the hierarchy investigated in a prior study, which separates the expressive power of rewbs by the notion of nested levels, is within the class of nonerasing stack languages.

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

↑