简体   繁体   English

非常规语言的补充是否总是递归语言?

[英]Is the complement of a non regular language always a recursive language?

Is the complement of a non regular language always a recursive language? 非常规语言的补充是否总是递归语言?

I understand that 1.context-free languages are not closed under complement. 据我所知,1.context-free语言不会在补充下关闭。 2.recursive enumerable languages are not closed under complement. 2.在补充下不会关闭递归可枚举语言。 3.recursive languages are indeed closed under complement. 3.传统语言在补语下确实是封闭的。

But how can I answer the initial question using these facts? 但是,如何利用这些事实回答最初的问题? How can I tell if a non regular language is recursive or not? 如何判断非常规语言是否递归?

No, the complement of a non-regular language is not always recursive. 不,非常规语言的补充并不总是递归的。 A counterexample is the halting problem, whose complement (all programs that do not stop) is non-regular. 一个反例是停止问题,其补充(所有不停止的程序)是不规则的。 Thus, the halting problem itself, which is not recursive (but recursively enumerable) is the complement of a non-regular language. 因此,非递归(而是递归可枚举)的暂停问题本身就是非常规语言的补充。 (I think the mentioned facts wont help you with that problem.) (我认为上述事实不会帮助您解决该问题。)

In general, if you want to show that a problem is not recursive, you have to reduce a non-recursive language (for example the halting problem) to it. 通常,如果要显示问题不是递归的,则必须将非递归语言(例如,停顿问题)减少到该问题。 If you want to show that is is recursive, you have to show that there is a Turing machine that decides it (accepts it and stops on every input). 如果要证明它是递归的,就必须证明有一个图灵机来决定它(接受它并在每个输入上停止)。

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

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