\begin{frame}{Exercise}
\begin{exampleblock}{}
Consider the following grammar
\begin{talign}
S &\to ABaC
& A &\to BC
& B &\to b \mid \lambda
& D &\to d \\
&&&& C &\to D \mid \lambda
\end{talign}
\pause
What variables are erasable?
\begin{itemize}
\pause
\item $A$, $B$ and $C$
\end{itemize}
\pause\medskip
Construct the resulting grammar after removing all $\lambda$-rules:
\pause
\begin{talign}
S &\to ABaC \mpause[1]{\mid BaC} \mpause{\mid AaC} \mpause{\mid ABa} \mpause{\mid aC} \mpause{\mid Ba} \mpause{\mid Aa} \mpause{\mid a} \\
A &\to BC \mpause{\mid C} \mpause{\mid B} \mpause{\onslide<-15>{\mid \lambda}} \\
B &\to b \onslide<-15>{\mid \lambda} \hspace{2cm}
C \to D \onslide<-15>{\mid \lambda} \hspace{2cm}
D \to d\mpause{}
\end{talign}
\end{exampleblock}
\end{frame}
\themex{ Unit Production Rules}