ImageVerifierCode 换一换
格式:PPT , 页数:88 ,大小:1.15MB ,
资源ID:9178969      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.docduoduo.com/d-9178969.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(唐常杰翻译的计算理论导引08.ppt)为本站会员(精品资料)主动上传,道客多多仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知道客多多(发送邮件至docduoduo@163.com或直接QQ联系客服),我们立即给予删除!

唐常杰翻译的计算理论导引08.ppt

1、2019/7/27,1/88,Lecture for Computation Theory,Book :计算理论导引Introduction to the Theory of Computation Chapter 3 Turing Machine Prof : 唐常杰TangC Http:/ : Phd, MS in CS . 2000- 2006, SCU Style : Lecture / Seminar,2019/7/27,2/88,Outline for today,Section 3.13.2 :Computability(补充)3.1 Turing machines TM-com

2、putable/recognizable languages3.2 Variants of TMs (多带机,不确定机),2019/7/27,3/88,2019/7/27,4/88,2019/7/27,5/88,Intersection & Complement,上次例题解法2 :Is A= n+2 |n in N, n in binary a RL? 解: =0,1 , * is RL 以1 开始的二进编码 是RL, 1. * (即自然数集合NA= 1.(* -0,1,2 ,2019/7/27,6/88,Union Closure Properties,复习 上周已讲 Lemma: Let

3、A1 and A2 be two CF languages, then the union A1A2 is context free as well.Proof: Assume that the two grammars are G1=(V1,R1,S1) and G2=(V2,R2,S2). Construct a third grammar G3=(V3,R3,S3) by: V3 = V1 V2 S3 (new start variable) with R3 = R1 R2 S3 S1S2 . It follows that L(G3) = L(G1) L(G2).,2019/7/27,

4、7/88,Intersection & Complement?,复习: CFL 对 交运算和补运算不封闭 Let again A1 and A2 be two CF languages. One can prove that, in general, the intersection A1 A2 , and the complement 1= *A1 are not CF languages.直观解释:PDA资源不够多,记忆能力不够,不能作复杂集合(如CFL)的减法,One proves this with specific examples of languages (see homewor

5、k).,2019/7/27,8/88,Intersection & Complement?,复习: CFL 对 交运算和补运算不封闭 Let again A1 and A2 be two CF languages. One can prove that, in general, the intersection A1 A2 , and the complement 1= *A1 are not CF languages.直观解释:PDA资源不够多,记忆能力不够,不能作复杂集合(如CFL)的减法,One proves this with specific examples of language

6、s (see homework).,9/88,What do we really know? 引出问题,Can we always decide if a language L is regular / Context-free or not? We know: 1x | x = 0 mod 7 is regular(比较规律,可有限描述)= 1111111 * 1x | x is prime is not regular(比较复杂。现在数学家还不能简单描述)But what about 1x | x and x+2 are prime ? This is (yet) unknown. 说明对

7、语言的描述和判定 是个需要研究的问题,2019/7/27,10/88,What do we really know? 引出问题,Can we always decide if a language L is regular/ context-free or not? We know: 1x | x = 0 mod 7 is regular(比较规律,可有限描述) 1x | x is prime is not regular(比较复杂。现在数学家还不能简单描述)But what about 1x | x and x+2 are prime ? This is (yet) unknown. 说明

8、对语言的描述和判定 是个需要研究的问题,2019/7/27,11/88,Describing a Language,The problem lies in the informal notion of a description. Consider: n | n2,a,b,c: an+bn = cn 费马问题,已解决,是空集 x | in year x the first female US president 让历史告诉未来 x | x is “an easy to remember number” 描述太含糊 We have to define what we mean by “descr

9、iption” and “method of deciding,2019/7/27,12/88,Describing a Language,The problem lies in the informal notion of a description. Consider: n | n2,a,b,c: an+bn = cn 费马问题,已解决,是空集 x | in year x the first female US president 让历史告诉未来 x | x is “an easy to remember number” 描述太含糊 We have to define what we me

10、an by “description” and “method of deciding”.,2019/7/27,13/88,Describing a Language,The problem lies in the informal notion of a description. Consider: n | a,b,c: an+bn = cn 费马问题,现已经解决是空集 x | in year x the first female US president 让历史告诉未来 x | x is “an easy to remember number” 描述太含糊 We have to defin

11、e what we mean by “description” and “method of deciding”.,2019/7/27,14/88,计算机科学历史上关于概念的争论,什么是计算 什么是操作系统 基本上解决 什么internet ?什么是数据库 什么是数据仓库 还在争论 什么是数据网格 解决方法, 给出 大众能理解的 代表 下页,2019/7/27,15/88,计算机科学历史上关于概念的争论,解决的办法, 给出一个 代表 什么是 3的倍数 3N |N=1,2,3 ,x| x mod 3 =0代表元 :0 什么是操作系统 代表元:Windows, Unix 什么internet 代表

12、元 大众理解:Web , IE 什么是计算? 代表元 图灵机,2019/7/27,16/88,计算机科学历史上关于概念的争论,解决的办法, 给出一个 代表 什么是 3的倍数 3N |N=1,2,3 ,x| x mod 3 =0代表元 :0 什么是操作系统 代表元:Windows, Unix 什么internet 代表元 大众理解:Web , IE 什么是计算? 代表元 图灵机,2019/7/27,17/88,计算机科学历史上关于概念的争论,解决的办法, 给出一个 代表 什么是 3的倍数 3N |N=1,2,3 ,x| x mod 3 =0代表元 :0 什么是操作系统 代表元:Windows,

13、Unix 什么internet 代表元 大众理解:Web , IE 什么是计算? 多个模型, 代表元; 图灵机, 或 递归函数论,2019/7/27,18/88,Chap 3 Turing Machines ep125 cp87,在还没有计算机的时候, 凭想象力把后来出现的 把计算机的理论模型建立起来了。想得如此周到、严密好像从高度文明的外星 来的文化使者,2019/7/27,19/88,Chap 3 Turing Machines ep125 cp 87,After Alan M. Turing (19121954),In 1936, Turing introduced his abstra

14、ct model for computation in his article “On Computable Numbers, with an application to the Entscheidungsproblem”.,At the same time, Alonzo Church published similar ideas and results.,However, the Turing model has become the standard model in theoretical computer science.,2019/7/27,20/88,Chap 3 Turin

15、g Machines ep125 cp87,After Alan M. Turing (19121954),In 1936, Turing introduced his abstract model for computation in his article “On Computable Numbers, with an application to the Entscheidungsproblem”.,At the same time, Alonzo Church published similar ideas and results.,However, the Turing model

16、has become the standard model in theoretical computer science.,2019/7/27,21/88,Chap 3 Turing Machines ep125 cp87,After Alan M. Turing (19121954),In 1936, Turing introduced his abstract model for computation in his article “On Computable Numbers,”.,At the same time, Alonzo Church published similar id

17、eas and results. 殊途同归,However, the Turing model has become the standard model in theoretical computer science.,2019/7/27,22/88,Chap 3 Turing Machines,复习: 关于自动机和下推机中的状态的几种比喻 1 目标 。Goto 的 目标, 标号2 停顿 。连续动作离散化的停顿,(直观启示 可能来自于 手摇计算机,齿轮动作实现,是离散的,一步) 思考。新的起点,歇一口气,根据当前输入,思考下一步动作。(自动机不看历史,下推机看一点很短的历史 - 栈顶值)后面

18、的图灵机中,三者都有,2019/7/27,23/88,Informal Description TM ep 126 cp87,根据当前状态和字符 xi,决定 写 移 转三动作 -写 letter, 有存储器 - 左或右移动 转移状态 可以作循环语句 磁带相当于数组,可读写。这是增加的重要资源,At every step, the head of the TM M reads a letter xi from the one-way infinite tape. 读写头在单向无穷带上左右移动并读写,,2019/7/27,24/88,Informal Description TM ep 126 c

19、p87,根据当前状态和字符 xi,决定 写 移 转三动作 -写 letter, 有存储器 - 左或右移动 转移状态 可以作循环语句 磁带相当于数组,可读写。这是增加的重要资源,At every step, the head of the TM M reads a letter xi from the one-way infinite tape. 读写头在单向无穷带上左右移动并读写,,2019/7/27,25/88,Informal Description TM ep 126 cp87,根据当前状态和字符 xi,决定 写 移 转三动作 -写 letter, 有存储器 - 左或右移动 转移状态 可

20、以作循环语句 磁带相当于数组,可读写。这是增加的重要资源,At every step, the head of the TM M reads a letter xi from the one-way infinite tape. 读写头在单向无穷带上左右移动并读写,,2019/7/27,26/88,Input Convention ep126-128,state q0,初始, the tape contains the input w*, padded with blanks “_”, and the TM is in start state q0.,During the computatio

21、n, the head moves left and right (but not beyond the leftmost point), the internal state of the machine changes, and the content of the tape is rewritten.,数组结构,2019/7/27,27/88,Input Convention ep126-128,state q0,初始, the tape contains the input w*, padded with blanks “_”, and the TM is in start state

22、 q0.,During the computation, the head moves left and right (but not beyond the leftmost point), the internal state of the machine changes, and the content of the tape is rewritten.,数组结构,2019/7/27,28/88,Input Convention ep126-128,state q0,初始, the tape contains the input w*, padded with blanks “_”, an

23、d the TM is in start state q0.,During the computation, the head moves left and right (but not beyond the leftmost point), the internal state of the machine changes, and the content of the tape is rewritten.,数组结构,2019/7/27,29/88,Output Conventionep 126-129,The computation can proceed indefinitely, or

24、 the machines reaches one of the two halting states: 三种前途,接受、拒绝、死循环, bool someFunc( ),2019/7/27,30/88,Output Conventionep 126-129,The computation can proceed indefinitely, or the machines reaches one of the two halting states: 三种前途,接受、拒绝、死循环, bool someFunc( ),2019/7/27,31/88,Turing Machine (Def. c4.

25、1) ep128 cp88,元组式定义 A Turing machine M is defined by a 7-tuple (Q,q0,qaccept,qreject), withQ finite set of states 状态集合,相当于程序标号 finite input alphabet (without “_”) 输入字符 finite tape alphabet with _ 带字符q0 start state Q 开始状态qaccept accept state Q 接受状态qreject reject state Q 拒绝状态 the transition function 转

26、移函数 相当于移动+goto: Qqaccept,qreject Q L,R状态。当前字符 转, 写, 移,2019/7/27,32/88,Turing Machine (Def. c4.1) ep128 cp88,元组式定义 A Turing machine M is defined by a 7-tuple (Q,q0,qaccept,qreject), withQ finite set of states 状态集合,相当于程序标号 finite input alphabet (without “_”) 输入字符 finite tape alphabet with _ 带字符q0 star

27、t state Q 开始状态qaccept accept state Q 接受状态qreject reject state Q 拒绝状态 (状态相当预程序中标号) the transition function 转移函数 相当于移动+goto: Qqaccept,qreject Q L,R状态。当前字符 转, 写, 移,2019/7/27,33/88,Turing Machine (Def. c4.1) ep128 cp88,元组式定义 A Turing machine M is defined by a 7-tuple (Q,q0,qaccept,qreject), withQ finite

28、 set of states 状态集合,相当于程序标号 finite input alphabet (without “_”) 输入字符 finite tape alphabet with _ 带字符q0 start state Q 开始状态qaccept accept state Q 接受状态qreject reject state Q 拒绝状态 the transition function 转移函数 相当于移动+goto: Qqaccept,qreject Q L,R状态。当前字符 转, 写, 移,2019/7/27,34/88,Configuration of a TM ep129 c

29、p88 图稍有不同,格局=状态已经处理部分今后任务, 目前形式与任务 The configuration of a Turing machine consists ofthe current state q Qthe current tape contents *the current head location 0,1,2,This can be expressed as an element of *Q*:,2019/7/27,35/88,Configuration of a TM ep129 cp88 图稍有不同,格局=状态已经处理部分今后任务, 目前形式与任务 The configur

30、ation of a Turing machine consists ofthe current state q Qthe current tape contents *the current head location 0,1,2,This can be expressed as an element of *Q*:,2019/7/27,36/88,An Elementary TM Step ep129 cp89,Let u,v * ; a,b,c ; qi,qjQ, and M a TM with transition function . 格局C1产生格局C2 We say that t

31、he configuration “uaqibv” yields the configuration “uacqjb” if and only if: (qi,b) = (qj,c,R). 格局产生 即 格局 按机演化翻译成 格局演进 似更恰当 Similarly, if (qi,b) = (qj,c,L) / 把当前的b改为c 且左移then “uaqibv” yields “uqjacb”(At the leftmost side of the tape different.),2019/7/27,37/88,An Elementary TM Step ep129 cp89,Let u,v

32、 * ; a,b,c ; qi,qjQ, and M a TM with transition function . 格局C1产生格局C2 We say that the configuration “uaqibv” yields the configuration “uacqjv” if and only if: (qi,b) = (qj,c,R). 格局产生 即 格局 按机演化翻译成 格局演进 似更恰当 Similarly, if (qi,b) = (qj,c,L) / 把当前的b改为c 且左移then “uaqibv” yields “uqjacv”(At the leftmost si

33、de of the tape different.),2019/7/27,38/88,Terminology 格局,starting configuration on input w: “q0w” 初始格局accepting configuration: “uqacceptv” 接受格局 返回truerejecting configuration: “uqrejectv” 拒绝格局 返回falseThe accepting and rejecting configurations are the halting configurations.,2019/7/27,39/88,Terminolo

34、gy 格局,starting configuration on input w: “q0w” 初始格局accepting configuration: “uqacceptv” 接受格局 返回truerejecting configuration: “uqrejectv” 拒绝格局 返回falseThe accepting and rejecting configurations are the halting configurations.,2019/7/27,40/88,用格局概念描述 Accepting ep129 ,cp89,A Turing machine M accepts inpu

35、t w* if and only if there is a finite sequence of configurations C1,C2,Ck with C1 the starting configuration “q0w”for all i=1,k1 Ci yields Ci+1 (following Ms )Ck is an accepting configuration “uqacceptv”The language that consists of all inputs that are accepted by M is denoted by L(M).比喻: bool M(w)

36、最后返回true,2019/7/27,41/88,用格局概念描述 Accepting ep129 ,cp89,A Turing machine M accepts input w* if and only if there is a finite sequence of configurations C1,C2,Ck with C1 the starting configuration “q0w”for all i=1,k1 Ci yields Ci+1 (following Ms )Ck is an accepting configuration “uqacceptv”The languag

37、e that consists of all inputs that are accepted by M is denoted by L(M).比喻: bool M(w) 最后返回true,2019/7/27,42/88,用格局概念描述 Accepting ep129 ,cp89,A Turing machine M accepts input w* if and only if there is a finite sequence of configurations C1,C2,Ck with C1 the starting configuration “q0w”for all i=1,k1

38、 Ci yields Ci+1 (following Ms )Ck is an accepting configuration “uqacceptv”The language that consists of all inputs that are accepted by M is denoted by L(M).比喻: bool M(w) 最后返回true,2019/7/27,43/88,用格局概念描述 Accepting ep129 ,cp89,比喻 录取 会议论文 Turing machine M 录取标准,程序委员会 accepts input w* 字符串,论文, configura

39、tions C1,C2,Ck 评审过程 accepting configuration “uqacceptv” 录用uqrejectv” 拒绝评审无反响 - 死机,2019/7/27,44/88,Turing Recognizable (Def. 3.2) ep130 cp89,A language L is Turing-recognizable if and only if there is a TM M such that L=L(M). 图灵可识: 对 wL 函数M(w)返回true, 对wL,无承诺,Note: On an input wL, the machine M can ha

40、lt in a rejecting state, or it can loop indefinitely.,How do you distinguish between a very long computation and one that will never halt? 问题:如何区别 长计算 与 死循环?,Also called: a recursively enumerable language. L 又称为 递归可枚举语言,2019/7/27,45/88,Turing Recognizable (Def. 3.2) ep130 cp89,A language L is Turing

41、-recognizable if and only if there is a TM M such that L=L(M). 图灵可识: 对 wL 函数M(w)返回true, 对wL,无承诺,Note: On an input wL, the machine M can halt in a rejecting state, or it can loop indefinitely.,How do you distinguish between a very long computation and one that will never halt? 问题:如何区别 长计算 与 死循环?,Also

42、 called: a recursively enumerable language. L 又称为 递归可枚举语言,2019/7/27,46/88,Turing Recognizable (Def. 3.2) ep130 cp89,A language L is Turing-recognizable if and only if there is a TM M such that L=L(M). 图灵可识: 对 wL 函数M(w)返回true, 对wL,无承诺,Note: On an input wL, the machine M can halt in a rejecting state,

43、 or it can loop indefinitely.,How do you distinguish between a very long computation and one that will never halt? 问题:如何区别 长计算 与 死循环?,Also called: a recursively enumerable language. L 又称为 递归可枚举语言,2019/7/27,47/88,Turing Decidable (Def. 3.3) 图灵可判定 ep130, cp84,Also called: a recursive language. 递归语言,比递

44、归可枚举 要求高,A language L=L(M) is decided by the TM M if on every w, the TM finishes in a halting configuration. (That is: qaccept for wL and qreject for all wL.)图灵可判定: 对 wL 函数M(w) 返回true, 对wL,返回false,A language L is Turing-decidable if and only if there is a TM M that decides L.图灵可判定语言,2019/7/27,48/88,

45、Turing Decidable (Def. 3.3) 图灵可判定 ep130, cp89,Also called: a recursive language. 递归语言,比递归可枚举 要求高,A language L=L(M) is decided by the TM M if on every w, the TM finishes in a halting configuration. (That is: qaccept for wL and qreject for all wL.)图灵可判定: 对 wL 函数M(w) 返回true, 对wL,返回false,A language L is

46、 Turing-decidable if and only if there is a TM M that decides L.图灵可判定语言,2019/7/27,49/88,Turing Decidable (Def. 3.3) 图灵可判定 ep130, cp89,Also called: a recursive language. 递归语言,比递归可枚举 要求高,A language L=L(M) is decided by the TM M if on every w, the TM finishes in a halting configuration. (That is: qacce

47、pt for wL and qreject for all wL.)图灵可判定: 对 wL 函数M(w) 返回true, 对wL,返回false,A language L is Turing-decidable if and only if there is a TM M that decides L.图灵可判定语言,2019/7/27,50/88,Exa. 3.4: 判定 A = 0j | j=2n ,n=0 ep131, cp90,Bool M( w) /用C语言模拟TM, 注意不要超标使用资源 if (1 appear in w) return false; j=length(w);lo

48、op: If ( j=1) return true;if ( j mod 2=0) i-; goto loop; else return false ; /注意无论 j 为何值,总有结果 ,Check if j=0 or j=1, accept/reject accordingly Check, by going left to right if the string has even or odd number of zeros If odd then “reject” If even then go back left, erasing half the zeros goto 1 算法伪码,

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报