Beruflich Dokumente
Kultur Dokumente
Hokkaido, Japan
1
Outline
(part a --- in this PPT) 2.0 Introduction 2.1 An Informal Picture of Finite Automata 2.2 Deterministic Finite automata 2.3 Nondeterministic Finite Automata (part b --- in another PPT) 2.4 An Application: Text Search 2.5 Finite Automata with Epsilon-Transitions Epsilon2
2.0 Introduction
Two types of finite automata (FA):
Deterministic FA (DFA) Nondeterministic FA (NFA)
2.1 An Informal Picture of Finite Automata A complete application example of finite automata for protocol design and verification
Read by yourself! Involving a concept of product of two automata
4
Start
$0
0 1 1 0 1 0 0
tape reader finite control
4.2
8
10
Start
q0
q2
q1
0, 1
12
H(p, a1) = q1, H(q1, a2) = q2, , Hqi1, ai) = qi, ..., H(qn1, an) = q,
then we define H to be H (p , x ) = q .
14
H (q, x)
a H
16
17
Start
q0
q2
q1 $20
0, 1
Start
q0
q2
q1 $20
0, 1
18
Start
q0
q2
q1 $20
0, 1
Some transitions may die, like Hq2, 0). die, 0). Some transitions have multiple choices, like H(q0, 0) = q0 and q2.
19
Start
q0
q1
q2 $20
Nondeterminism creates many transition paths, but state, if there is one path leading to a final state, then the input is accepted.
20
Start
q0
q1
q2 $20
q0 q1
q0
q0 q1
q0
q2 Stuck!
q2 Accept!
21
22
y y
automaton A, in state q, takes input a and enters one of the states p1, p2, , pm.
23
Start
q0
q1
q2 $20
1 {q0} {q2} J
24
{ p1 p2 . . . p k}
a a a H
H (q, w=xa)
= {r1 r2 . . . rm }
26
q0
q1
q2 $20
27
29
Each subset S of QN is in final state set FD if S includes at least one accepting state in FN (i.e., S FN { J). For each subset S of QN and for each input symbol a, define HD(S, a) = U HN(p, a) a) a)
pS
32
Start
q0
q1
q2 $20
The power set of QN = {q0, q1, q2} is QD = _J, {q0}, {q1}, {q2}, {q0, q1}, {q0, q2}, _J, {q {q {q {q {q {q1, q2}, {q0, q1, q2}}. {q }}.
33
Start
q0
q1
q2 $20
0 1 J {q0} {q2} J {q0, q2} {q0} {q2} {q0, q2}
34
J p{q0} {q1} *{q2} {q0, q1} *{q0, q2} *{q1, q2} *{q0, q1, q2}
Figure 2.13
Start
q0
q1
q2 $20
J p{q0} 0 {q1} 1 *{q2} 2 {q0, q1} 0 1 *{q0, q2} 0 2 *{q1, q2} 1 2 *{q0, q1, q2} 0 1 2
37
Start
{q0}
{q0, q1}
1 0
{q0, q2}
Figure 2.14
1
38
39
40
start
th
the
then
42
Such a kind of NFA has at most one transition out of any state on any symbol, and may be regarded symbol, as a DFA.
43