寻找非图灵完备的语言

发布于 2024-09-16 16:34:54 字数 337 浏览 1 评论 0原文

I know a little about what is a and a 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?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等往事风中吹 2024-09-23 16:34:54

正则表达式,在正式定义中,仅由以下组成:

  • 连接( ab )
  • 无限制重复( a* )
  • 交替( a|b )
  • 分组( (ab)|(cd) )

只能识别正则语言。图灵完备的编程语言可以识别递归可枚举语言。

一个例子是,正则表达式无法告诉您字符串是否由匹配的括号对组成:例如 ()(()) 被接受,而 ()((())() 被拒绝,而图灵完备的编程语言可以

(请注意,现代编程语言中的正则表达式比正则表达式的正式学术定义更强大。有些甚至可能是图灵完备的。)

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

删除→记忆 2024-09-23 16:34:54

常规语言 - 那些可以描述为正则表达式的语言 - 是 非图灵完备

XML 和 JSON 等标记语言(用于描述数据,而不是计算)不是图灵完备的。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文