Constructing a DFA from an NFA

5.1.4 Constructing a DFA from an NFA

  Is it possible to express more languages by means of nondeterministic finite-state automata than by deterministic finite-state automata? For each nondeterministic automaton it is possible to give a deterministic finite-state automaton such that both automata accept the same language, so the answer to the above question is

  Regular Languages

  no. Before we give the formal proof of this claim, we illustrate the construction of a DFA for an NFA in an example.

  Consider the nondeterministic finite-state automaton corresponding with the exam- ple grammar of the previous subsection.

  c GF A ED

  ?>=< 89:; S oo

  a ?>=< 89:; .-, ()+

  A ?>=< 89:; B

  The nondeterminicity of this automaton appears in state A: two outgoing arcs of A are labelled with an a. Suppose we add a new state D, with an arc from A to D labelled a, and we remove the arcs labelled a from A to S and from A to B. Since

  D is a merge of the states S and B we have to merge the outgoing arcs from S and

  B into outgoing arcs of D. We obtain the following automaton.

  ?>=< 89:; .-, ()+ C

  A ?>=< 89:; D ?>=< 89:; B

  OO A BC

  b

  We omit the proof that the language of the latter automaton is equal to the language of the former one. Although there is just one outgoing arc from A labelled with a, this automaton is still nondeterministic: there are two outgoing arcs labelled with

  c from D. We apply the same procedure as above. Add a new state E and an arc labelled c from D to E, and remove the two outgoing arcs labelled c from D. Since

  E is a merge of the states C and S we have to merge the outgoing arcs from C and S into outgoing arcs of E. We obtain the following automaton.

  c GF A ED

  ?>=< 89:; S a

  ?>=< 89:; .-, ()+ C

  A ?>=< 89:; D ?>=< 89:; ()+ .-, E 89:; ?>=< B

  Again, we do not prove that the language of this automaton is equal to the language of the previous automaton, provided we add the state E to the set of accepting

  5.1 Finite-state automata

  states, which until now consisted just of state C. State E is added to the set of accepting states because it is the merge of a set of states among which at least one belongs to the set of accepting states. Note that in this automaton for each state, all outgoing arcs are labelled differently, i.e. this automaton is deterministic. The DFA constructed from the NFA above is the 5-tuple (X, Q, d, S, F ) with

  X = {a, b, c} Q = {S, A, B, C, D, E}

  F = {C, E} where transition function d is defined by

  dEc = S This construction is called the ‘subset construction’. In general, the construction

  works as follows. Suppose M = (X, Q, d, Q 0 , F ) is a nondeterministic finite-state au- tomaton. Then the finite-state automaton M 0 = (X 0 ,Q 0 ,d 0 ,Q 0 ,F 0 ), the components

  of which are defined below, accepts the same language.

  X 0 = X Q 0 = subs Q

  where subs returns all subsets of a set. subs Q is also called the powerset of Q. For example,

  subs :: {X} → {{X}} subs {A, B} = {{ }, {A}, {A, B}, {B}}

  For the other components of M 0 we define

  The proof of the following theorem is given in Section 5.4.

  Regular Languages

  Theorem 7: DFA for NFA

  For every nondeterministic finite-state automaton M there exists a finite-state au-

  tomaton M 0 such that Lnfa(M ) = Ldfa(M 0 )

  Theorem 7 enables us to freely switch between NFA’s and DFA’s. Equipped with this knowledge we continue the exploration of regular languages in the following section. But first we show that the transformation from an NFA to a DFA is an instance of partial evaluation.

Dokumen yang terkait

Analisis Komparasi Internet Financial Local Government Reporting Pada Website Resmi Kabupaten dan Kota di Jawa Timur The Comparison Analysis of Internet Financial Local Government Reporting on Official Website of Regency and City in East Java

19 819 7

ANTARA IDEALISME DAN KENYATAAN: KEBIJAKAN PENDIDIKAN TIONGHOA PERANAKAN DI SURABAYA PADA MASA PENDUDUKAN JEPANG TAHUN 1942-1945 Between Idealism and Reality: Education Policy of Chinese in Surabaya in the Japanese Era at 1942-1945)

1 29 9

Improving the Eighth Year Students' Tense Achievement and Active Participation by Giving Positive Reinforcement at SMPN 1 Silo in the 2013/2014 Academic Year

7 202 3

Improving the VIII-B Students' listening comprehension ability through note taking and partial dictation techniques at SMPN 3 Jember in the 2006/2007 Academic Year -

0 63 87

The Correlation between students vocabulary master and reading comprehension

16 145 49

The correlation intelligence quatient (IQ) and studenst achievement in learning english : a correlational study on tenth grade of man 19 jakarta

0 57 61

An analysis of moral values through the rewards and punishments on the script of The chronicles of Narnia : The Lion, the witch, and the wardrobe

1 59 47

Improping student's reading comprehension of descriptive text through textual teaching and learning (CTL)

8 140 133

The correlation between listening skill and pronunciation accuracy : a case study in the firt year of smk vocation higt school pupita bangsa ciputat school year 2005-2006

9 128 37

Transmission of Greek and Arabic Veteri

0 1 22