c8 1 turing machines vs grammars
play

C8.1 Turing Machines vs. Grammars Regular Languages Automata & - PowerPoint PPT Presentation

Theory of Computer Science April 15, 2020 C8. Type-1 and Type-0 Languages: Closure & Decidability Theory of Computer Science C8. Type-1 and Type-0 Languages: Closure & Decidability C8.1 Turing Machines vs. Grammars Gabriele R


  1. Theory of Computer Science April 15, 2020 — C8. Type-1 and Type-0 Languages: Closure & Decidability Theory of Computer Science C8. Type-1 and Type-0 Languages: Closure & Decidability C8.1 Turing Machines vs. Grammars Gabriele R¨ oger C8.2 Closure Properties and Decidability University of Basel April 15, 2020 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 1 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 2 / 19 C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars Overview Languages & Grammars C8.1 Turing Machines vs. Grammars Regular Languages Automata & Formal Languages Context-free Languages Turing machines Context-sensitive & Closure properties Type-0 Languages & decidability Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 3 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 4 / 19

  2. C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars Reminder: Turing Machines – Conceptually Reminder: Nondeterministic Turing Machine Definition (Nondeterministic Turing Machine) infinite tape A nondeterministic Turing machine (NTM) is given by a 7-tuple . . . . . . � � � b a c a c a c a � � M = � Q , Σ , Γ , δ, q 0 , � , E � with: ◮ Q finite non-empty set of states read-write head ◮ Σ � = ∅ finite input alphabet ◮ Γ ⊃ Σ finite tape alphabet ◮ δ : ( Q \ E ) × Γ → P ( Q × Γ × { L , R , N } ) transition function ◮ q 0 ∈ Q start state ◮ � ∈ Γ \ Σ blank symbol ◮ E ⊆ Q end states Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 5 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 6 / 19 C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars One Automata Model for Two Grammar Types? Linear Bounded Automata: Idea Don’t we need different automata models for context-sensitive and type-0 ◮ Linear bounded automata are NTMs that may only use languages? the part of the tape occupied by the input word. ◮ one way of formalizing this: NTMs where blank symbol may never be replaced by a different symbol Picture courtesy of stockimages / FreeDigitalPhotos.net Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 7 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 8 / 19

  3. C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars Linear Bounded Turing Machines: Definition LBAs Accept Type-1 Languages Theorem The languages that can be accepted by linear bounded automata are exactly the context-sensitive (type-1) languages. Definition (Linear Bounded Automata) Without proof. An NTM M = � Q , Σ , Γ , δ, q 0 , � , E � is called a linear bounded automaton (LBA) proof sketch for grammar ⇒ NTM direction: if for all q ∈ Q \ E and all transition rules � q ′ , c , y � ∈ δ ( q , � ) ◮ computation of the NTM follows the production of the word we have c = � . in the grammar in opposite order German: linear beschr¨ ankte Turingmaschine ◮ accept when only start symbol (and blanks) are left on the tape ◮ because language is context-sensitive, we never need additional space on the tape (empty word needs special treatment) Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 9 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 10 / 19 C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars NTMs Accept Type-0 Languages Deterministic Turing Machines Theorem The languages that can be accepted by nondeterministic Turing machines are exactly the type-0 languages. Definition (Deterministic Turing Machine) A deterministic Turing machine (DTM) is a Turing machine Without proof. M = � Q , Σ , Γ , δ, q 0 , � , E � with δ : ( Q \ E ) × Γ → Q × Γ × { L , R , N } . proof sketch for grammar ⇒ NTM direction: ◮ analogous to previous proof German: deterministische Turingmaschine ◮ for grammar rules w 1 → w 2 with | w 1 | > | w 2 | , we must “insert” symbols into the existing tape content; this is a bit tedious, but not very difficult Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 11 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 12 / 19

  4. C8. Type-1 and Type-0 Languages: Closure & Decidability Turing Machines vs. Grammars C8. Type-1 and Type-0 Languages: Closure & Decidability Closure Properties and Decidability Deterministic Turing Machines vs. Type-0 Languages Theorem For every type-0 language L there is a deterministic Turing machine M with L ( M ) = L. C8.2 Closure Properties and Decidability Without proof. proof sketch: ◮ Let M ′ be an NTM with L ( M ′ ) = L . ◮ It is possible to construct a DTM that systematically searches for an accepting configuration in the computation tree of M ′ . Note: It is an open problem whether an analogous theorem Note: holds for type-1 languages and deterministic LBAs. Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 13 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 14 / 19 C8. Type-1 and Type-0 Languages: Closure & Decidability Closure Properties and Decidability C8. Type-1 and Type-0 Languages: Closure & Decidability Closure Properties and Decidability Overview Closure Properties Languages Intersection Union Complement Concatenation Star & Grammars Type 3 Yes Yes Yes Yes Yes Type 2 No Yes No Yes Yes Regular Languages Yes (2) Yes (1) Yes (2) Yes (1) Yes (1) Type 1 Automata & Yes (2) Yes (1) No (3) Yes (1) Yes (1) Formal Languages Type 0 Context-free Languages Turing machines Proofs? (1) proof via grammars, similar to context-free cases (2) without proof Context-sensitive & Closure properties (3) proof in later chapters (part D) Type-0 Languages & decidability Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 15 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 16 / 19

  5. C8. Type-1 and Type-0 Languages: Closure & Decidability Closure Properties and Decidability C8. Type-1 and Type-0 Languages: Closure & Decidability Summary Decidability Summary Word Emptiness Equivalence Intersection ◮ Turing machines accept exactly the type-0 languages. problem problem problem problem This is also true for deterministic Turing machines. ◮ Linear bounded automata accept exactly Type 3 Yes Yes Yes Yes the context-sensitive languages. Type 2 Yes Yes No No ◮ The context-sensitive and type-0 languages are closed Yes (1) No (3) No (2) No (2) Type 1 under almost all usual operations. ◮ exception: type-0 not closed under complement No (4) No (4) No (4) No (4) Type 0 ◮ For context-sensitive and type-0 languages Proofs? almost no problem is decidable. (1) same argument we used for context-free languages ◮ exception: word problem for context-sensitive lang. decidable (2) because already undecidable for context-free languages (3) without proof (4) proofs in later chapters (part D) Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 17 / 19 Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 18 / 19 C8. Type-1 and Type-0 Languages: Closure & Decidability Summary What’s Next? contents of this course: A. background � ⊲ mathematical foundations and proof techniques B. logic � ⊲ How can knowledge be represented? ⊲ How can reasoning be automated? C. automata theory and formal languages � ⊲ What is a computation? D. Turing computability ⊲ What can be computed at all? E. complexity theory ⊲ What can be computed efficiently? F. more computability theory ⊲ Other models of computability Gabriele R¨ oger (University of Basel) Theory of Computer Science April 15, 2020 19 / 19

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend