1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.

Slides:



Advertisements
Similar presentations
ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala
Advertisements

Fall 2006Costas Busch - RPI1 Turing Machines. Fall 2006Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Lecture 5 Turing Machines
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
1 Computing Functions with Turing Machines. 2 A function Domain: Result Region: has:
Linear Bounded Automata LBAs
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2011.
1 Language Recognition (11.4) and Turing Machines (11.5) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 Turing Machines There are languages that are not context-free. What can we say about the most powerful automata and the limits of computation?. Alan.
Turing Machines (13.5) Based on slides by Costas Busch from the course
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
1 Turing machines Chapter 4, Smith and Kimber. A Turing machine is an abstraction of a human “computer”. Consists of - control, in the form of states -
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 3240 – Chapter 9.  Turing Machines  From Alan Turing, 1936  Turns out to be the LAST machine  The only machine you'll ever need  The Church-Turing.
1 Computing Functions with Turing Machines. 2 A function Domain Result Region has:
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Turing’s Thesis Costas Busch - LSU.
8. Introduction to Turing Machines
Busch Complexity Lectures: Turing Machines
Turing Machines.
Pumping Lemma Revisited
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Computing Functions with Turing Machines
Turing Machines 2nd 2017 Lecture 9.
Chapter 9 TURING MACHINES.
Chapter 3: The CHURCH-Turing thesis
Turing Machines (11.5) Based on slides by Costas Busch from the course
CSE322 Definition and description of finite Automata
8. Introduction to Turing Machines
Computing Functions with Turing Machines
Theory of computing, part 4
CS21 Decidability and Tractability
Formal Languages, Automata and Models of Computation
Decidability and Tractability
Formal Definitions for Turing Machines
Hopcroft, Motawi, Ullman, Chap 8
Presentation transcript:

1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007

2 Content Chomsky Language Hierarchy Turing Machines Determinism Halting TM Examples Standard TM Computing Functions with TM Combining TMs Turing Thesis

3 The Language Hierarchy Regular Languages Context-Free Languages ? ?

4 Regular Languages Context-free languages Unrestricted grammar languages

5 FA Push-down Automata Languages accepted by Turing Machines

6

Tape Read-Write head Control Unit A Turing Machine

Read-Write head No boundaries -- infinite length The head moves Left or Right The Tape

Read-Write head 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right The head at each time step:

10 Example Time Time Reads a 2. Writes k 3. Moves left

11 Time Time Reads b 2. Writes f 3. Moves Right

12 Head starts at the leftmost position of the input string Blank symbol head Input string The Input String

13 Read Write Move Left Move Right States & Transitions

14 Example Time 1 current state

Time Time 2

Time Time 2 Example

Time Time 2 Example

18 Determinism Allowed Not Allowed No lambda transitions allowed in TM! Turing Machines are deterministic

19 Partial Transition Function Example No transition for input symbol Allowed

20 Halting The machine halts if there are no possible transitions to follow

21 Example No possible transition HALT!

22 Final States Allowed Not Allowed Final states have no outgoing transitions In a final state the machine halts

23 Acceptance Accept input If machine halts in a final state Reject input If machine halts in a non-final state or If machine enters an infinite loop

24 Turing Machine Example A TM that accepts the language

25 Time 0

26 Time 1

27 Time 2

28 Time 3

29 Time 4 Halt & Accept

30 Rejection Example Time 0

31 Time 1 No possible Transition Halt & Reject

32 Infinite Loop Example Another TM for language

33 Time 0

34 Time 1

35 Time 2

36 Time 2 Time 3 Time 4 Time 5... infinite loop…

37 Because of the infinite loop: The final state cannot be reached The machine never halts The input is not accepted

38 Another Turing Machine Example Turing machine for the language

39 Time 0

40 Time 1

41 Time 2

42 Time 3

43 Time 4

44 Time 5

45 Time 6

46 Time 7

47 Time 8

48 Time 9

49 Time 10

50 Time 11

51 Time 12

52 Halt & Accept Time 13

53 If we modify the machine for the language we can easily construct a machine for the language Observation

54 Formal Definitions for Turing Machines

55 Transition Function

56 Transition Function

57 Turing Machine Transition function Initial state blank Final states States Input alphabet Tape alphabet

58 Instantaneous description: Configuration

59 Time 4Time 5 A move:

60 Time 4Time 5 Time 6Time 7

61 Equivalent notation:

62 Initial configuration: Input string

63 For any Turing Machine Initial stateFinal state The Accepted Language

64 Standard Turing Machine Deterministic Infinite tape in both directions Tape is the input/output file The machine we described is the standard:

65 Computing Functions with Turing Machines

66 A function has: Domain (domän): Range (värdemängd):

67 A function may have many parameters: Example: Addition function

68 Integer Domain Binary:101 Decimal:5 We prefer unary representation: easier to manipulate Unary:11111

69 Definition A function is computable if there is a Turing Machine such that: Initial configuration Final configuration Domain final state initial state For all

70 Initial Configuration Final Configuration In other words Domain For all A function is computable if there is a Turing Machine such that

71 Example (Addition) The function is computable Turing Machine: Input string: unary Output string: unary are integers

72 Start Finish final state initial state

73 Turing machine for function

74 Execution Example: Time 0 Final Result (2)

75 Time 0

76 Time 1

77 Time 2

78 Time 3

79 Time 4

80 Time 5

81 Time 6

82 Time 7

83 Time 8

84 Time 9

85 Time 10

86 Time 11

87 HALT & accept Time 12

88 Another Example (Multiplication) The functionis computable Turing Machine Input string: unary Output string:unary is integer

89 Start Finish final state initial state

90 Turing Machine Pseudocode for Replace every 1 with $ Repeat: Find rightmost $, replace it with 1 Go to right end, insert 1 Until no more $ remain

91 Turing Machine for

92 Start Finish

93 Time 0

94 Time 1

95 Time 2

96 Time 3

97 Time 4

98 Time 5

99 Time 6

100 Time 7

101 Time 8

102 Time 9

103 Time 10

104 Time 11

105 Time 12

106 Time 13

107 Time 14

108 Another Example The function is computable if Turing Machine for Output: or Input:

109 Turing Machine Pseudocode Match a 1 from with a 1 from Repeat Until all of or are matched If a 1 from is not matched erase tape, write 1 else erase tape, write 0

110 Combining Turing Machines

111 Block Diagram Turing Machine inputoutput

112 Example if Comparer Adder Eraser

113 Turing’s Thesis

114 Do Turing machines have the same power with a digital computer? Intuitive answer: Yes There is no formal answer! Question:

115 Turing’s thesis Any computation carried out by mechanical means can be performed by a Turing Machine (1930)

116 Computer Science Law A computation is mechanical if and only if it can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines

117 Definition of Algorithm An algorithm for function f(w) is a Turing Machine which computes f(w)

118 When we say There exists an algorithm Algorithms are Turing Machines It means There exists a Turing Machine

119 LanguageGrammarMachine Chomsky Hierarchy Turing non- computable Natural computing?? Recursively enumerable (RE) UnrestrictedTuring machines 0 Recursive Turing machines that always halt 0 Context-sensitive Context-sensitive grammar Linear-bounded automata 1 Context-free Context-free grammar Non-deterministic pushdown automata 2 Regular Regular expressions Finite state automata 3 properly inclusive Languages, Grammars, Machines

120 Regular Languages FINITE AUTOMATA Context-free languages PUSH-DOWN AUTOMATA Unrestricted grammar languages TURING MACHINES