简体   繁体   English

图灵完整的语言可以使用CFG吗?

[英]Can a Turing complete language ever have a CFG?

Does turing completeness preclude a language from having a CFG? 完整性检查是否会阻止语言使用CFG? I couldn't find any paper saying that. 我找不到任何这样的论文。

I found this: "TeX can only be parsed by a complete Turing machine (modulo the finite space available), which precludes it from having a BNF." 我发现了这一点: “ TeX只能由完整的Turing机器(以可用的有限空间为模)来解析,这使其无法拥有BNF。”

We are often imprecise with these terms, but a correct answer to your question requires that we be very precise with how we are using terms. 我们常常对这些术语不准确,但是要正确回答您的问题,就需要我们对术语的使用方式非常准确。

Two computation systems are equivalent if they can simulate each other. 如果两个计算系统可以互相模拟,则它们是等效的 A computation system is Turing-equivalent if it is equivalent to Turing machines . 一个计算系统是图灵等价的 ,如果它等同于图灵机

A computation is complete with respect to a computation system if it requires all capabilities of that system to be computed in that system; 如果计算系统需要在该系统中计算该系统的所有功能,则该计算已完成 that is, any change to the computing system which causes it not to be capable of performing at least the same computations as before will cause it not to be able to perform this computation. 就是说,对计算系统的任何改变,使其不能执行至少与以前相同的计算,将导致其不能执行该计算。 A computation is Turing-complete if it is complete with respect to Turing machines . 如果关于图灵机的计算是完整的,则该计算是图灵完成的

BNF grammars describe context-free languages, and the least capable computing system capable of parsing such languages are the pushdown automata . BNF语法描述了上下文无关的语言,而能够解析此类语言的能力最差的计算系统是下推式自动机 This computing system cannot simulate Turing machines in that there are computations a Turing machine can perform which a pushdown automaton cannot; 该计算系统不能模拟图灵机 ,因为存在图灵机可以执行的下推自动机无法执行的计算。 therefore, pushdown automata are not Turing-equivalent . 因此,下推自动机不是图灵等效的

The article says that TeX is a Turing-complete language, that is, deciding the language of valid TeX strings requires all capabilities of Turing machines. 文章说TeX是一种Turing完整的语言,也就是说,确定有效的TeX字符串的语言需要Turing机器的所有功能。 Any system not capable of simulating a Turing machine cannot possibly parse decide membership in the language of valid TeX strings. 任何无法模拟图灵机的系统都无法解析有效TeX字符串语言的决定成员资格。

The article is NOT saying that TeX is Turing-equivalent (maybe it is, maybe it isn't; I have no idea). 这篇文章并不是说TeX与Turing等效(也许是,也许不是;我不知道)。 As pointed out in the comment, Turing-completeness of a computation system's representation is completely unrelated to that computation system's Turing-equivalence. 正如评论中指出的那样,计算系统表示的图灵完备性与该计算系统的图灵等效性完全无关。 Even Turing machines themselves can be represented using strings of a regular language (in fact, extend the interpretation of any language so that otherwise invalid programs compile to the program which halts without doing anything, and suddenly ALL strings are valid, and the language of all strings is certainly regular). 甚至图灵机本身也可以使用常规语言的字符串表示(实际上,可以扩展任何语言的解释,以便将无效的程序编译为无需执行任何操作即可停止的程序,突然所有字符串都有效,并且所有语言均有效)字符串当然是常规的)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM