1 Non-Deterministic Automata Regular Expressions.
-
date post
21-Dec-2015 -
Category
Documents
-
view
254 -
download
2
Transcript of 1 Non-Deterministic Automata Regular Expressions.
4
Formal Definition of NFAs FqQM ,,,, 0
:Q
:
:0q
:F
Set of states, i.e. 210 ,, qqq
: Input aplhabet, i.e. ba,Transition function
Initial state
Final states
11
FormallyThe languageaccepted by NFA is:
where
and there is some
)(MLM
,...,, 321 wwwML
,...,),(* 0 ji qqwq
Fqk (final state)
15
Since
machines and are equivalent
*1021 MLML
1M 2M
0q 1q 2q
0
11,0
0q 1q 2q
0
11
0
1,0
DFA
NFA 1M
2M
16
Equivalence of NFAs and DFAs
Every DFA is also an NFA
A language accepted by a DFA will be accepted by an NFA
An NFA is as least as powerful as a DFA
Is an DFA as powerful as an NFA?
17
Is a DFA as Powerful as an NFA?
Answer: YES!
A language accepted by an NFA will be accepted by some DFA
For every NFA there is an equivalent DFAthat accepts the same language
18
NFAs Accept the Regular Languages
For every NFA there is an equivalent DFA
The language accepted by a DFA is regular
The language accepted by an NFA is regular
27
NFA to DFA Observations
We are given an NFA
We want to convert it to an equivalent DFA
With
M
M
)(MLML
28
If the NFA has states
The DFA has states in the powerset
,...,, 210 qqq
,....,,,,,,, 7432110 qqqqqqq
31
Procedure NFA to DFA 2. For every DFA’s state
Compute in the NFA
Giving union
Add a transition
mji qqq ,...,,
...,,*
,,*
aq
aq
j
i
mji qqq ,...,,
mjimji qqqaqqq ,...,,,,...,,
35
Procedure NFA to DFA 3. For any DFA state
If some is a final state for the NFA
Then, is a final state for the DFA
mji qqq ,...,,
jq
mji qqq ,...,,