Kleenes Theorem 1
Kleenes Theorem 1
CONSTRUCTION
Lecture 8
Kleene’s Theorem
Kleene’s Theorem
(where the labels r, and r2 are each regular expressions or simple strings.)
• We can replace this with a single edge that is labelled with a regular expression.
Algorithm….. Cont’d
• Bypass operation: if we have three states
in a row connected by edges labelled with
regular expressions (or simple strings), we
can eliminate the middleman
Algorithm….. Cont’d
• If state 2 does have a loop, we must use
this model:
Algorithm….. Cont’d
• If state 1 is connected to state 2 and state 2 is connected to more than one other
state (say to states 3, 4, and 5), then when we eliminate the edge from state 1 to
state 2 we have to add edges that show how to go from state 1 to states 3, 4, and 5.
Algorithm….. Cont’d
• Every state that leads into state 2 can be
made to bypass state 2.
• If state 9 leads into state 2, we can eliminate
the edge from state 9 to state 2 by adding
edges from state 9 to states 3, 4, and 5
directly.
• Repeat this process until nothing leads into
state 2. When this happens, we can eliminate
state 2 entirely, since it then cannot be in a
path that accepts a word.
Algorithm….. Cont’d
• We have eliminated one of T’s states
without changing the set of words that it
accepts
• Repeat this process again and again until
we have eliminated all the states from T
except for the unique start state and the
unique final state.
Algorithm….. Cont’d
• What we come down to is a picture that looks like this:
• becomes
• Note: Whenever we remove an edge or a
state we must be sure that we have not
destroyed any paths through T that may
previously have existed. Destroying paths
could change the language of words
accepted, which we do not want to do.
e.g
Example
Source of Lecture
• Book: Introduction to Computer Theory by
Daniel. I. A Cohen, chapter 7, “Kleene’s
Theorem”.