Looking for languages that are not Turing complete

吃可爱长大的小学妹 提交于 2019-12-04 20:39:13

问题


I know a little about what is a turing-machine and a turing-complete language, but to understand better, could someone give examples of languages that are not Turing complete? (maybe even machines that are not Turing, as well?)


回答1:


Regular expressions, in the formal definition, consisting only of:

  • concatenation ( ab )
  • unbounded repetition ( a* )
  • alternation ( a|b )
  • grouping ( (ab)|(cd) )

can only recognise regular languages. A Turing-complete programming language can recognise recursively-enumerable languages.

An example is that regular expressions cannot tell you if a string consists of matched pairs of parentheses: eg ()(()) is accepted while ()((())() is rejected, while Turing-complete programming languages can.

(Note that regexes in modern programming languages are more powerful than the formal academic definition of regular expressions. Some may even be Turing complete.)




回答2:


Regular languages - those that can be described as regular expressions - are not Turing complete.

Markup languages (used for describing data, not computation) like XML and JSON are not Turing complete.



来源:https://stackoverflow.com/questions/3600316/looking-for-languages-that-are-not-turing-complete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!