Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
-NFA
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
Definition
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
Definition
DFA
Automaton:
dictionary.com: something capable of acting automatically or
without an external motive force
the automata in this course will be used to check if certain
strings belong to a language.
Finite: finite number of states
Deterministic: transition to only 1 state per symbol
-NFA
Definition
-NFA
Other Representations
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
Other Representations
Transition Diagram
Graph Vertices: states
Directed, labeled edges of the graph: transitions
The (single) starting/initial state is indicated by
The ( 1) accepting/final states are indicated by double circles
-NFA
Other Representations
Transition Table
* S0
S1
S2
0
S0
S2
S1
1
S1
S0
S2
-NFA
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
-NFA
-NFA
Regular Languages
-NFA
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
Example
-NFA
Defintion
L(A) = {Q, , , q0 , F }
: Q 2Q
q0
q1
q2
0
{q0 , q1 }
1
{q0 }
{q2 }
for w = xa
) = {q}
(q,
x) = {p1 , p2 , . . . , pk }
Assume (q,
S
w ) = k (pi , a)
Then, (q,
i=1
-NFA
Language of an NFA
-NFA
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
Subset Construction
-NFA
Proof
Theorem: If D = {QD , , D , {q0 }, FD } is a DFA constructed from
an NFA, N = {QN , , N , q0 , FN }, using the subset construction
above, then L(D) = L(N).
Proof (by induction): Imagine a string w . We want to prove
that
D ({q0 }, w ) = N (q0 , w )
Base case: w = .
LHS: D ({q0 }, ) = {q0 } (by definition of D )
RHS: N (q0 , ) = {q0 } (by definition of N )
Thus LHS RHS.
Induction hypothesis: Assume D ({q0 }, w ) = N (q0 , w ) is true
for |w | = n.
CS301: Theory of Automata:Finita Automata
-NFA
-NFA
Proof (contd)
Induction step: We want to investigate whether, for |w | = n + 1
D ({q0 }, w ) = N (q0 , w )
(1)
= D (D ({q0 }, x), a)
(definition of D )
= D ({p1 , p2 , . . . , pk }, a) (induction hypothesis)
Sk
=
(definition of D )
i=1 N (pi , a)
Proof (contd)
S
RHS of (1): N (q0 , w ) = ki=1 N (pi , a)
(induction hypothesis and definition of N )
Thus, LHS RHS
Also, D and N both accept w iff D ({q0 }, w ) or N (q0 , w ) contain
an element on FN .
-NFA
Proof (contd)
Theorem: A language L is accepted by some DFA iff L is accepted
by some NFA.
Proof: Need to prove the if part and the only if part.
if part proved above, i.e. L = L(N) L = L(D)
only if part: L = L(D) L = L(N):
Given a DFA, D = {Q, , D , q0 , F }, construct an NFA,
N = {Q, , N , q0 , F }, such that
if D (q, a) = p, then N (q, a) = {p}
It can then be shown (by induction on |w |) that if D (q0 , w ) = p,
then N (q0 , a) = {p}
Thus, w is accepted by D iff w is accepted by N, i.e.
L(N) = L(D)
CS301: Theory of Automata:Finita Automata
-NFA
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
and language
Definition, -closures, ,
Layout
1 Deterministic Finite Automata (DFA)
Definition
Other Representations
and Language of a DFA
2 Non-Deterministic Finite Automata (NFA)
and language
Definition, -closures, ,
-NFA
and language
Definition, -closures, ,
Example
NFA with transitions, e.g.
-NFA
and language
Definition, -closures, ,
Formal Defintion
5-tuple: (Q, , , q0 , F )
Q, , q0 , F as before
: Q { {}} 2Q
-NFA
and language
Definition, -closures, ,
-closure
qS
ECLOSE (q)
-NFA
and language
Definition, -closures, ,
and Language
w)
(q,
) = ECLOSE (q)
(q,
[
xa) = ECLOSE (
(q,
s(q,x)
0 , w ) F 6= )}
L(A) = {w | (q
(s, a))
-NFA
and language
Definition, -closures, ,
Eliminating -transitions
Given an -NFA, E = (QE , E , E , q0E , FE ), construct a DFA,
D = (QD , D , D , q0D , FD ), such that L(D) = L(E ).
QD = 2QE ( closed sets only)
D = E
qoD = ECLOSE (q0E )
F = {S | S QD , S FE 6= }
[
D (S, a) = ECLOSE (
E (p, a))
pS
-NFA
and language
Definition, -closures, ,
Equivalence proof
-NFA
and language
Definition, -closures, ,
-NFA
-NFA
and language
Definition, -closures, ,
(w = xa
(def. of
(-elim.)
(ind. hyp
Thank You!
-NFA