Regular Expressions and Grammars




CS154

Chris Pollett

Feb. 21, 2011

Outline

Proof that regular implies the language of some regular expression

Converting DFAs to GNFA

Converting GNFAs to Regular expressions

The proof of equivalence of finite automata and regular expressions is due to McNaughton and Yamada (1960).

Corollary

The regular languages are closed under union, `star`, and concatenation.

Proof. The regular languages are precisely those recognized by DFAs. We have shown in turn that the languages recognized by DFAs are precisely those recognized by NFAs, and these in turn are precisely the languages recognized by regular expression. As the languages of regular expressions are trivially closed under these operations, we get the regular languages are closed under these operations.

Quiz

Which of the following is true?

  1. We used the cartesian product construction last week to show the regular languages are closed under complement.
  2. Given an `n` state NFA there is a DFA recognizing the same language with fewer than `n^2` states.
  3. It is possible for a 2 state NFA to follow 1000000 transition arrows in an accepting computation on the string `aa`.

Grammars

Regular Grammars

Equivalence with Regular Languages

Regular implies Regular Grammar

Theorem. If `L` is a regular language, then it is generated by right linear grammar.

Proof. Let `M = (Q, Sigma, delta, q_0, F)` be a DFA for `L`. Assume `Q={q_0, ldots, q_n}` and `Sigma={a_0, ..., a_m}`. Let `G=(V, Sigma, P, S)` be the grammar with `V={q_0, ..., q_n}` and `S= q_0` and where for each transition `delta(q_i, a_j) = q_k` we have the production `q_i -> a_jq_k` and if `q_k` is in `F` we also have the production `q_k -> epsilon`. It is not hard to see that `w` is accepted by `M` iff it is generated by this right linear grammar.

Regular Grammars and the equivalences between their languages and the regular languages is due to Chomsky and Miller. Information and Control. Vol. 1. 1958. pp 91--112.