Decidability and Tractability

Slides:



Advertisements
Similar presentations
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Advertisements

Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
Turing machines Sipser 2.3 and 3.1 (pages )
Turing machines Sipser 2.3 and 3.1 (pages )
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Lecture 5 Turing Machines
January 14, 2015CS21 Lecture 51 CS21 Decidability and Tractability Lecture 5 January 14, 2015.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
January 23, 2015CS21 Lecture 81 CS21 Decidability and Tractability Lecture 8 January 23, 2015.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
AUTOMATA THEORY VIII.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
Umans Complexity Theory Lectures Lecture 1b: Turing Machines & Halting Problem.
Theory of Languages and Automata By: Mojtaba Khezrian.
February 1, 2016CS21 Lecture 121 CS21 Decidability and Tractability Lecture 12 February 1, 2016.
8. Introduction to Turing Machines
CSCI 2670 Introduction to Theory of Computing
Complexity and Computability Theory I
Busch Complexity Lectures: Turing Machines
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
Turing Machines.
CS21 Decidability and Tractability
Turing Machines Chapter 17.
Pumping Lemma Revisited
CSE 105 theory of computation
CS154, Lecture 7: Turing Machines.
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines (At last!).
Summary.
Chapter 3: The CHURCH-Turing thesis
فصل سوم The Church-Turing Thesis
Intro to Theory of Computation
Turing Machines Chapter 17.
CSE 105 theory of computation
8. Introduction to Turing Machines
Context-Free Grammars
Context-Free Languages
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
Turing Machines Complexity ©D.Moshkovitz.
CS21 Decidability and Tractability
… NPDAs continued.
CSE 105 theory of computation
CSE 105 theory of computation
Computability Catch up last lecture. Turing machines. Variations
Turing Machines Everything is an Integer
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Decidability and Tractability (based on slides of Chris Umans) 4/4/2019 cosc 417 - Turing machines

Outline Turing Machines and variants Church-Turing Thesis multitape TMs nondeterministic TMs Church-Turing Thesis 4/4/2019 cosc 417 - Turing machines

Summary Nondeterministic Pushdown Automata (NPDA) Context-Free Grammars (CFGs) describe Context-Free Languages (CFLs) terminals, non-terminals productions yields, derivations parse trees 4/4/2019 cosc 417 - Turing machines

Summary NDPAs and CFGs are equivalent CFL Pumping Lemma is used to show certain languages are not CFLs 4/4/2019 cosc 417 - Turing machines

Summary deterministic PDAs recognize DCFLs DCFLs are closed under complement there is an efficient algorithm (based on dynamic programming) to determine if a string x is generated by a given grammar G 4/4/2019 cosc 417 - Turing machines

So far… several models of computation finite automata pushdown automata fail to capture our intuitive notion of what is computable all languages regular languages context free languages 4/4/2019 cosc 417 - Turing machines

