当前位置: X-MOL 学术arXiv.cs.FL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
The computational power of parsing expression grammars
arXiv - CS - Formal Languages and Automata Theory Pub Date : 2019-02-21 , DOI: arxiv-1902.08272
Bruno Loff, Nelma Moreira, Rog\'erio Reis

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.

中文翻译:

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

我们研究解析表达式语法 (PEG) 的计算能力。我们首先构建具有意外行为的 PEG,以及令人惊讶的具有 PE​​G 的语言的新示例,包括长度为 2 的幂的回文语言和二进制计数语言。然后,我们提出了一个新的计算模型,即脚手架自动机,并证明它准确地表征了解析表达式语法 (PEG) 的计算能力。使用此表征,我们表明: (*) PEG 具有意想不到的功能和语义。我们展示了几个具有令人惊讶的行为的 PEG,以及出乎意料地具有 PE​​G 的语言,包括用于回文语言的 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 \在 \{0,1\}^\ast \}$ 中有一个 PEG。(*) PEG 不能有泵引理。不存在具有以下性质的全可计算函数 $A$:对于每个格式良好的 PEG $G$,存在 $n_0$ 使得对于每个大小为 $ 的字符串 $x \in \mathcal{L}(G)$ |x| \ge n_0$,输出 $y = A(G, x)$ 在 $\mathcal{L}(G)$ 中,并且有 $|y| > |x|$。(*) PEG 对于图灵机来说是非常非实时的。存在一种带有 PEG 的语言,因此任何多磁带在线图灵机都​​无法识别它及其反向,该机在读取每个输入符号后只允许执行 $o(n/\log n)$ 步。(*) PEG 不能有泵引理。不存在具有以下性质的全可计算函数 $A$:对于每个格式良好的 PEG $G$,存在 $n_0$ 使得对于每个大小为 $ 的字符串 $x \in \mathcal{L}(G)$ |x| \ge n_0$,输出 $y = A(G, x)$ 在 $\mathcal{L}(G)$ 中,并且有 $|y| > |x|$。(*) PEG 对于图灵机来说是非常非实时的。存在一种带有 PEG 的语言,因此任何多磁带在线图灵机都​​无法识别它及其反向,该机在读取每个输入符号后只允许执行 $o(n/\log n)$ 步。(*) PEG 不能有泵引理。不存在具有以下性质的全可计算函数 $A$:对于每个格式良好的 PEG $G$,存在 $n_0$ 使得对于每个大小为 $ 的字符串 $x \in \mathcal{L}(G)$ |x| \ge n_0$,输出 $y = A(G, x)$ 在 $\mathcal{L}(G)$ 中,并且有 $|y| > |x|$。(*) PEG 对于图灵机来说是非常非实时的。存在一种带有 PEG 的语言,因此任何多磁带在线图灵机都​​无法识别它及其反向,该机在读取每个输入符号后只允许执行 $o(n/\log n)$ 步。x)$ 在 $\mathcal{L}(G)$ 中并且有 $|y| > |x|$。(*) PEG 对于图灵机来说是非常非实时的。存在一种带有 PEG 的语言,因此任何多磁带在线图灵机都​​无法识别它及其反向,该机在读取每个输入符号后只允许执行 $o(n/\log n)$ 步。x)$ 在 $\mathcal{L}(G)$ 中并且有 $|y| > |x|$。(*) PEG 对于图灵机来说是非常非实时的。存在一种带有 PEG 的语言,因此任何多磁带在线图灵机都​​无法识别它及其反向,该机在读取每个输入符号后只允许执行 $o(n/\log n)$ 步。
更新日期:2020-02-17
down
wechat
bug