简体   繁体   中英

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. 2.recursive enumerable languages are not closed under complement. 3.recursive languages are indeed closed under complement.

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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