{w : w ∈ {a,b}* has an even # of b’s} So far… We proved (using constructions of FA and NPDAs and the two pumping lemmas): {anbn : n ≥ 0 } {w : w ∈ {a,b}* has an even # of b’s} regular languages all languages context free languages {anbncn : n ≥ 0 } 4/4/2019 cosc 417 - Turing machines

A more powerful machine limitation of NPDA related to fact that their memory is stack-based (last in, first out) What is the simplest alteration that adds general-purpose “memory” to our machine? Should be able to recognize, e.g., {anbncn : n ≥ 0 } 4/4/2019 cosc 417 - Turing machines

Turing Machines q0 New capabilities: input tape … finite control 1 1 1 1 1 1 finite control read/write head q0 New capabilities: infinite tape can read OR write to tape read/write head can move left and right 4/4/2019 cosc 417 - Turing machines

Turing Machine Informal description: input written on left-most squares of tape rest of squares are blank at each point, take a step determined by current symbol being read current state of finite control a step consists of writing new symbol moving read/write head left or right changing state 4/4/2019 cosc 417 - Turing machines

Example Turing Machine language L = {w#w : w ∈ {0,1}*} input tape … 1 # 1 finite control q0 read/write head 4/4/2019 cosc 417 - Turing machines

Turing Machine diagrams a → b,L a → R states (1 accept + 1 reject) start state b → L b → R qreject qaccept b → a,R transition label: (tape symbol read → tape symbol written, direction moved) “_” means blank tape square a → R means “read a, move right” a → L means “read a, move left” a → b, R means “read a, write b, move right 4/4/2019 cosc 417 - Turing machines

Example TM diagram q1 q3 q5 q7 q9 q0 q11 q12 q13 qaccept q2 q4 q6 q8 x → R #→R _→L _→R #→R q1 q3 q5 q7 q9 0 → _,R 0 → x, R 0 → x, L x → R x → R 0,1,x,# → L _→R #→R _→R q0 q11 q12 q13 qaccept # → R 1 → x, R 1 → x, L 1 → _,R q2 q4 q6 q8 q10 #→R _→L _→R #→R 0,1 → R 0,1 → R 0,1,# → L 0,1 → R x → R 4/4/2019 cosc 417 - Turing machines

(Q, Σ, Γ, δ, q0, qaccept, qreject) where: TM formal definition A TM is a 7-tuple (Q, Σ, Γ, δ, q0, qaccept, qreject) where: Q is a finite set called the states Σ is a finite set called the input alphabet Γ is a finite set called the tape alphabet δ:Q x Γ→ Q x Γ x {L, R} is a function called the transition function q0 is an element of Q called the start state qaccept, qreject are the accept and reject states 4/4/2019 cosc 417 - Turing machines

Example TM operation program for “binary successor” # 1 start # 1 1 start # 1 start q σ δ(q,σ) start (start, 0, R) 1 (start, 1, R) _ (t, _, L) # (start, #, R) t (accept, 1, -) (t, 0, L) (accept, #, R) # 1 start # 1 start # 1 t # t # 1 accept 4/4/2019 cosc 417 - Turing machines

TM configurations meaning: tape contents: uv followed by blanks in state q reading first symbol of v At every step in a computation, a TM is in a configuration determined by: the contents of the tape the state the location of the read/write head next step completely determined by current configuration shorthand: string uqv with u,v ∈Γ*, q ∈ Q 4/4/2019 cosc 417 - Turing machines

TM configurations configuration C1 yields configuration C2 if TM can legally* move from C1 to C2 in 1 step notation: C1 ⇒ C2 also: “yields in 1 step” notation: C1 ⇒1 C2 “yields in k steps” notation: C1 ⇒k C2 if there exists configurations D1,D2,…Dk-1 for which C1 ⇒ D1 ⇒ D2 ⇒ … ⇒ Dk-1 ⇒ C2 also: “yields in some # of steps” (C1 ⇒* C2) *Convention: TM halts upon entering qaccept, qreject 4/4/2019 cosc 417 - Turing machines

TM configurations Formal definition of “yields”: two special cases: u,v ∈Γ* a,b,c ∈Γ qi, qj ∈ Q Formal definition of “yields”: uaqibv ⇒ uqjacv if δ(qi, b) = (qj, c, L), and uaqibv ⇒ uacqjv if δ(qi, b) = (qj, c, R) two special cases: left end: qibv ⇒ qjcv if δ(qi, b) = (qj, c, L) right end: uaqi same as uaqi_ (qi ≠ qaccept, qreject) 4/4/2019 cosc 417 - Turing machines

TM acceptance start configuration: q0w (w is input) accepting config.: any config.with state qaccept rejecting config.: any config. with state qreject TM M accepts input w if there exist configurations C1, C2, …, Ck C1 is start configuration of M on input w Ci ⇒ Ci+1 for i = 1, 2, 3, …, k-1 Ck is an accepting configuration 4/4/2019 cosc 417 - Turing machines

Deciding and Recognizing accept reject loop forever input machine TM M: L(M) is the language it recognizes if M rejects every x ∉ L(M) it decides L set of languages recognized by some TM is called Turing-recognizable or recursively enumerable (RE) set of languages decided by some TM is called Turing-decidable or decidable or recursive 4/4/2019 cosc 417 - Turing machines

Deciding and Recognizing accept reject loop forever input machine TM M: L(M) is the language it recognizes if M rejects every x ∉ L(M) it decides L set of languages recognized by some TM is called Turing-recognizable or recursively enumerable (RE) set of languages decided by some TM is called Turing-decidable or decidable or recursive 4/4/2019 cosc 417 - Turing machines

Classes of languages We know: regular ⊆ CFL (proper containment) decidable all languages regular languages context free languages RE We know: regular ⊆ CFL (proper containment) CFL ⊆ decidable proof? decidable ⊆ RE ⊆ all languages 4/4/2019 cosc 417 - Turing machines

Multitape TMs A useful variant: k-tape TM q0 input tape … finite control 1 1 1 1 1 1 k read/write heads q0 … 1 1 1 … 1 1 1 1 1 1 k-1 “work tapes” … … 4/4/2019 cosc 417 - Turing machines

Multitape TMs Informal description of k-tape TM: input written on left-most squares of tape #1 rest of squares are blank on all tapes at each point, take a step determined by current k symbols being read on k tapes current state of finite control a step consists of writing k new symbols on k tapes moving each of k read/write heads left or right changing state 4/4/2019 cosc 417 - Turing machines

Multitape TM formal definition A TM is a 7-tuple (Q, Σ, Γ, δ, q0, qaccept, qreject) where: everything is the same as a TM except the transition function: δ:Q x Γk → Q x Γk x {L, R}k δ(qi, a1,a2,…,ak) = (qj, b1,b2,…,bk, L, R,…, L) = “in state qi, reading a1,a2,…,ak on k tapes, move to state qj, write b1,b2,…,bk on k tapes, move L, R on k tapes as specified.” 4/4/2019 cosc 417 - Turing machines

Multitape TMs Theorem: every k-tape TM has an equivalent single-tape TM. Proof: Idea: simulate k-tape TM on a 1-tape TM. 4/4/2019 cosc 417 - Turing machines

Multitape TMs simulation of k-tape TM by single-tape TM: . . . a b a b add new symbol x for each old x marks location of “virtual heads” (input tape) . . . a a . . . b b c d . . . # a b a b # a a # b b c d # 4/4/2019 cosc 417 - Turing machines

Multitape TMs . . . Repeat: scan tape, remembering the symbols under each virtual head in the state (how many new states needed?) make changes to reflect 1 step of M if hit #, shift to right to make room if M halts, erase all but 1st string a b a b . . . a a . . . b b c d . . . # a b a b # a a # b b c d # 4/4/2019 cosc 417 - Turing machines