2NondeterministicFiniteAutomata汇编.ppt

We will show that if then NFA DFA state label state label More generally, we will show that if in: (arbitrary string) then NFA DFA Proof by induction on Induction Basis: is true by construction of NFA DFA Induction hypothesis: NFA DFA Suppose that the following hold Induction Step: NFA DFA Then this is true by construction of Therefore if NFA DFA then We have shown: With a similar proofwe can show: END OF LEMMA PROOF Therefore: dfa引擎的一个特点,尽可能多的匹配目标,dfa的正则式引擎是不需要回滚匹配过程的 ?一个例子 Web页面上一个输入月份的文本框,只能输入1~12,要求用一个有限状态机进行验证。如何配置? ([1-9])|([1][0-2]) DFA也可以提前匹配1,而不继续搜索[0-2 ] ?一个例子 Web页面上一个输入月份的文本框

文档评论(0)

1亿VIP精品文档

相关文档