- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在网上搜索,发现有些矛盾的答案。一些消息来源断言,一种语言/机器/你拥有的东西是图灵完备的当且仅当它具有 两者 条件和无条件分支(我猜这有点多余),有人说只需要无条件分支,其他人说只需要条件分支。
关于德语的阅读Z3和 ENIAC ,维基百科说:
The German Z3 (shown working in May 1941) was designed by Konrad Zuse. It was the first general-purpose digital computer, but it was electromechanical, rather than electronic, as it used relays for all functions. It computed logically using binary math. It was programmable by punched tape, but lacked the conditional branch. While not designed for Turing-completeness, it accidentally was, as it was found out in 1998 (but to exploit this Turing-completeness, complex, clever hacks were necessary).
The computing machine Z3, built by Konrad Zuse between 1938 and 1941, could execute only fixed sequences of floating point arithmetical operations (addition, subtraction, multiplication, division, and square root) coded in a punched tape. An interesting question to ask, from the viewpoint of the history of computing, is whether or not these operations are sufficient for universal computation. The paper shows that, in fact, a single program loop containing these arithmetical instructions can simulate any Turing machine whose tape is of a given finite size. This is done by simulating conditional branching and indirect addressing by purely arithmetical means. Zuse's Z3 is therefore, at least in principle, as universal as today's computers that have a bounded addressing space.
goto
的语言吗?或
jmp
分支结构(没有
if
或
jnz
结构)被认为是图灵完备的吗?
最佳答案
可以找到原始的 Rojas 论文 here .基本思想是 Z3 只支持无条件单循环(通过将指令带的末端粘在一起)。您可以通过将所有代码段一个接一个地放入循环中来构建它的条件执行,并使用一个变量 z 来确定要执行哪个段。在第 j 节的开头,您设置
if (z==j) then t=0 else t=1
a = b op c
在本节中阅读
a = a*t + (b op c)*(1-t)
t = 1 - sqr((c1-z1)(c2-z2)...(cm-zm))
关于branch - 条件分支是图灵完备性的要求吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4029769/
我是一名优秀的程序员,十分优秀!