Queue automaton

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

A queue machine or queue automaton is a finite state machine with the ability to store and retrieve data from an infinite-memory queue. It is a model of computation equivalent to a Turing machine, and therefore it can process any formal language.

Theory

We define a queue machine by the six-tuple

M = (Q, \Sigma, \Gamma, \$, s, \delta) where
  • \,Q is a finite set of states;
  • \,\Sigma \subset \Gamma is the finite set of the input alphabet;
  • \,\Gamma is the finite queue alphabet;
  • \,\$ \in \Gamma - \Sigma is the initial queue symbol;
  • \,s \in Q is the start state;
  • \,\delta : Q \times \Gamma \rightarrow Q \times \Gamma^* is the transition function.

We define the current status of the machine by a configuration, an ordered pair of its state and queue contents \,(q,\gamma)\in Q\times\Gamma^* (note \,\Gamma^* defines the Kleene closure or set of all supersets of \,\Gamma). The starting configuration on an input string \,x is defined as \,(s,x\$), and the transition \rightarrow_M^1 from one configuration to the next is defined as:

\,(p,A\alpha) \rightarrow_M^1 (q,\alpha\gamma)

where A is a symbol from the queue alphabet, \alpha is a sequence of queue symbols (\alpha \in \Gamma^*), and (q, \gamma) = \delta(p, A). Note the "first-in-first-out" property of the queue in the relation.

The machine accepts a string \,x\in\Sigma^* if after a (possibly infinite) number of transitions the starting configuration evolves to exhaust the string (reaching a null string \,\epsilon), or \,(s,x\$)\rightarrow_M^*(q,\epsilon).[1]

Turing completeness

We can prove that a queue machine is equivalent to a Turing machine by showing that a queue machine can simulate a Turing machine and vice versa.

A Turing machine can be simulated by a queue machine that keeps a copy of the Turing machine's contents in its queue at all times, with two special markers: one for the TM's head position, and one for the end of the tape; its transitions simulate those of the TM by running through the whole queue, popping off each of its symbols and re-enqueing either the popped symbol, or, near the head position, the equivalent of the TM transition's effect.

A queue machine can be simulated by a Turing machine, but more easily by a multi-tape Turing machine, which is known to be equivalent to a normal single-tape machine. The simulating queue machine reads input on one tape and stores the queue on the second, with pushes and pops defined by simple transitions to the beginning and end symbols of the tape.[2] A formal proof of this is often an exercise in theoretical computer science courses.

Applications

Queue machines offer a simple model on which to base computer architectures,[3][4] programming languages, or algorithms.[5][6]

See also

References

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.