• Aucun résultat trouvé

The equivalence problem is decidable for finite-state automata

Dans le document An Introduction to the Theory of Computation (Page 106-114)

Bibliographic Notes

Theorem 2.6.4 The equivalence problem is decidable for finite-state automata

Proof Two finite-state automata M1 and M2 are equivalent if and only if the relation (L(M1)

) ( L(M2)) = Ø holds, where denotes the complementation of L(Mi) for i = 1, 2. The result then follows from the proof of Theorem 2.5.2 and from Theorem 2.6.1.

The result in Theorem 2.6.4 can be shown to hold also for deterministic finite-state transducers (see Corollary 3.6.1). However, for the general class of finite-state transducers the equivalence problem can be shown to be undecidable (see Corollary 4.7.1).

[next] [prev] [prev-tail] [front] [up]

[next] [prev] [prev-tail] [tail] [up]

Exercises

2.2.1

Let P be a program with k instruction segments and a domain of variables of cardinality m.

Determine an upper bound on the number of states of P, and an upper bound on the number of possible transitions between these states.

2.2.2

Determine the diagram representation of a finite-state transducer that models the computations of the program in Figure 2.E.1.

Assume that the domain of the variables is {0, 1}, and that 0 is the initial value in the domain. Denote each node in the transition diagram with the corresponding state of the program.

2.2.3

For each of the following relations give a finite-state transducer that computes the relation.

