字符串中的唯一模式匹配
Unique Pattern Matching in Strings
摘要:
正则表达式模式是Perl和XDuce等文档处理语言的关键特性。正是在这种背景下,第一和最长匹配策略已经被提出来消除模式匹配过程的歧义。我们正式定义了一个匹配的语义与这些政策,并表明,普遍接受的方法模拟最长匹配的第一次匹配和递归是不正确的。我们继续解决相关的类型推断问题,其中包括在计算每个子表达式的一组字的子表达式仍然可以匹配时,这些政策是有效的,并显示如何使用该算法可以有效地实现匹配过程。
英文摘要:
Regular expression patterns are a key feature of document processing languages like Perl and XDuce. It is in this context that the first and longest match policies have been proposed to disambiguate the pattern matching process. We formally define a matching semantics with these policies and show that the generally accepted method of simulating longest match by first match and recursion is incorrect. We continue by solving the associated type inference problem, which consists in calculating for every subexpression the set of words the subexpression can still match when these policies are in effect, and show how this algorithm can be used to efficiently implement the matching process.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。