Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for languages that are not Turing complete

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

like image 716
The Student Avatar asked Aug 30 '10 12:08

The Student


People also ask

Are all languages Turing complete?

Turing completeness is used as a way to express the power of such a data-manipulation rule set. Virtually all programming languages today are Turing-complete. A related concept is that of Turing equivalence – two computers P and Q are called equivalent if P can simulate Q and Q can simulate P.

Is Python Turing complete?

It probably comes as no surprise that powerful programming languages like Python, JavaScript, and C++ are Turing complete. They're currently the standard for building software, and they could theoretically be used as the foundation of any computable task.

Is C++ Turing complete?

It should be noted that technically speaking, C++ the language is Turing complete, while any particular implementation (such as " g++ on machine X") is not.

Is PHP Turing complete?

PHP is a Turing complete computer language.


2 Answers

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

like image 69
Philip Potter Avatar answered Oct 23 '22 13:10

Philip Potter


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.

like image 3
Matt Ball Avatar answered Oct 23 '22 11:10

Matt Ball