Finite Automata
State diagram
State table
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DFA & NFA
DFA
DFA: Deteministic Finite Automata
A finite automata
- : a finite set of states.
- : input alphabet.
- : the transition function, is a function from to .
- : inital state.
- : a set of final state.
and is different:
- : an edge from q to q'
- : a path from q to q'
accepts
if
for some
.
说人话,就是输入纸带后,若能从初始状态到达指定的结束状态,就 接受 该纸带输入。
, thus accepts (unique).
NFA
NFA: Non-deteminstic Finite Automata
- traits
- several choices for the next state(同样的输入有多种路径)
- e-transition (不读入的情况下改变状态)
- strict definition: A NFA is 5-tuple ,
- the defination of , and acceptance rule is same with DFA
The NFA always make the right guess if possible.
如果 NFA 在当前输入下有机会到达最终态,它 一定 会到达最终态。
Any
NFA M always can be transformed to a
DFA M' with
.
为解决不读入情况下的状态转移,引入符号 :for let .
NFA -> DFA
- for and ,