The computational power of parsing expression grammars

作者:

Highlights:

摘要

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). Several consequences will follow from this characterisation: (1) we show that PEGs are computationally “universal”, in a certain sense, which implies the existence of a PEG for a P-complete language; (2) we show that there can be no pumping lemma for PEGs; and (3) we show that PEGs are strictly more powerful than online Turing machines which do o(n/(log⁡n)2) steps of computation per input symbol.

论文关键词:Parsing expression grammar,Context-free grammar,Pumping lemma,Real-time Turing machine,Scaffolding automata

论文评审过程:Received 21 February 2019, Revised 30 October 2019, Accepted 6 January 2020, Available online 13 February 2020, Version of Record 24 March 2020.

论文官网地址:https://doi.org/10.1016/j.jcss.2020.01.001