1.85k likes | 2.07k Views
CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 13 Mälardalen University 2012. 1.
E N D
CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 13 Mälardalen University 2012 1
ContentAlan Turing and Hilbert Program UniversalTuring Machine Chomsky Hierarchy DecidabilityReducibilityUncomputable FunctionsRice’s TheoremChurch-Turing ThesisComputation beyond Turing ModelInteractive Computing, Persistent TM’s (Dina Goldin/Peter Wegner)
TURING MACHINES Based on C Busch, RPI, Models of Computation
Turing’s "Machines". These machines are humans who calculate. (Wittgenstein) A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine. (Turing)
Standard Turing Machine Tape ...... ...... Read-Write head Control Unit
The Tape No boundaries -- infinite length ...... ...... Read-Write head The head moves Left or Right
...... ...... Read-Write head The head at each time step: 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right
Example Time 0 ...... ...... Time 1 ...... ...... 1. Reads 2. Writes 3. Moves Left
The Input String Input string Blank symbol ...... ...... head Head starts at the leftmost position of the input string
States & Transitions Write Read Move Left Move Right
Time 1 ...... ...... Time 2 ...... ......
Determinism Turing Machines are deterministic Not Allowed Allowed No lambda transitions allowed in standard TM!
Turing Machine Input alphabet Tape alphabet States Final states Transition function Initial state blank
Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Better are reprogrammable machines.
Solution: Universal Turing Machine Characteristics: • Reprogrammable machine • Simulates any other Turing Machine
Universal Turing Machine simulates any other Turing Machine Input of Universal Turing Machine • Description of transitions of • Initial tape contents of
Tape 1 Three tapes Description of Tape 2 Universal Turing Machine Tape Contents of Tape 3 States of
Tape 1 Description of We encode/describe Turing Machine as a string of symbols.
Alphabet Encoding Symbols: Encoding: Tape Contents Encoding
States: Encoding: Move: Encoding: State Encoding Head Move Encoding
Transition Encoding Transition: Encoding: separator
Machine Encoding Transitions: Encoding: separator
Tape 1 contents of Universal Turing Machine: encoding of the simulated machine as a binary string of 0’s and 1’s
A Turing Machine is described with a binary string of 0’s and 1’s. Therefore: The set of Turing machines forms a language: Each string of the language is the binary encoding of a Turing Machine.
Language of Turing Machines (Turing Machine 1) L = {010100101, 00100100101111, 111010011110010101, ……} (Turing Machine 2) (Turing Machine 3) ……
The Chomsky Language Hierarchy Recursively-enumerable Recursive Context-sensitive Context-free Regular Non-recursively enumerable
Unrestricted Grammars Productions String of variables and terminals String of variables and terminals Recursively Enumerable Languages
Theorem A language is recursively enumerable if and only if it is generated by an unrestricted grammar.
Context-Sensitive Grammars Productions String of variables and terminals String of variables and terminals and
The language is context-sensitive:
Theorem A language is context sensitive if and only if it is accepted by a Linear-Bounded automaton.
Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the only tape space allowed to use.
Linear Bounded Automaton (LBA) Input string Working space in tape Left-end marker Right-end marker All computation is done between end markers.
Observation There is a language which is context-sensitive but not recursive.
Does Machine have three states ? • Is string a binary number? • Does DFA accept any input? Consider problems with answer YES or NO. Examples
Does Machine have three states ? • Is string a binary number? • Does DFA accept any input? A problem is decidable if some Turing machine solves (decides) the problem. Decidable problems:
The Turing machine that solves a problem answers YES or NO for each instance. YES Input problem instance Turing Machine NO
The machine that decides a problem: • If the answer is YES • then halts in a yes state • If the answer is NO • then halts in a no state These states may not be the final states.
Turing Machine that decides a problem YES NO YES and NO states are halting states
Difference between Recursive Languages (“Acceptera”) and Decidable problems (“Avgöra”) For decidable problems: The YES states may not be final states.
Some problems are undecidable: There is no Turing Machine that solves all instances of the problem.
A famous undecidable problem: The halting problem
String Input: • Turing Machine Question: Does halt on ? The Halting Problem
Theorem The halting problem is undecidable. Proof Assume to the contrary that the halting problem is decidable.