Enumerator (computer science)

From HandWiki - Reading time: 2 min

Short description: Automata that lists elements of some given set


An enumerator is a Turing machine with an attached printer. The Turing machine can use that printer as an output device to print strings. Every time the Turing machine wants to add a string to the list, it sends the string to the printer. Enumerator is a type of Turing machine variant and is equivalent with Turing machine.

Formal definition

An enumerator [math]\displaystyle{ E }[/math] can be defined as a 2-tape Turing machine (Multitape Turing machine where [math]\displaystyle{ k=2 }[/math]) whose language is [math]\displaystyle{ \empty }[/math]. Initially, [math]\displaystyle{ E }[/math] receives no input, and all the tapes are blank (i.e., filled with blank symbols). Newly defined symbol [math]\displaystyle{ \#\in \Gamma\land\#\notin \Sigma }[/math] is the delimiter that marks end of an element of [math]\displaystyle{ S }[/math]. The second tape can be regarded as the printer, strings on it are separated by [math]\displaystyle{ \# }[/math]. The language enumerated by an enumerator [math]\displaystyle{ E }[/math] denoted by [math]\displaystyle{ L(E) }[/math] is defined as set of the strings on the second tape (the printer).

Equivalence of Enumerator and Turing Machines

A language over a finite alphabet is Turing Recognizable if and only if it can be enumerated by an enumerator. This shows Turing recognizable languages are also recursively enumerable.

Proof

A Turing Recognizable language can be Enumerated by an Enumerator

Consider a Turing Machine [math]\displaystyle{ M }[/math] and the language accepted by it be [math]\displaystyle{ L(M) }[/math]. Since the set of all possible strings over the input alphabet [math]\displaystyle{ \Sigma }[/math] i.e. the Kleene Closure [math]\displaystyle{ \Sigma^{*} }[/math] is a countable set, we can enumerate the strings in it as [math]\displaystyle{ s_{1},s_{2},\dots ,s_{i}, }[/math] etc. Then the Enumerator enumerating the language [math]\displaystyle{ L(M) }[/math] will follow the steps:

1 for i = 1,2,3,...
2 Run [math]\displaystyle{ M }[/math] with input strings [math]\displaystyle{ s_{1}, s_{2}, \dots, s_{i} }[/math] for [math]\displaystyle{ i }[/math]-steps
3 If any string is accepted, then print it. 

Now the question comes whether every string in the language [math]\displaystyle{ L(M) }[/math] will be printed by the Enumerator we constructed. For any string [math]\displaystyle{ w }[/math] in the language [math]\displaystyle{ L(M) }[/math] the TM [math]\displaystyle{ M }[/math] will run finite number of steps(let it be [math]\displaystyle{ k }[/math] for [math]\displaystyle{ w }[/math]) to accept it. Then in the [math]\displaystyle{ k }[/math]-th step of the Enumerator [math]\displaystyle{ w }[/math] will be printed. Thus the Enumerator will print every string [math]\displaystyle{ M }[/math] recognizes but a single string may be printed several times.

An Enumerable Language is Turing Recognizable

It's very easy to construct a Turing Machine [math]\displaystyle{ M }[/math] that recognizes the enumerable language [math]\displaystyle{ L }[/math]. We can have two tapes. On one tape we take the input string and on the other tape, we run the enumerator to enumerate the strings in the language one after another. Once a string is printed in the second tape we compare it with the input in the first tape. If its a match, then we accept the input, else reject.

References

Sipser, Michael (2012). Introduction to the Theory of Computation - International Edition. Cengage Learning. ISBN 978-1-133-18781-3. 





Licensed under CC BY-SA 3.0 | Source: https://handwiki.org/wiki/Enumerator_(computer_science)
14 views | Status: cached on August 01 2024 18:29:18
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF