1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.

Slides:



Advertisements
Similar presentations
Linear Bounded Automata LBAs
Advertisements

CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Costas Busch - RPI1 Undecidable problems for Recursively enumerable languages continued…
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2006Costas Busch - RPI1 The Post Correspondence Problem.
Fall 2004COMP 3351 The Chomsky Hierarchy. Fall 2004COMP 3352 Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Linear Bounded Automata LBAs
Homework #9 Solutions.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Fall 2006Costas Busch - RPI1 The Chomsky Hierarchy.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2005.
CS 461 – Nov. 7 Decidability concepts –Countable = can number the elements  –Uncountable = numbering scheme impossible  –A TM undecidable –Language classes.
Recursively Enumerable and Recursive Languages
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
Decidability Decidable/Undecidable problems. Jaruloj Chongstitvatana Decidability2 Accepting: Definition Let T = (Q, , , , s) be a TM. T accepts.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals.
Costas Busch - LSU1 The Post Correspondence Problem.
Undecidability and The Halting Problem
CS 154 Formal Languages and Computability April 28 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
Computability. Turing Machines Read input letter & tape letter, write tape letter, move left or right.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Another famous undecidable problem: The halting problem.
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
Recursively Enumerable and Recursive Languages
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions.
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
LIMITS OF ALGORITHMIC COMPUTATION
NPDAs Accept Context-Free Languages
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Turing acceptable languages and Enumerators
CSE322 The Chomsky Hierarchy
Decidable Languages Costas Busch - LSU.
Turing acceptable languages and Enumerators
Undecidable problems:
Formal Languages, Automata and Models of Computation
Decidability continued….
Automata, Grammars and Languages
The Chomsky Hierarchy Costas Busch - LSU.
Presentation transcript:

1 The Chomsky Hierarchy

2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals

3 Example grammar:

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

5 Context-Sensitive Grammars: Rules have form String of variables and terminals String of variables and terminals And:

6 The language is context-sensitive:

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

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

9 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 the problem

13 Some decidable problems: Does Machine have three states ? Is string a binary number? Does DFA accept any input?

14 The machine that decides the 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 Difference between Recursive Languages and Decidable problems The YES halting states may not be final states For decidable problems:

16 There are some problems which are undecidable: There is no Turing Machine that solves all instances of the problem

17 A famous undecidable problem: The halting problem

18 The Halting Problem Inputs: Turing Machine String Question: Does halt on ?

19 THEOREM The halting problem is undecidable

20 THEOREM The halting problem is undecidable PROOF Assume for contradiction that the halting problem is decidable

21 There exists Turing Machine that solves the halting problem YES or NO YES:accepts NO: Doesn’t accept

22 Initial tape contents Encoding of String YES NO

23 Construct machine : If returns YES then loop forever If returns NO then halt

24 NO Loop forever

25 Construct machine Input: If halts on input then loop forever Else halt : (machine )

26 repeat

27 Run machinewith input itself

28 Run machine Input: If halts on input then loop forever Else halt : (machine )

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

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

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

32 THEOREM The halting problem is undecidable PROOF Assume for contradiction that the halting problem is decidable

33 Turing Machine solves the halting problem For inputs:machineand string Returns: halts on input YES: if doesn’t halt on input NO: if

34 Let be a recursively enumerable language Let be the Machine that accepts We will prove that is recursive We will describe a membership algorithm

35 Run with inputs: and If Returns: doesn’t halt on inputNO: Thendoesn’t accept

36 If Returns: halts on input YES: Run with input will halt, and either accept or reject

37 Thereforeis recursive But there are recursively enumerable languages which are not recursive Contradiction!!!!

38 Therefore, the halting problem is undecidable END OF PROOF

39 Reducibility

40 Problem is reduced to problem If is decidable then is decidable means

41 Problem is reduced to problem If is undecidable then is undecidable also means

42 Example: The halting problem is reduced to The state-entry problem

43 The state-entry problem Inputs: Turing Machine State Question: Does String enter state on input ?

44 THEOREM The state-entry problem is undecidable

45 THEOREM The state-entry problem is undecidable PROOF Reduce the halting problem to the state-entry problem

46 Suppose we have an algorithm for the state-entry problem We will construct an algorithm for the halting problem

47 Inputs for the halting problem A machine A string Algorithm for halting problem must determine if halts on input

48 Modify machine : Add new state From any halting state add transitions to halting states Single halt state

49 halts if and only if halts on state

50 Algorithm for halting problem: Inputs:and 1. Construct with state 2. Run algorithm for state-entry problem with inputs:,,

51 GenerateState-entry machine Halting problem machine YES NO

52 Since the halting problem is undecidable, the state-entry problem is also undecidable END OF PROOF

53 Another example: The halting problem is reduced to The blank-tape halting problem

54 The blank-tape halting problem Input: Turing Machine Question: Doeshalt when started with a blank tape?

55 THEOREM The blank-tape halting problem is undecidable

56 THEOREM PROOF Reduce halting problem to Blank-tape halting problem The blank-tape halting problem is undecidable

57 Suppose we have an algorithm for the blank-tape halting problem We will construct an algorithm for the halting problem

58 Inputs for the halting problem A machine A string Algorithm for halting problem must determine if halts on input

59 Construct a new machine On blank tape writes Then continues execution like

60 halts if and only if halts when started with blank tape

61 Algorithm for halting problem: Inputs:and 1. Construct 2. Run algorithm for blank-tape halting problem with input,,

62 Generate blank-tape halting machine Halting problem machine YES NO

63 Since the halting problem is undecidable, the blank-tape halting problem is also undecidable END OF PROOF