Finite Languages \(\subset\) Regular Languages \(\subset\) Context-free Languages \(\subset\) Decidable Languages \(\subset\) Recognizable Languages

**Theorem** Every regular languages is decidable.

**Proof** Let \(M=\{Q,\Sigma,\delta,q_0,F\}\) be a DFA that recognizes the regular language \(L\).

Let \(T=\{Q',\Sigma',\Gamma',\delta',q_0',q_{acc},q_{rej}\}\) be the Turning Machine by

- \(Q'= Q\cup\{q_{acc},q_{rej}\}\)
- \(q_0'=q_0\)
- \(\Sigma'=\Sigma\)
- \(\Gamma'=\Sigma\cup\{\_\}\)
- \(\delta'(q,a)=(\delta(q,a),a,R)\) for every \(a\in\Sigma\).
- \(\delta'(q,\_)=(q_{rej},\_,R)\) if \(q\not\in\Sigma\).
- \(\delta'(q,\_)=(q_{acc},\_,R)\) if \(q\in\Sigma\).

**Theorem** Every context-free languages is decidable.

**Proof** Wrong approach: simulate a PDA.

Right approach: simulate/implement the CFG that generates the CFL \(L\).

**Key Idea** Implement a CFG in Chomsky Normal form for \(L\). Let you enumerate all possible strings of length equal to the input generated by the grammar in finite time.

**Definition** Let VarTM be the extension of TM model where we have a finite number of variables that take values in \(\Gamma\).

**Theorem** Every language decidable by VarTMs is also decidable by TMs.

**Proof** \(Q'=Q\times\Gamma^m\) where \(m\) is the number of variables in the VarTM.

**Definition** Let SubTM be the extension of TM model where we can call other TMs and run them as a black box.

**Theorem** Every language decidable by SubTMs is also decidable by TMs.

**Proof**

**Definition** Let StackTM be the extension of TM model where the TMs have a stack.

**Theorem** Every language decidable by StackTMs is also decidable by TMs.

**Definition** Let MultiTM be the extension of TM model where TMs have a constant number \(k\) of tapes.

**Theorem** Every language decidable by MultiTMs is also decidable by TMs.

**Definition** A non-deterministic TM is a 7-tuple \((Q,\Sigma,\Gamma,\delta,q_0,q_{acc},q_{rej})\) where \(\delta:Q\times\Gamma\rightarrow\mathcal{P}(Q\times\Gamma\times\{L,R\})\)

**Definition** The non-deterministic TM \(M\) decides \(L\) if

- For every \(x\in L\), at least one path leads to the accept state.
- For every \(x\not\in L\), no path leads to the accept states.
- For every \(x\in\Sigma^*\), all possible paths terminate (at \(q_{acc}\) or \(q_{rej}\) in a dead end).

**Definition** The non-deterministic TM \(M\) recognizes \(L\) if

- For every \(x\in L\), at least one path leads to the accept state.
- For every \(x\not\in L\), no path leads to the accept states.

**Theorem** If \(L\) is decidable (recognizable) by a NTM, then it is also decidable(recognizable) by a TM.