a. { (x#y, aibj) | x and y are in {a, b}*, i = (number of a's in x), and j = (number of b's in y) }

g. { (x, y) | x and y are in {a, b}*, and either x is a substring of y or y is a substring of x }

Let M = <Q, , , , q0, F> be the deterministic finite-state transducer whose transition diagram is given in Figure 2.E.2.

Figure 2.E.2

For each of the following relations find a finite-state transducer that computes the relation.

a. { (x, y) | x is in L(M), and y is in * }.

b. { (x, y) | x is in L(M), y is in *, and (x, y) is not in R(M) }.

2.2.5

Show that if a deterministic finite-state transducer M accepts inputs x1 and x2 such that x1 is a prefix of x2, then on these inputs M outputs y1 and y2, respectively, such that y1 is a prefix of y2. 2.2.6

Determine the sequence of configurations in the computation that the finite-state transducer <{q0, q1, q2}, {0, 1}, {a, b}, {(q0, 0, q1, a), (q1, 1, q0, a), (q1, 1, q2, ), (q2, , q1, b)}, q0, {q2}> has on input 0101.

2.2.7

Modify Example 2.2.16 for the case that M is the finite-state transducer whose transition diagram is given in Figure 2.2.2.

2.3.1

For each of the following languages construct a finite-state automaton that accepts the language.

a. { x | x is in {0, 1}*, and no two 0's are adjacent in x }

b. { x | x is in {a, b, c}*, and none of the adjacent symbols in x are equal }

c. { x | x is in {0, 1}*, and each substring of length 3 in x contains at least two 1's } d. { 1z | z = 3x + 5y for some natural numbers x and y }

e. { x | x is in {a, b}*, and x contains an even number of a's and an even number of b's } f. { x | x is in {0, 1}*, and the number of 1's between every two 0's in x is even }

g. { x | x is in {0, 1}*, and the number of 1's between every two substrings of the form 00 in x is even }

h. { x | x is in {0, 1}*, but not in {10, 01}* }

i. { x | x is in {a, b, c}*, and a substring of x is accepted by the finite-state automaton of Figure 2.4.1 }

2.3.2

Find a deterministic finite-state automaton that is equivalent to the finite-state automaton whose transition diagram is given in Figure 2.E.3.

Figure 2.E.3

2.3.3

Find a Type 3 grammar that generates the language accepted by the finite-state automaton whose transition diagram is given in Figure 2.E.4.

Figure 2.E.4

2.3.4

Find a finite-state automaton that accepts the language L(G), for the case that G = <N, , P, S> is the Type 3 grammar whose production rules are listed below.

2.3.5

Show that a language is generated by a Type 3 grammar if and only if it is generated by a right-linear grammar, and if and only if it is generated by a left-right-linear grammar.

2.3.6

Prove that a set is regular if and only if it is accepted by a finite-state automaton.

2.4.1

Let M be the finite-state automaton whose transition diagram is given in Figure 2.E.5.

Figure 2.E.5

Using the notation of the proof of the pumping lemma for regular languages (Theorem 2.4.1), what are the possible values of m, x, and y for each w in L(M)?

2.4.2

Use the pumping lemma for regular languages to show that none of the following languages is regular.

a. { anbt | n > t }

b. { v | v is in {a, b}*, and v has fewer a's than b's } c. { x | x is in {a, b}*, and x = xrev }

d. { vvrev | v is accepted by the finite-state automaton of Figure 2.E.6 }

Figure 2.E.6 e. { an2| n 1 }

f. { anbt | n t }

g. { x | x is in {a, b}*, and x xrev }

2.4.3

Show that each relation R computable by a finite-state transducer has a fixed integer m such that the following holds for all (v, w) in R. If |w| > m max(1, |v|), then w = xyz for some x, y, z such that (v, xykz) is in R for all k 0. Moreover, 0 < |y| m.

2.4.4

Prove that the relation { (aibj, ck) | i and j are natural numbers and k = i j } is not computable by a finite-state transducer.

2.5.1

Let M1 be the finite-state automaton given in Figure 2.E.3, and M2 be the finite-state automaton given in Figure 2.E.6. Give a finite-state automaton that accepts the relation R(M1) R(M2).

2.5.2

For each of the following cases show that regular sets are closed under the operation . a. (L) = { x | x is in L, and a proper prefix of L is in L }.

Show that the set of relations that finite-state transducers compute is closed under each of the following operations .

Show that the set of the relations computed by deterministic finite-state transducers is not closed under composition.

2.5.6

Let M be the finite-state automaton whose transition diagram is given in Figure 2.E.3. Give a finite-state automaton that accepts the complementation of L(M).

2.5.7

Show that the complementation of a relation computable by a deterministic finite-state transducer, is computable by a finite-state transducer.

2.6.1

Show that the problem defined by the following pair is decidable.

Domain:

{ M | M is a finite-state automaton } Question:

Is L(M) a set of infinite cardinality for the given instance M?

[next] [prev] [prev-tail] [front] [up]

[prev] [prev-tail] [tail] [up]

Bibliographic Notes

Finite-memory programs and their relationship to finite-state transducers have been studied in Jones and Muchnick (1977). Their applicability in designing lexical analyzers can be seen in Aho , Sethi , and Ullman (1986). Their applicability in designing communication protocols is discussed in Danthine

(1980). Their usefulness for solving systems of linear Diophantine equations follows from Büchi (1960).

Finite-state transducers were introduced by Sheperdson (1959). Deterministic finite-state automata originated in McCulloch and Pitts (1943). Rabin and Scott (1959) introduced nondeterminism to finite-state automata, and showed the equivalency of nondeterministic finite-finite-state automata to deterministic finite-state automata. The representation of finite-state transducers by transition diagrams is due to Myhill (1957).

Chomsky and Miller (1958) showed the equivalency of the class of languages accepted by finite-state automata and the class of Type 3 languages. Kleene (1956) showed that the languages that finite-state automata accept are characterized by regular expressions. LEX is due to Lesk (1975).

The pumping lemma for regular languages is due to Bar-Hillel , Perles , and Shamir (1961). Beauquier (see Ehrenfeucht , Parikh , and Rozenberg , 1981) showed the existence of a nonregular language that certifies the conditions of the pumping lemma.

The decidability of the emptiness and equivalence problems for finite-state automata, as well as Exercise 2.6.1, have been shown by Moore (1956).

Hopcroft and Ullman (1979) is a good source for additional coverage of these topics.

[prev] [prev-tail] [front] [up]

[next] [prev] [prev-tail] [tail] [up]

Chapter 3 RECURSIVE FINITE-DOMAIN

Dans le document An Introduction to the Theory of Computation (Page 106-114)