RE Languages and Enumerator
RE Languages and Enumerator
and
Enumerators
(strong result)
• A language is recursively enumerable (RE)
if and only if
there is an enumerator for it
Proof:
Let Turing machineM be the decider forL
a
b
aa
Example:
ab
alphabet is {a, b} ba (proper order)
bb
aaa
aab
......
Fall 2006 Costas Busch - RPI 4
Enumerator for L
Repeat:
~
1. M generates a string w
2. M checks if w L
YES: print w to output
NO: ignore w
This part terminates,
because L is recursive
Fall 2006 Costas Busch - RPI 5
Enumerator for L
~ M
M Give me
Enumerates all next string
If M accepts wi output
strings of
then print wi to
input alphabet string wi All strings
output
of L
bb accept bb
aaa accept aaa
aab reject
Proof:
Enumerates all
Accepts L
strings of input alphabet
in proper order
Fall 2006 Costas Busch - RPI 9
NAIVE APPROACH
Enumerator for L
Repeat:
~ generates a string w
M
M checks if w L
YES: print w to output
NO: ignore w
Problem: If w L
machine M may loop forever
Fall 2006 Costas Busch - RPI 10
BETTER APPROACH
~ Generates first string w
M 1
And so on............
1 1 1 1
Step in
2 2 2 2
computation
of string
3 3 3 3
4 4 4 4
End of Proof
Fall 2006 Costas Busch - RPI 14
Theorem:
If for language L
there is an enumerator
then L is RE
Proof:
End of Proof
Fall 2006 Costas Busch - RPI 17
By combining the last two theorems,
we have proven:
A language is RE
if and only if
there is an enumerator for it