Search code examples
programming-languages

Existence of a programming language - guaranteed termination


Does there exist a programming language, where you always are guaranteed a termination?

If you only have if/else statements can you then be sure that that a program will terminate?


Solution

  • Yes, of course there are some non-Turing-complete languages that do guarantee a termination (or at least provide subsets with such a guarantee):

    In most cases, it is achieved by only allowing recursive calls over strict sub-terms (and, with Church arithmetics, it implies always decreasing positive integer counters as well).

    And, surprisingly, this is not as limiting as it looks, and these languages are perfectly suitable for a very wide range of problems.

    The Terminator project could be interesting as well.