707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
708 |
708 |
709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
709 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
710 \mode<presentation>{ |
710 \mode<presentation>{ |
711 \begin{frame}[c] |
711 \begin{frame}[c] |
712 \frametitle{Rexp to NFA} |
712 \frametitle{Case $r^*$} |
713 |
713 |
714 \begin{center} |
714 \onslide<1>{By recursion we are given an automaton for $r$:\smallskip} |
715 \begin{tabular}[b]{ll} |
715 |
716 \bl{r$^*$} & \includegraphics[scale=0.7]{pics/star.jpg}\\ |
716 \begin{tikzpicture}[node distance=3mm, |
717 \end{tabular} |
717 >=stealth',very thick, every state/.style={minimum size=3pt,draw=blue!50,very thick,fill=blue!20},] |
718 \end{center}\pause\bigskip |
718 \onslide<1>{\node at (0,0) (1) {$\mbox{}$};} |
|
719 \onslide<2>{\node at (0,0) [state, initial,accepting] (1) {$\mbox{}$};} |
|
720 \only<1>{\node[state, initial] (2) [right=16mm of 1] {$\mbox{}$};} |
|
721 \only<2>{\node[state] (2) [right=16mm of 1] {$\mbox{}$};} |
|
722 \node (a) [right=of 2] {$\ldots$}; |
|
723 \only<1>{ |
|
724 \node[state, accepting] (a1) [right=of a] {$\mbox{}$}; |
|
725 \node[state, accepting] (a2) [above=of a1] {$\mbox{}$}; |
|
726 \node[state, accepting] (a3) [below=of a1] {$\mbox{}$};} |
|
727 \only<2>{ |
|
728 \node[state] (a1) [right=of a] {$\mbox{}$}; |
|
729 \node[state] (a2) [above=of a1] {$\mbox{}$}; |
|
730 \node[state] (a3) [below=of a1] {$\mbox{}$};} |
|
731 \only<2>{ |
|
732 \path[->] (1) edge node [above] {\alert{$\epsilon$}} (2); |
|
733 \path[->] (a1) edge [bend left=45] node [above] {\alert{$\epsilon$}} (1); |
|
734 \path[->] (a2) edge [bend right] node [below] {\alert{$\epsilon$}} (1); |
|
735 \path[->] (a3) edge [bend left=45] node [below] {\alert{$\epsilon$}} (1); |
|
736 |
|
737 } |
|
738 \begin{pgfonlayer}{background} |
|
739 \only<1>{\node (1) [rounded corners, inner sep=1mm, thick, draw=black!60, fill=black!20, fit= (2) (a1) (a2) (a3)] {};} |
|
740 \only<2>{\node (2) [rounded corners, inner sep=1mm, thick, draw=black!60, fill=black!20, fit= (1) (a2) (a3)] {};} |
|
741 \only<1>{\node [yshift=3mm] at (1.north) {\bl{$r$}};} |
|
742 \only<2>{\node [yshift=3mm] at (2.north) {\bl{$r^*$}};} |
|
743 \end{pgfonlayer} |
|
744 \end{tikzpicture} |
|
745 |
719 |
746 |
720 Why can't we just have an epsilon transition from the accepting states to the starting state? |
747 Why can't we just have an epsilon transition from the accepting states to the starting state? |
721 |
748 |
722 \end{frame}} |
749 \end{frame}} |
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |