1 / 44

The Chomsky Hierarchy

The Chomsky Hierarchy. Unrestricted Grammars:. Productions. String of variables and terminals. String of variables and terminals. Example unrestricted grammar:. Theorem:. A language is recursively enumerable if and only if is generated by an unrestricted grammar.

Gabriel
Télécharger la présentation

The Chomsky Hierarchy

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Chomsky Hierarchy

  2. Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals

  3. Example unrestricted grammar:

  4. Theorem: A language is recursively enumerable if and only if is generated by an unrestricted grammar

  5. Context-Sensitive Grammars: Productions String of variables and terminals String of variables and terminals and:

  6. The language is context-sensitive:

  7. Theorem: A language is context sensistive if and only if is accepted by a Linear-Bounded automaton

  8. Observation: There is a language which is context-sensitive but not recursive

  9. The Chomsky Hierarchy Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free Regular

  10. Decidability

  11. Consider problems with answer YES or NO Examples: • Does Machine have three states ? • Is string a binary number? • Does DFA accept any input?

  12. A problem is decidable if some Turing machine Solves (decides) the problem Decidable problems: • Does Machine have three states ? • Is string a binary number? • Does DFA accept any input?

  13. The Turing machine that solves a problem answers YES or NO for each instance YES Input problem instance Turing Machine NO

  14. 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 final states

  15. Turing Machine that decides a problem YES NO YES and NO states are halting states

  16. Difference between Recursive Languages and Decidable problems For decidable problems: The YES states may not be final states

  17. Some problems are undecidable: There is no Turing Machine that solves all instances of the problem

  18. A simple undecidable problem: The membership problem

  19. The Membership Problem Input: • Turing Machine • String Question: Does accept ?

  20. Theorem: The membership problem is undecidable Proof: Assume for contradiction that the membership problem is decidable

  21. There exists a Turing Machine that solves the membership problem accepts YES NO rejects

  22. Let be a recursively enumerable language Let be the Turing Machine that accepts We will prove that is also recursive: we will describe a Turing machine that accepts and halts on any input

  23. Turing Machine that accepts and halts on any input YES accept accepts ? NO reject

  24. Therefore, is recursive Since is chosen arbitrarily, we have proven that every recursively enumerable language is also recursive But there are recursively enumerable languages which are not recursive Contradiction!!!!

  25. Therefore, the membership problem is undecidable END OF PROOF

  26. A famous undecidable problem: The halting problem

  27. The Halting Problem Input: • Turing Machine • String Question: Does halt on ?

  28. Theorem: The halting problem is undecidable Proof: Assume for contradiction that the halting problem is decidable

  29. There exists Turing Machine that solves the halting problem YES halts on NO doesn’t halt on

  30. Construction of Input: initial tape contents YES NO Encoding of String

  31. Construct machine : If returns YES then loop forever If returns NO then halt

  32. Loop forever YES NO

  33. Construct machine : Input: (machine ) halts on input If Thenloop forever Elsehalt

  34. copy

  35. Run machine with input itself: Input: (machine ) halts on input If Thenloop forever Elsehalt

  36. : on input If halts then loops forever If doesn’t halt then it halts NONSENSE !!!!!

  37. Therefore, we have contradiction The halting problem is undecidable END OF PROOF

  38. Another proof of the same theorem: If the halting problem was decidable then every recursively enumerable language would be recursive

  39. Theorem: The halting problem is undecidable Proof: Assume for contradiction that the halting problem is decidable

  40. There exists Turing Machine that solves the halting problem YES halts on NO doesn’t halt on

  41. Let be a recursively enumerable language Let be the Turing Machine that accepts We will prove that is also recursive: we will describe a Turing machine that accepts and halts on any input

  42. Turing Machine that accepts and halts on any input NO reject halts on ? YES accept Halts on final state Run with input reject Halts on non-final state

  43. Therefore is recursive Since is chosen arbitrarily, we have proven that every recursively enumerable language is also recursive But there are recursively enumerable languages which are not recursive Contradiction!!!!

  44. Therefore, the halting problem is undecidable END OF PROOF

More Related