What are practical guidelines for evaluating a language's “Turing Completeness”?

前端 未结 13 2250
礼貌的吻别
礼貌的吻别 2020-12-22 19:22

I\'ve read \"what-is-turing-complete\" and the wikipedia page, but I\'m less interested in a formal proof than in the practical implications of being Turing Complete.

<
13条回答
  •  温柔的废话
    2020-12-22 19:45

    Examples of languages that are not Turing-complete frequently have bounded loops, like:

    for i=1 to N {...}

    but lack unbounded loops which check a more general condition, like:

    while bool_expr {...}

    If all possible looping constructs are bounded, your program is guaranteed to terminate. And, although an unconditional termination guarantee is potentially useful, it is also an indication that the language is not Turing-complete.

    Note also that nailing down all possible looping constructs can be difficult; e.g., I'm pretty sure C++ templates were not intended to be Turing-complete...

提交回复
热议问题