100 likes | 312 Views
Regular Languages are closed under the regular operations. Regular Languages. The regular languages are the languages that DFA accept. Since DFA are equivalent with NFA ε , in order to show that L is regular it suffices to construct an NFA ε that recognizes L. Regular Operations.
E N D
Regular Languages • The regular languages are the languages that DFA accept. • Since DFA are equivalent with NFAε, in order to show that L is regular it suffices to construct an NFAεthat recognizes L.
Regular Operations The regular operations are the following: • Union (U) • Concatenation (o) • Star (*)
Regular Languages are closed under the Regular Operations • We already showed that the class of regular languages is closed under U. • This proof becomes much easier is we use NFAεinstead of DFA. • We can also show that the set of regular languages is closed under o and *.
Regular Languages are closed under union. • We should prove that if L1 and L2 are regular then L = L1 UL2 is also regular. • Since L1 and L2 are regular there exist DFAs M1 and M2 that accept them. • It suffices to show that there exists an NFAε that accepts L.
An NFAε thataccepts L1 U L2 Suppose M1 and M2 are shown in the first figure. Add an new start state and ε-moves from this to the initial start states of M1 and M2 ε ε
Regular Languages are closed under concatenation • Suppose that L1 and L2 are two regular languages. Then there exist two DFA M1 and M2 that recognize L1 and L2. • We construct an NFAεthat accepts their concatenation L.
An NFAε thataccepts L1o L2 Suppose M1 and M2 are shown in the first figure. Add ε-moves from the accept states of M1 to the start state of M2 and make them non-accepting ε ε
Regular Languages are closed under star operation • Suppose that L is a regular language. Then there exists DFA M that recognizes L. • We construct an NFAεthat accepts L*.
An NFAε thataccepts L1o L2 Suppose M is shown in the first figure. Add a new accept start state. Add ε-moves from the accept states to the previous start state. ε ε ε