Chapter 4. Finite State Automata: Characterization, Properties, and Decidability
In
this chapter, the equivalence between right linear grammars and finite
state automata (FSA) is proved. The pumping lemma for regular sets is
considered, and is used to give a method for showing a language not to
be regular. We also consider some basic closure properties and
decidability results.
Regular Grammars
Theorem 4.1
If a language L is accepted
by a finite non-deterministic automaton, then L can be accepted by a
right linear grammar and conversely.
Proof Let L be a language accepted by a finite non-deterministic automaton M = (K, Σ, δ, q0, F) where K = {q0, . . ., qn}. If w ∊ L, then w is obtained by the concatenation of symbols corresponding to different transitions starting from q0 and ending at a finite state. Hence, for each transition by M while reading a symbol of w, there must be a correspondence to a production of a right linear grammar G. The construction is as shown below:
where productions in P are
To prove L(G) = L = L(M).
From the construction of P, one is able to see that Si ⇒ aSj, if and only if δ(qi, a) contains qj and Si ⇒ a, if and only if δ(qi, a) ∊ F. Hence, if S0 ⇒ a1S1 ⇒ a1a2S2 ⇒ . . . ⇒ a1 . . . an if and only if δ(q0, a1) contains q1, δ(q1, a2) contains q2, . . ., δ(qn-1, an) contains qn where qn ∊ F.
Hence, w ∊ L(G) if and only if w ∊ L(M).
Let G = (N, T, P, S) be a right linear grammar. An equivalent non-deterministic finite state automaton (NFSA) with ε-moves is constructed as below:
Let M = (K, T, δ, [S], [ε]), where
K = {[α]|α is S or suffix of some right-hand side of a production in P, the suffix need not be proper}.
The transition function δ is defined as follows:
|
4.2. Pumping Lemma for Regular Sets
A language is said to be regular, if it is accepted
either by a finite automaton or it has a regular grammar generating it.
In order to prove that a language is not regular the most commonly used
technique is “pumping lemma.” The lemma gives a pumping property that a
sufficiently long word has a subword (non-empty) that can be pumped. But
the fact that a language satisfies pumping lemma does not mean that it
is regular.
4.3. Closure Properties
4.4. Decidability Theorems
In this section, we address the basic decidability
issues for regular languages. They are membership problem, emptiness
problem, and equivalence problems.
Theorem 4.7
Given a regular language L over T and w ∊ T*, there exists an algorithm for determining whether or not w is in L.
Proof Let L be accepted by a DFSA M (say). Then, for input w one can see whether w is accepted by M or not. The complexity of this algorithm is O(n) where |w| = n. Hence, membership problem for regular sets can be solved in linear time.
|
Problems and Solutions
1. | Let Σ be an alphabet. Define IΣ to be the collection of all infinite languages over Σ. Note that IΣ does not include any finite language over Σ. Prove or give counter examples to the following:
| |
Solution. |
| |
2. | Construct regular grammar equivalent to the following NFSA (Figure 4.2).
Figure 4.2. State diagram for Problem 2 | |
Solution. | Let G = (N, T, P, S) where N = {S0, S1, S2}, T = {0, 1}. P consists of the following rules:
| |
3. | Construct an equivalent NFSA for the following grammar S → abS|a. | |
Solution. | Figure 4.3. Solution to Problem 3 |
Exercises
1. | Let Σ be an alphabet. Define IΣ to be the collection of all infinite languages over Σ. Note that IΣ does not include any finite language over Σ. Prove or give counter examples to the following:
|
2. | If a collection of languages is closed under intersection, does it mean that it is closed under union. Prove or give counter example. |
3. | If L is accepted by a NFSA, is it necessarily true that all subsets of L are accepted by a NFSA? Prove or give counter examples. |
4. | Let NΣ denote the collection of languages such that no L ∊ NΣ is accepted by a NFSA. Prove or give counter examples to the following:
|
5. | We have shown that the union of two regular languages is regular. Is the union of a collection of regular languages always regular? Justify your answer. |
6. | Let M be a DFSA accepting L1 and G be a regular grammar generating L2. Using only M and G show that L1 ∩ L2 is regular. |
7. | Let P = {x| |x| is prime} and let I(L) be defined by I(L) = L ∩ P. Let DΣ denote the collection of all languages recognized by a DFSA
|
8. | Given any alphabet Σ and a DFSA M, show that it is decidable whether M accepts even length strings. |
9. | Given any alphabet Σ and regular expressions r1 and r2 over Σ, show that it is decidable whether r1 and r2 describe any common strings. |
10. | Given any alphabet Σ and a regular expression r1 over Σ, show that it is decidable whether there is a DFSA with less than 31 states that accepts the language described by r1. |
11. | Give a regular grammar for:
|
12. | Construct a regular grammar equivalent to each of the following NFSA (Figure 4.4).
Figure 4.4. State diagrams for Exercise 12 |
13. | Construct an equivalent NFSA for each of the following grammars:
|
No comments:
Post a Comment