patternModerate
Are Finite Automata Turing Complete?
Viewed 0 times
finiteareautomatacompleteturing
Problem
Something is Turing Complete if it can be used to simulate any Turing Machine.
So, can a Finite Automaton simulate a Turing Machine?
On the question Can regular languages be Turing complete? they say a Regular Language can be Turing Complete, but it does not make sense to me. I am not talking about the Language being parsed, but the Finite Automaton itself.
Finite Automatons and Regular Languages are not Equivalents. Finite Automatons are machines which accept or reject some Language. But Regular Grammars and Finite Automata are equivalents because I can convert one to another. Then, the question is, are Regular Grammars Turing Complete? Are Type 0 grammars Turing Complete? i.e., can I use a Regular Grammar or a Type 0 Grammar to do any computation I would like?
Can I write a Finite Automaton to do anything a Full-Featured General Purpose Computer can do?
So, can a Finite Automaton simulate a Turing Machine?
On the question Can regular languages be Turing complete? they say a Regular Language can be Turing Complete, but it does not make sense to me. I am not talking about the Language being parsed, but the Finite Automaton itself.
Finite Automatons and Regular Languages are not Equivalents. Finite Automatons are machines which accept or reject some Language. But Regular Grammars and Finite Automata are equivalents because I can convert one to another. Then, the question is, are Regular Grammars Turing Complete? Are Type 0 grammars Turing Complete? i.e., can I use a Regular Grammar or a Type 0 Grammar to do any computation I would like?
Can I write a Finite Automaton to do anything a Full-Featured General Purpose Computer can do?
Solution
No finite automaton can simulate a Universal Turing machine, so finite automatons are not Turing complete. This falls out immediately from them having a finite number of states. Universal Turing machines require an unbounded amount of space to work.
The source code of an Jot program can be recognized with a finite automaton. That automaton doesn't evaluate the program (and thus doesn't play the role of a Turing machine), it just determines whether or not it is well-formed enough to be run.
This is in contrast with most programming languages. For example, because JavaScript has nested
This isn't that interesting of an observation. For example, the following is a Turing-complete a subset of syntactically-valid JavaScript programs that is recognizable with a regular expression:
...just most of these will immediately throw a runtime error because
What is maybe more interesting about Iota is that its grammar also naturally parallels the actual structure of programs, instead of being a weird encoding trick like the above.
The source code of an Jot program can be recognized with a finite automaton. That automaton doesn't evaluate the program (and thus doesn't play the role of a Turing machine), it just determines whether or not it is well-formed enough to be run.
This is in contrast with most programming languages. For example, because JavaScript has nested
() and {}, it's necessarily not regular (but is, at least approximately, context free). Indentation sensitive languages like Python aren't even context-free (without preprocessing of identation).This isn't that interesting of an observation. For example, the following is a Turing-complete a subset of syntactically-valid JavaScript programs that is recognizable with a regular expression:
/^eval\("[^\n\"]+"\)$/...just most of these will immediately throw a runtime error because
eval will not parse its single argument -- essentially we can define a programming language to treat all inputs as "syntactically valid" by just defining a new runtime behavior for all the syntactically invalid ones.What is maybe more interesting about Iota is that its grammar also naturally parallels the actual structure of programs, instead of being a weird encoding trick like the above.
Code Snippets
/^eval\("[^\n\"]+"\)$/Context
StackExchange Computer Science Q#110998, answer score: 19
Revisions (0)
No revisions yet.