2NondeterministicFiniteAutomata素材.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
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 proof we can show: END OF LEMMA PROOF Therefore: dfa引擎的一个特点,尽可能多的匹配目标,dfa的正则式引擎是不需要回滚匹配过程的 ?一个例子 Web页面上一个输入月份的文本框,只能输入1~12,要求用一个有限状态机进行验证。如何配置? ([1-9])|([1][0-2]) DFA也可以提前匹配1,而不继续搜索[0-2 ] ?一个例子 Web页面上一个输入月份的文本框,只能输入1~12,要求用一个RegularExpressionValidator控件进行验证。如何配置正则表达式? ([1-9])|([1][0-2]) ([1][0-2])|([1-9]) Any Questions? * * * * 以状态y为开始的子自动机 FA_y 设FA_y 对应的函数为 bool FA_func(y ), y是状态, 输入串 是外部变量, 接受输入则返回true * * * 源确定后 函数的像必须是惟一的,否则只能称为关系 * * * * * * * * * * * * NFA DFA Example of equivalent machines NFA的确定化,给定NFA M1,造DFA M2 使得识别结果一样 , cp30 例2.14 设A是{0,1}上倒数第3个符号为1的所有字符串组成的语言(比如00100在A中,而0011不在A中) NFA DFA 1 0, 1 0,1 q1 q2 q3 q4 0,1 q000 q100 q010 q110 q001 q101 q011 q111 1 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 Theorem: Languages accepted by NFAs Regular Languages NFAs and DFAs have the same computation power, accept the same set of languages Languages accepted by DFAs Languages accepted by NFAs Regular Languages Languages accepted by NFAs Regular Languages we only need to show Proof: AND Languages accepted by NFAs Regular Languages Proof-Step 1 Every DFA is trivially an NFA Any language accepted by a DFA is also accepted by an NFA Languages accepted by NFAs Regular Languages Proof-Step 2 Any NFA can be converted to an equivalent DFA Any language accepted by an NFA is also accepted by a DFA Conversion NFA to DFA NFA DFA NFA DFA 捆绑箭头 NFA DFA empty set trap state NFA DFA union NFA DFA union NFA DFA trap state NFA DFA END OF CONSTRUCTION General Conversion Procedure Input: an NFA Output: an equivalent DFA with The NFA M has states The DFA M’ has s

文档评论(0)

a5522235 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档