计算理论导论(英文版)图灵机
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Review process
Receive accept reject
uqrejectv
16
Turing Recognizable
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, 无承诺 Also called: a recursively enumerable language. L 又称为递归可枚举语言 Note: On an input wL, the machine M can halt in a rejecting state, or it can „loop‟ indefinitely.
Computability Computable
Equivalence of DFAs; String membership in a RL
Uncomputable
Equivalence of CFGs; Emptiness of the complement of a CFL
3
Considering more powerful model for computation:
20
Exa. : 判定A = { 0j | j=2n ,n
0}
Example 3.4 Describe a TM M that recognizes the language consisting of all strings of 0s whose length is a power of 2. It decides the language A = { 0j | j=2n ,n0}. Solution: To give the formal description of M= (Q,S,G,d,q0,qaccept,qreject) as follows. 1. Q = {q1,q2,q3,q4,q5, qaccept,qreject), 2. S ={0}, and 3. G = {0, x, _ } , 4. q1 start state Q 5. qaccept accept state Q 6. qreject reject state Q 7. To describe the transition function d with the following 21 state diagram. (fig. 3.4 p132)
5
3.1.1 Informal Description TM
An infinite tape -, divided into cells (or called squares), which can each hold exactly one symbol. A tape head – read, write, move around Initially….next page
19
Exa. : 判定A = { 0j | j=2n ,n
0}
Example 3.4 Describe a TM M that recognizes the language consisting of all strings of 0s whose length is a power of 2. It decides the language A = { 0j | j=2n ,n0}. M = “ on input string w: 1. Sweep left to right across the tape, crossing off every other 0. 2. If in stage 1 the tape contained a single 0,accept. 3. If in stage 1 the tape contained more than a single 0 and the number of 0s was odd, reject. 4. Return the head to the left-hand end of the tape. 5. Go to stage 1. “
C1 the starting configuration “q0w” for all i=1,…,k–1, Ci yields Ci+1 (following M‟s d) Ck is an accepting configuration “uqacceptv”
The language that consists of all inputs that are accepted by M is denoted by L(M).
6
Input Convention
7
Input Convention
8
Output Convention
9
Turing Machine
元组式定义 A Turing machine M is defined by a 7-tuple (Q,S,G,d,q0,qaccept,qreject), with 1. Q finite set of states 状态集合,相当于程序标号 2. S finite input alphabet (without “_”) 输入字母表 3. G finite tape alphabet with { _ } S G 带字母表 4. q0 start state Q 开始状态 5. qaccept accept state Q 接受状态 6. qreject reject state Q 拒绝状态 7. d the transition function 转移函数相当于移动+goto
Pushdown automata
2
Conclusion
Both DFA and PDA are handicapped machines with limited computation power. They are too restricted to serve as model of general purpose computers.
14
describe Accepting by configurations
A Turing machine M accepts input wS* if and only if there is a finite sequence of configurations C1,C2,…,Ck with
12
An Elementary TM Step
13
Terminology 格局
starting configuration on input w: “q0w” 初 始格局 accepting configuration: “uqacceptv” 接受格 局返回true rejecting configuration: “uqrejectv” 拒绝格局 返回false The accepting and rejecting configurations are the halting configurations.
10
Configuration of a TM
格局
=状态+已经处理部分+今后任务, 目前形式与任务 The configuration of a Turing machine consists of the current state q Q the current tape contents G* the current head location {0,1,2,…} This can be expressed as an element of G*×Q ×G*:
11
Configuration of a TM
格局=状态+已经处理部分+今后任务, 目前形式与任务 The configuration of a Turing machine consists of the current state q Q the current tape contents G* the current head location {0,1,2,…} This can be expressed as an element of G*×Q ×G*:
灵可识别语言不是可判定的。
18
When Describing TM
It is assumed that you are familiar with TMs and with programming computers. Clarity above all: high level description of TMs is allowed but should not be used as a trick to hide the important details of the program. Standard tools: Expanding the alphabet with separator “#”, and underlined symbols 0, a, to indicate „activity‟. Typical: G = { 0,1,#,_,0,1 }
15
用格局概念Байду номын сангаас述 Accepting
Conference paper A Turing machine M accepts input w S*, configurations C1,C2,…,Ck an accepting configuration “uqacceptv”
Programming committee String paper
Writable and two way tape Random access memory
4
Turing Machines
After Alan M. Turing (1912–1954) In 1936, Turing introduced his abstract model for computation in his article “On Computable Numbers,”. At the same time, Alonzo Church published similar ideas and results. reach the same goal by different routes However, the Turing model has become the standard model in theoretical computer science.
How do you distinguish between a very long computation and one that will never halt?
问题:如何区别长计算与死循环?
17
Turing Decidable
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. 图灵可判定语言 Also called: a recursive language.递归语言,比 递归可枚举要求高 Every decidable language is turing-recognizable but certain-recognizable languages are not decidable.图灵判定语言都是图灵可识别的,但某些图
Chapter 3 The Church-Turing Thesis
1
Models of Computing Devices
Finite automata
Tape head moves only in one direction Tape is read-only The length of tape is constant Tape head moves only in one direction Tape is read-only, but stack is writable Tape length is constant, but stack in unbounded Stack is accessible only in FILO way