\begin{frame}{From Acceptance with Empty Stack To Final States}
\begin{exampleblock}{}
Consider the NPDA $M$:
\begin{center}
\begin{tikzpicture}[default,node distance=25mm,->,s/.style={minimum size=5mm}]
\node (q0) [state,s] {$q_0$}; \draw ($(q0) + (-8mm,0mm)$) -- (q0);
\draw (q0) to[tloop] node [label,above] {$a[z/1]$} (q0);
\draw (q0) to[bloop] node [label,below] {$a[1/11]$} (q0);
\node (q1) [fstate,s,right of=q0] {$q_1$};
\draw (q0) to node [label,above] {$b[1/\lambda]$} (q1);
\draw (q1) to[tloop] node [label,above] {$b[1/\lambda]$} (q1);
\end{tikzpicture}
\vspace{-2ex}
\end{center}
Transform it into NPDA $N$ such that $L_{\alert{\lambda}}(M) = L(N) = L_\lambda(N)$\pause:
\begin{center}
\vspace{-1ex}
\begin{tikzpicture}[default,node distance=22mm,->,s/.style={minimum size=5mm}]
\mpause[1]{\node (q0') [state,s] {$\widehat{q_0}$}; \draw ($(q0') + (-8mm,0mm)$) -- (q0');}
\node (q0) [state,s,right of=q0'] {$q_0$}; \draw ($(q0) + (-8mm,0mm)$) -- (q0);
\alt<-6>{ \node (q1) [fstate,s,right of=q0] {$q_1$}; }{ \node (q1) [state,s,right of=q0] {$q_1$}; }
\mpause[1]{
\alt<-6>{ \node (qf) [state,s,right of=q1] {$q_f$}; }{ }
}
\mpause{\draw (q0') to node [label,above] {$\lambda[z/z\hat{z}]$} (q0);}
\draw (q0) to[tloop] node [label,above] {$a[z/1]$} (q0);
\draw (q0) to[bloop] node [label,below] {$a[1/11]$} (q0);
\draw (q0) to node [label,above] {$b[1/\lambda]$} (q1);
\draw (q1) to[tloop] node [label,above] {$b[1/\lambda]$} (q1);
\mpause{\draw (q0) to[bend right=30] node [label,below,align=center] {$\lambda[\hat{z}/\lambda]$} (qf);}
\mpause{\draw (q1) to node [label,above,align=center] {$\lambda[\hat{z}/\lambda]$} (qf);}
\mpause{ \node (qf) [fstate,s,right of=q1] {$q_f$}; }
\end{tikzpicture}
\vspace{-1ex}
\end{center}
\mpause{%
This NPDA $N$ reaches the final state $\iff$ the stack is empty.
\\
}
\end{exampleblock}
\end{frame}