CS5371 Theory of Computation: Lecture 12: Computability III (Decidable Languages Relating To DFA, NFA, and CFG)
CS5371 Theory of Computation: Lecture 12: Computability III (Decidable Languages Relating To DFA, NFA, and CFG)
Theory of Computation
Lecture 12: Computability III
(Decidable Languages relating
to DFA, NFA, and CFG)
Objectives
•Recall that decidable languages are
languages that can be decided by TM
(that means, the corresponding TM will
accept or reject correctly, never loops)
•In this lecture, we investigate some
decidable languages that are related to
DFA, NFA, and CFG
–Testing Acceptance, Emptiness, or Equality
•Also, we show how TM can simulate CFG
Acceptance by DFA
Let ADFA be the language
{
B, w| B is a DFA that accepts w}
where
B, wdenotes the encoding of B followed by w
Proof:
[Solution 1] We can use the same idea
when we simulate NTM by TM, so that
we give a TM that decides ANFA.
Precisely, we need to try every possible
branch of computation, but only of
length up to |Q||w| + |Q| (why??)
Acceptance by NFA (3)
[Solution 2 (easier)] We re-use DADFA to
give a TM DANFA that decides ANFA:
DANFA = “
On input B, w
1. Convert B to an equivalent DFA C
2. Run DADFA on C, w
3. If DADFA accepts, accept. Else, reject”
Acceptance by NFA (4)
DARE = “
On input
R, w
1. Convert R to an equivalent NFA A
2. Run DANFA on
A, w
3. If DANFA accepts, accept. Else, reject”
Emptiness Test for DFA
Let EDFA be the language
{B| B is a DFA and L(B) = { } }
Unfortunately, no…
Note that we cannot apply similar trick as we
prove EQDFA is decidable
We shall show EQCFG is undecidable later…
TM can simulate CFG
•Previously (a long time ago), we have
shown that given a DFA, we can always
find a CFG that decides the same
language
??
{0x1y}
{0n1n}
Set of Regular Set of Context-
Language {w | w = wR} Free Language
Next Time
•Undecidable Languages
–Languages that CANNOT be decided by
ANY Turing Machine
–Example 1: Turing-recognizable, but not
Turing-decidable
–Example 2: Non-Turing recognizable
(that is, even more difficult!!)