Download presentation
Presentation is loading. Please wait.
Published bySusan Carson Modified over 9 years ago
2
Decidable languages Section 4.1 CSC 4170 Theory of Computation
3
Examples of decidable languages 4.1.a Decidable: {1,3,5} {x | x is even} {x | x is a perfect square} {x | x 2 -10x = 0} {x | x=y * z for some integers y,z>1 (i.e. x is not prime)} {x | x is a prime (i.e. x is not divisible by anything except 1 and itself)} { | G is a connected graph} { | P is a one-variable polynomial expression with an integral root} Undecidable: { | P is a two-variable polynomial expression with an integral root}
4
The acceptance problem for DFAs is decidable 4.1.b Theorem 4.1: A DFA is a decidable language. Let A DFA = { | B is a DFA that accepts input string w} Proof idea: Here is a Turing machine M that decides A DFA : M = “On input, where B is a DFA and w is a string: 1. Simulate B on input w. 2. If the simulation ends in an accept state, accept. If the simulation ends in a nonaccept state, reject.”
5
The acceptance problem for NFAs is decidable 4.1.c Theorem 4.2: A NFA is a decidable language. Let A NFA = { | B is an NFA that accepts input string w} Proof idea: Here is a Turing machine N that decides A NFA : N = “On input, where B is an NFA and w is a string: 1. Convert NFA B to an equivalent DFA C using the procedure for this conversion that we learned. 2. Run TM M from Theorem 4.1 on input. 3. If M accepts, accept. If M rejects, reject.”
6
The string generation problem for REs is decidable 4.1.d Theorem 4.3: A REX is a decidable language. Let A REX = { | R is a regular expression that generates string w} Proof idea: Here is a Turing machine P that decides A REX : P = “On input, where R is a regular expression and w is a string: 1. Convert R to an equivalent NFA B using the procedure for this conversion that we learned. 2. Run TM N from Theorem 4.2 on input. 3. If N accepts, accept. If N rejects, reject.”
7
The emptiness problem for the language of a DFA is decidable 4.1.e Theorem 4.4: E DFA is a decidable language. Let E DFA = { | A is a DFA and L(A)= } Proof idea: Here is a Turing machine T that decides E DFA : T = “On input, where A is a DFA: 1. Mark the start state of A. 2. Repeat until no new states get marked: 3. Mark any state that has a transition coming into it from any state that is already marked. 4. If no accept state is marked, accept; otherwise reject.”
8
Other decidable problems from the language theory 4.1.f Each the following languages are also decidable: EQ DFA = { | A and B are DFAs and L(A)=L(B)} A CFG = { | G is a CFG that generates string w} Theorem 4.9: Every context-free language is decidable. Proof idea: Suppose L is a context-free language. Let G be the CFG that generates L, and S be a TM that decides A CFG. Here is a Turing machine H that decides L: H = “On input w: 1. Run S on input. 2. If the machine accepts, accept; if it rejects, reject.”
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.