arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1406.3405cs.DS
收藏

一种用于上下文无关文法的纠错分析器,其花费少于立方时间

An error correcting parser for context free grammars that takes less than cubic time

Sanguthevar Rajasekaran, Marius Nicolae

摘要:

解析的问题已经被广泛地研究了各种形式文法。给定一个输入字符串和一个语法,解析问题是检查输入字符串是否属于由语法生成的语言。一个非常重要的密切相关的问题是,输入是一个字符串${\cal I}$和一个语法$G$,任务是产生一个属于由$G$生成的语言的字符串${\cal I}'$,并且${\cal I}$和${\cal I}'$之间的“距离”是最小的(在该语言的所有字符串中)。具体而言,如果${\cal I}$使用的是$G$生成的语言,则输出应为${\cal I}$。任何解决这个问题的解析器都被称为{ \em纠错解析器}。1972年Aho和Peterson提出了一个用于上下文无关文法的立方时间纠错分析器。从那时起,这个渐近的时间界限没有得到改善(标准)的假设下,语法大小是一个常数。在本文中,我们提出了一个错误纠正分析器上下文无关文法,运行在$O(T(n))$时间,其中$n$是输入字符串的长度和$T(n)$是所需的时间来计算两个$n\times n$矩阵的热带产品。在本文中,我们还提出了一个$\frac{n}{M}$ -近似算法的{ \em语言编辑距离问题},有一个运行时间的$O(Mn^ω)$,其中$O(n^ω)$是所需的时间乘以两个$n\times n$矩阵。据我们所知,没有近似算法已经提出了一般上下文无关文法的纠错分析。

英文摘要:

The problem of parsing has been studied extensively for various formal grammars. Given an input string and a grammar, the parsing problem is to check if the input string belongs to the language generated by the grammar. A closely related problem of great importance is one where the input are a string ${\cal I}$ and a grammar $G$ and the task is to produce a string ${\cal I}'$ that belongs to the language generated by $G$ and the `distance' between ${\cal I}$ and ${\cal I}'$ is the smallest (from among all the strings in the language). Specifically, if ${\cal I}$ is in the language generated by $G$, then the output should be ${\cal I}$. Any parser that solves this version of the problem is called an {\em error correcting parser}. In 1972 Aho and Peterson presented a cubic time error correcting parser for context free grammars. Since then this asymptotic time bound has not been improved under the (standard) assumption that the grammar size is a constant. In this paper we present an error correcting parser for context free grammars that runs in $O(T(n))$ time, where $n$ is the length of the input string and $T(n)$ is the time needed to compute the tropical product of two $n\times n$ matrices. In this paper we also present an $\frac{n}{M}$-approximation algorithm for the {\em language edit distance problem} that has a run time of $O(Mn^ω)$, where $O(n^ω)$ is the time taken to multiply two $n\times n$ matrices. To the best of our knowledge, no approximation algorithms have been proposed for error correcting parsing for general context free grammars.

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

↑