156/162
\begin{frame}{Example}
  \noindent
  \begin{minipage}{.75\textwidth}
  \begin{exampleblock}{}
    \begin{center}
      \begin{tikzpicture}[default,node distance=20mm,->,s/.style={minimum size=5mm}]
        \node (q0) [state,s] {$q_0$}; \draw ($(q0) + (-8mm,0mm)$) -- (q0); 
        \node (q1) [state,s,right of=q0,node distance=25mm] {$q_1$};
        \node (q2) [state,s,right of=q1] {$q_2$};
        \node (q3) [fstate,s,right of=q2] {$q_3$};
      
        \malert{0}{4}{\draw (q0) to[bend left=20] (q1);}
        \malert{0}{2}{\draw [draw=none] (q0) to[bend left=20] node [label,above,align=center] {$a[0/10]$\\[1mm]} (q1);}
        \malert{2}{2}{\draw [draw=none] (q0) to[bend left=20] node [label,above,align=center] {$c[1/11]$} (q1);}

        \malert{4}{2}{\draw (q1) to[bend left=20] node [label,below] {$c[1/1]$} (q0);}
        \malert{6}{2}{\draw (q1) to[tloop] node [label,above] {$b[1/\lambda]$} (q1);}
        \malert{10}{2}{\draw (q1) to node [label,above] {$\lambda[1/\lambda]$} (q2);}
        \malert{14}{2}{\draw (q2) to node [label,above] {$\lambda[0/\lambda]$} (q3);}
        \malert{12}{2}{\draw (q2) to[tloop] node [label,above] {$\lambda[1/\lambda]$} (q2);}
        \malert{8}{2}{\draw (q1) to[bend right=20] node [label,below] {$\lambda[0/\lambda]$} (q3);}
      \end{tikzpicture}
      \vspace{-2.5ex}
    \end{center}
    
    The resulting context-free grammar is:
    \begin{talign}
      (q_0\,0\,\mpause[1]{\alert{r_2}) &\stackrel{1}{\to} a\,(q_1\,1\,\alert{r_1})\,(\alert{r_1}\,0\,\alert{r_2})}
        & \mpause[8]{(q_1\,0\,}\mpause{q_3) &\stackrel{5}{\to} \lambda} 
      \\[-1ex]
      \mpause[2]{(q_0\,1\,}\mpause{\alert{r_2}) &\stackrel{2}{\to} c\,(q_1\,1\,\alert{r_1})\,(\alert{r_1}\,1\,\alert{r_2})}
        & \mpause[10]{(q_1\,1\,}\mpause{q_2) &\stackrel{6}{\to} \lambda} 
      \\[-1ex]
      \mpause[4]{(q_1\,1\,}\mpause{\alert{r_1}) &\stackrel{3}{\to} c\,(q_0\,1\,\alert{r_1})} 
        & \mpause[12]{(q_2\,1\,}\mpause{q_2) &\stackrel{7}{\to} \lambda}
      \\[-1ex]
      \mpause[6]{(q_1\,1\,}\mpause{q_1) &\stackrel{4}{\to} b}
        & \mpause[14]{(q_2\,0\,}\mpause{q_3) &\stackrel{8}{\to} \lambda}
    \end{talign}
    \mpause[1]{for all $\alert{r_1},\alert{r_2}\in\{q_0,q_1,q_2,q_3\}$.}
    \pause\pause\pause\pause\pause\pause\pause\pause\pause\pause\pause\pause\pause\pause\pause\pause
    Here $S=(q_0\,0\,q_3)$.
  \end{exampleblock}
  \end{minipage}~~~~~%
  \begin{minipage}{.24\textwidth}
    \pause
    \hphantom{$\vdash$ }$(\alert<25>{q_0},\alert<25-27>{a}ccb,\hfill \alert<25>{0})$\\
    \pause
    $\alert<25-27>{\vdash}$ $(\alert<26-27,28>{q_1},\alert<28-29>{c}cb,\hfill \alert<26-27>{\alert<28>{1}0})$\\
    \pause
    $\alert<28-29>{\vdash}$ $(\alert<29,30>{q_0},\alert<30-32>{c}b,\hfill \alert<29,30>{1}0)$\\
    \pause
    $\alert<30-32>{\vdash}$ $(\alert<31-32,33-34>{q_1},\alert<33-34>{b},\hfill \alert<31-32>{\alert<33-34>{1}1}0)$\\
    \pause
    $\alert<33-34>{\vdash}$ $(\alert<32,33-34,35-36>{q_1},\alert<35-36>{\lambda},\hfill \alert<35-36>{1}0)$\\
    \pause
    $\alert<35-36>{\vdash}$ $(\alert<27-29,30-32,35-36,37-38>{q_2},\alert<37-38>{\lambda},\hfill \alert<37-38>{0})$\\
    \pause
    $\alert<37-38>{\vdash}$ $(\alert<25-27,37-38>{q_3},\lambda,\hfill \lambda)$
  \end{minipage}
  \pause
  
  \begin{exampleblock}{}
    \vspace{-1ex}\begin{malign}
      \alert<25-27>{(q_0\,0\,q_3)}
        & 
        \mpause[1]{\stackrel{\mpause[2]{1}}{\Rightarrow} \underline{a\,\alert<28-29>{(q_1\,1\,\mpause[2]{q_2})}\,(\mpause[2]{q_2}\,0\,q_3)}}
        \mpause[3]{\stackrel{\mpause[4]{3}}{\Rightarrow} a\mpause[4]{\underline{c\,\alert<30-32>{(q_0\,1\,q_2)}}}\,(q_2\,0\,q_3) \\[-.75ex]&} 
        \mpause[5]{\stackrel{\mpause[7]{2}}{\Rightarrow} ac\mpause[6]{\underline{c\, \alert<33-34>{(q_1\,1\,\mpause[7]{q_1})}\,(\mpause[7]{q_1}\,1\,q_2)}}\,(q_2\,0\,q_3) \\[-.75ex]&} 
        \mpause[9]{\stackrel{\mpause[9]{4}}{\Rightarrow} acc\underline{b}\,\alert<35-36>{(q_1\,1\,q_2)}\,(q_2\,0\,q_3)} 
        \mpause[11]{\stackrel{\mpause[11]{6}}{\Rightarrow} accb\,\alert<37-38>{(q_2\,0\,q_3)}} 
        \mpause[13]{\stackrel{8}{\Rightarrow} accb} 
    \end{malign}\vspace{-2ex}
  \end{exampleblock}
  \mpause{}
  \bigskip
\end{frame}