Closure under the Regular Operations
Closure under the Regular Operations – p.1/26
Closure under the Regular Operations Closure under the Regular - - PowerPoint PPT Presentation
Closure under the Regular Operations Closure under the Regular Operations p.1/26 Application of NFA Now we use the NFA to show that the collection of regular languages is closed under regular operations union, concatenation, and star
Closure under the Regular Operations – p.1/26
Closure under the Regular Operations – p.2/26
Closure under the Regular Operations – p.2/26
Closure under the Regular Operations – p.2/26
Closure under the Regular Operations – p.3/26
Closure under the Regular Operations – p.3/26
and
✂✄be recognized by NFA
☎ ✁and
☎ ✄, respectively
Closure under the Regular Operations – p.3/26
and
✂✄be recognized by NFA
☎ ✁and
☎ ✄, respectively
is regular we will construct an NFA
☎that recognizes
Closure under the Regular Operations – p.3/26
and
✂✄be recognized by NFA
☎ ✁and
☎ ✄, respectively
is regular we will construct an NFA
☎that recognizes
must accept its input if either
☎ ✁accepts its input. Hence,
☎must have a new state that will allow it to guess nondeterministically which of
☎ ✁accepts it
Closure under the Regular Operations – p.3/26
and
✂✄be recognized by NFA
☎ ✁and
☎ ✄, respectively
is regular we will construct an NFA
☎that recognizes
must accept its input if either
☎ ✁accepts its input. Hence,
☎must have a new state that will allow it to guess nondeterministically which of
☎ ✁accepts it
the start states of
☎ ✁and
☎ ✄, as seen in Figure 1
Closure under the Regular Operations – p.3/26
to recognize
Closure under the Regular Operations – p.4/26
Closure under the Regular Operations – p.5/26
1.
: That is, the states of
☎are all states on
☎ ✁and
☎ ✄with the addition of a new state
✄ ✆Closure under the Regular Operations – p.6/26
1.
: That is, the states of
☎are all states on
☎ ✁and
☎ ✄with the addition of a new state
✄ ✆is
✄ ✆Closure under the Regular Operations – p.6/26
1.
: That is, the states of
☎are all states on
☎ ✁and
☎ ✄with the addition of a new state
✄ ✆is
✄ ✆are
: That is, the accept states
are all the accept states of
☎ ✁and
☎ ✄Closure under the Regular Operations – p.6/26
1.
: That is, the states of
☎are all states on
☎ ✁and
☎ ✄with the addition of a new state
✄ ✆is
✄ ✆are
: That is, the accept states
are all the accept states of
☎ ✁and
☎ ✄:
if
✄ ✁if
✄ ✁if
✄ ✁ ✄ ✆and
✂ ✁if
✄ ✁ ✄ ✆and
✂ ✑ ✁Closure under the Regular Operations – p.6/26
Closure under the Regular Operations – p.7/26
Closure under the Regular Operations – p.8/26
to recognize
Closure under the Regular Operations – p.9/26
Closure under the Regular Operations – p.10/26
Closure under the Regular Operations – p.10/26
Closure under the Regular Operations – p.10/26
Closure under the Regular Operations – p.11/26
1.
. The states of
☎are all states of
☎ ✁and
☎ ✄Closure under the Regular Operations – p.12/26
1.
. The states of
☎are all states of
☎ ✁and
☎ ✄Closure under the Regular Operations – p.12/26
1.
. The states of
☎are all states of
☎ ✁and
☎ ✄Closure under the Regular Operations – p.12/26
1.
. The states of
☎are all states of
☎ ✁and
☎ ✄:
if
✄ ✁and
✄ ✑ ✁if
✄ ✁and
✂ ✑ ✁if
✄ ✁and
✂ ✁if
✄ ✁.
Closure under the Regular Operations – p.12/26
Closure under the Regular Operations – p.13/26
Closure under the Regular Operations – p.14/26
to recognize
Closure under the Regular Operations – p.15/26
Closure under the Regular Operations – p.16/26
Closure under the Regular Operations – p.16/26
Closure under the Regular Operations – p.16/26
Closure under the Regular Operations – p.17/26
1.
; i.e. states of
☎ ✁plus a new state
✄ ✆Closure under the Regular Operations – p.18/26
1.
; i.e. states of
☎ ✁plus a new state
✄ ✆is
✄ ✆Closure under the Regular Operations – p.18/26
1.
; i.e. states of
☎ ✁plus a new state
✄ ✆is
✄ ✆3.
; that is, the accept states of
☎are the accept states of
☎ ✁plus the new start state
Closure under the Regular Operations – p.18/26
1.
; i.e. states of
☎ ✁plus a new state
✄ ✆is
✄ ✆3.
; that is, the accept states of
☎are the accept states of
☎ ✁plus the new start state
:
if
✄ ✁and
✄ ✑ ✁if
✄ ✁and
✂ ✑ ✁if
✄ ✁and
✂ ✁if
✄ ✁ ✄ ✆and
✂ ✁if
✄ ✁ ✄ ✆and
✂ ✑ ✁Closure under the Regular Operations – p.18/26
Closure under the Regular Operations – p.19/26
Closure under the Regular Operations – p.20/26
Closure under the Regular Operations – p.20/26
Let
be the DFA
will show that
recognizes the complement of
✓Closure under the Regular Operations – p.21/26
Let
be the DFA
will show that
recognizes the complement of
✓accept
✙, i.e., if we run
we end in an accept state of
Closure under the Regular Operations – p.21/26
Let
be the DFA
will show that
recognizes the complement of
✓accept
✙, i.e., if we run
we end in an accept state of
have swapped accept/non-accept states, if we run
we would end in a non-accept state. Hence,
✙ ✑ ✁ ✓Closure under the Regular Operations – p.21/26
Let
be the DFA
will show that
recognizes the complement of
✓accept
✙, i.e., if we run
we end in an accept state of
have swapped accept/non-accept states, if we run
we would end in a non-accept state. Hence,
✙ ✑ ✁ ✓is not accepted by
, it would be accepted by
Let
be the DFA
will show that
recognizes the complement of
✓accept
✙, i.e., if we run
we end in an accept state of
have swapped accept/non-accept states, if we run
we would end in a non-accept state. Hence,
✙ ✑ ✁ ✓is not accepted by
, it would be accepted by
accepts those strings that are not accepted by
recognizes the complement of
✓.
Closure under the Regular Operations – p.21/26
Closure under the Regular Operations – p.22/26
Closure under the Regular Operations – p.22/26
Closure under the Regular Operations – p.22/26
Closure under the Regular Operations – p.23/26
1
✁a 2
✁a,b
✂b
✆1
✁a 2
✁a,b
✂b
Closure under the Regular Operations – p.24/26
Closure under the Regular Operations – p.25/26
Closure under the Regular Operations – p.26/26
Closure under the Regular Operations – p.26/26
Closure under the Regular Operations – p.26/26