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

解析表达式语法的计算能力

The computational power of parsing expression grammars

Bruno Loff, Nelma Moreira, Rogério Reis

摘要:

我们研究了解析表达式语法(PEG)的计算能力。我们首先构建PEG与意想不到的行为,和令人惊讶的新的例子与PEG的语言,包括语言的回文的长度是2的幂,和二进制计数的语言。然后,我们提出了一个新的计算模型,脚手架自动机,并证明了它完全表征解析表达式语法(PEG)的计算能力。使用这种特性,我们表明:(*)PEG具有意想不到的权力和语义。我们提出了几个PEG与令人惊讶的行为,和语言,出乎意料的是,有PEG,包括PEG的语言的回文,其长度是2的幂。(*)PEG在计算上是“通用的”,在以下意义上:取任何可计算函数$f:\{0,1\}^\ast\to \{0,1\}^\ast$ ;则存在可计算函数$g: \{0,1\}^\ast \to \mathbb{N}$,使得$\{ f(x) \#^{g(x)} x \mid x \in \{0,1\}^\ast \}$具有PEG。(*)对于PEG可以没有泵浦引理。不存在具有以下性质的全可计算函数$A$:对于每个格式良好的PEG $G$,存在$n_0$,使得对于每个大小为$|x| \ge n_0$的字符串$x \in \mathcal{L}(G)$,输出$y = A(G, x)$在$\mathcal{L}(G)$中并且具有$|y| > |x|$。(*)PEG对于图灵机来说是强非实时的。存在一种具有PEG的语言,使得它或它的反向都不能被任何多带在线图灵机识别,该多带在线图灵机在读取每个输入符号后仅允许执行$o(n/\log n)$步骤。

英文摘要:

We study the computational power of parsing expression grammars (PEGs). We begin by constructing PEGs with unexpected behaviour, and surprising new examples of languages with PEGs, including the language of palindromes whose length is a power of two, and a binary-counting language. We then propose a new computational model, the scaffolding automaton, and prove that it exactly characterises the computational power of parsing expression grammars (PEGs). Using this characterisation we show that: (*) PEGs have unexpected power and semantics. We present several PEGs with surprising behaviour, and languages which, unexpectedly, have PEGs, including a PEG for the language of palindromes whose length is a power of two. (*) PEGs are computationally `universal', in the following sense: take any computable function $f:\{0,1\}^\ast\to \{0,1\}^\ast$; then there exists a computable function $g: \{0,1\}^\ast \to \mathbb{N}$ such that $\{ f(x) \#^{g(x)} x \mid x \in \{0,1\}^\ast \}$ has a PEG. (*) There can be no pumping lemma for PEGs. There is no total computable function $A$ with the following property: for every well-formed PEG $G$, there exists $n_0$ such that for every string $x \in \mathcal{L}(G)$ of size $|x| \ge n_0$, the output $y = A(G, x)$ is in $\mathcal{L}(G)$ and has $|y| > |x|$. (*) PEGs are strongly non real-time for Turing machines. There exists a language with a PEG, such that neither it nor its reverse can be recognised by any multi-tape online Turing machine which is allowed to do only $o(n/\log n)$ steps after reading each input symbol.

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

↑