arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1311.2557cs.DScs.FL
收藏

Dyck语言编辑距离的有效计算

Efficiently Computing Edit Distance to Dyck Language

Barna Saha

摘要:

给定一个字符串$σ$在字母表$Σ$上,和一个语法$G$定义在相同的字母表上,需要多少最小数量的修复:插入,删除和替换,以将$σ$映射到$G$的有效成员?本文针对$Dyck(s)$研究了这一基本问题。$Dyck(s)$是一种基本的上下文无关文法,它用s种不同类型的括号表示平衡括号语言,在上下文无关语言理论的发展中起着举足轻重的作用。计算编辑距离$Dyck(s)$显着推广字符串编辑距离问题,并有许多应用程序,从修复半结构化的文档,如XML的内存检查,自动编译器优化,自然语言处理等。在本文中,我们给出了第一个近线性时间算法的编辑距离计算$Dyck(s)$,实现了非平凡的近似因子$O(\frac{1}ε\log{OPT}(\log{n})^{\frac{1}ε})$在$O(n^{1+ε}\log{n})$时间。事实上,给定存在一个算法,用于计算在$α(n)$时间内输入大小为$n$的字符串编辑距离,并具有$β(n)$ -近似因子,我们可以设计一个算法,用于在$\tilde{O}(n^{1+ε}+α(n))$中运行的$Dyck(s)$的编辑距离问题,并实现$O(\frac{1}εβ(n)\log{OPT})$的近似因子。我们表明,有效地近似编辑距离$Dyck(s)$的框架,可以适用于许多其他语言。我们说明这一点,考虑各种内存检查语言,其中包括有效的成绩单栈,队列,优先级队列,双端队列等,因此,任何语言,可以识别这些数据结构,也可以有效地修复我们的算法。

英文摘要:

Given a string $σ$ over alphabet $Σ$ and a grammar $G$ defined over the same alphabet, how many minimum number of repairs: insertions, deletions and substitutions are required to map $σ$ into a valid member of $G$ ? We investigate this basic question in this paper for $Dyck(s)$. $Dyck(s)$ is a fundamental context free grammar representing the language of well-balanced parentheses with s different types of parentheses and has played a pivotal role in the development of theory of context free languages. Computing edit distance to $Dyck(s)$ significantly generalizes string edit distance problem and has numerous applications ranging from repairing semi-structured documents such as XML to memory checking, automated compiler optimization, natural language processing etc. In this paper we give the first near-linear time algorithm for edit distance computation to $Dyck(s)$ that achieves a nontrivial approximation factor of $O(\frac{1}ε\log{OPT}(\log{n})^{\frac{1}ε})$ in $O(n^{1+ε}\log{n})$ time. In fact, given there exists an algorithm for computing string edit distance on input of size $n$ in $α(n)$ time with $β(n)$-approximation factor, we can devise an algorithm for edit distance problem to $Dyck(s)$ running in $\tilde{O}(n^{1+ε}+α(n))$ and achieving an approximation factor of $O(\frac{1}εβ(n)\log{OPT})$. We show that the framework for efficiently approximating edit distance to $Dyck(s)$ can be applied to many other languages. We illustrate this by considering various memory checking languages which comprise of valid transcripts of stacks, queues, priority queues, double-ended queues etc. Therefore, any language that can be recognized by these data structures, can also be repaired efficiently by our algorithm.

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

↑