Download presentation
Presentation is loading. Please wait.
Published byErik Ramsey Modified over 9 years ago
1
©Brooks/Cole, 2003 Chapter 17 Theory of Computation
2
©Brooks/Cole, 2003 Understand how a simple language with limited statements can solve any problem. Understand how the Turing machine can solve any problem that can be solved by a computer. Understand the Godel number and its importance in the theory of computation. After reading this chapter, the reader should be able to: O BJECTIVES Understand the halting problem as an example of a large set of problems that cannot be solved by a computer.
3
©Brooks/Cole, 2003 SIMPLE LANGUAGE 17.1
4
©Brooks/Cole, 2003 Figure 17-1 Statements in simple language
5
©Brooks/Cole, 2003 TURING MACHINE 17.2
6
©Brooks/Cole, 2003 Figure 17-2 Turing machine
7
©Brooks/Cole, 2003 Figure 17-3 Tape
8
©Brooks/Cole, 2003 Figure 17-4 Transition state
9
©Brooks/Cole, 2003 Table 17.1Transitional table Current State Current State ----- A B C D Write Write ---------------- # & 1 same as read blank 1 same as read 1 New State New State ----- B C A B D B D Read Read ------------- 1 or blank # or & 1 not 1 1 not 1 not a blank blank Move Move --------
10
©Brooks/Cole, 2003 Figure 17-5 Transition diagram for incr x
11
©Brooks/Cole, 2003 Table 17.2Transitional table for incr x statement Current State Current State --------- StartIncr Forward Added Backward Write Write ---------------- # 1 1 & same as read # New State New State ---------- Forward Added Backward StopIncr Read Read ------------- # 1 & any not # # Move Move --------
12
©Brooks/Cole, 2003 Figure 17-6 Steps in incr x statement
13
©Brooks/Cole, 2003 Figure 17-7 Transition diagram for decr x
14
©Brooks/Cole, 2003 Table 17.3Transitional table for decr x statement Current State Current State --------- StartDecr Forward Delete Backward Write Write ---------------- # 1 blank & same as read # New State New State ---------- Forward Delete Backward StopDecr Read Read ------------- # 1 & 1 not # # Move Move --------
15
©Brooks/Cole, 2003 Figure 17-8 Transition diagram for the loop statement
16
©Brooks/Cole, 2003 Table 17.4Transitional table for the loop statement Current State Current State --------- StartLoop Check Forward … EndProcess Backward Read Read ------------- # not 1 1 not & & … any not # # Move Move -------- none … none New State New State --------- Check StopLoop Forward StartProcess … Backward Check Write Write ------------- # same as read 1 same as read & … same as read #
17
©Brooks/Cole, 2003 GODELNUMBERSGODELNUMBERS 17.2
18
Table 17.5Code for symbols used in the Simple Language Symbol --------- 1 2 3 4 5 6 7 8 Hex Code Hex Code ------------- 1 2 3 4 5 6 7 8 Hex Code Hex Code ------------- 1 2 3 4 5 6 7 8 Symbol --------- 9 incr decr while { } x Hex Code Hex Code ------------- 9 A B C D E F
19
©Brooks/Cole, 2003 HALTINGPROBLEMHALTINGPROBLEM 17.3
20
Can you write a program that tests whether or not any program, represented by its Godel number, will terminate? A Classical Programming Question:
21
©Brooks/Cole, 2003 Figure 17-9 Step 1 in proof
22
©Brooks/Cole, 2003 Figure 17-10 Step 2 in proof
23
©Brooks/Cole, 2003 Figure 17-11 Step 3 in proof
24
©Brooks/Cole, 2003 SOLVABLE AND UNSOLVABLE PROBLEMS SOLVABLE AND UNSOLVABLE PROBLEMS 17.5
25
©Brooks/Cole, 2003 Figure 17-12 Taxonomy of problems
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.