Recap of the previous lectures
- We have seen what it means for a language to be Turing-decidable and Turing-recognisable
- We have seen that all regular, context-free and context-sensitive languages are decidable
- We have shown that there are some languages that are not Turing-recognisable (and thus undecidable)

Containment relationship between important classes of languages
- Can we highlight an undecidable but recognisable language?
The Universal Turing Machine
- We recall that $A_{\mathtt{TM}} = \{ \langle M,w \rangle \mid M \text{ is a Turing machine and } M \text{ accepts string } w\}$.
- A universal Turing machine $U$ takes $\langle M, w \rangle$ from $A_{\mathtt{TM}}$ and emulates $M$ on $w$. [See more]
- $U$ works as follows:
- On input $\langle M, w \rangle$, $U$ checks that $\langle M, w \rangle$ has the correct format
- $U$ simulates $M$ on input $w$
- If $M$ enters an accept state (in the simulation), then $U$ accepts; if $M$ enters a reject state, then $U$ rejects; otherwise $U$ loops.
<aside>
⚠️
PROPOSITION
The Turing machine $U$ recognises $A_{\mathtt{TM}}$.
</aside>
Proof (Sketch): To show that $U$ recognises $A_{\mathtt{TM}}$, we need to show that $U$ accepts a pair $\langle M,w \rangle$ iff it belongs to $A_{\mathtt{TM}}$, i.e., $A_{\mathtt{TM}} = L(U)$. If $M$ accepts $w$, then $\langle M,w \rangle$ is accepted by $U$, so $A_{\mathtt{TM}} \subseteq L(U)$. If $M$ rejects $w$, there is no problem: we know that $U$ rejects $\langle M,w \rangle$. Moreover, if $M$ loops on input $w$, then $U$ loops on input $\langle M,w \rangle$, so $U$ does not accept.
<aside>
⚠️
COROLLARY
$A_{\mathtt{TM}}$ is Turing-recognisable.
</aside>