diff -r 0874de7bdbd8 -r 0cb2464e5d0e slides06.tex --- a/slides06.tex Wed Oct 31 08:42:14 2012 +0000 +++ b/slides06.tex Wed Oct 31 08:56:08 2012 +0000 @@ -376,7 +376,7 @@ \begin{frame}[c] \frametitle{\begin{tabular}{c}Grammars\end{tabular}} -A (context-free) Grammar \bl{$G$} consists of +A (context-free) grammar \bl{$G$} consists of \begin{itemize} \item a finite set of nonterminal symbols (upper case) @@ -407,8 +407,8 @@ \begin{center} \bl{\begin{tabular}{lcl} $S$ & $\rightarrow$ & $\epsilon$ \\ -$S$ & $\rightarrow$ & $aSa$ \\ -$S$ & $\rightarrow$ & $bSb$ \\ +$S$ & $\rightarrow$ & $a\cdot S\cdot a$ \\ +$S$ & $\rightarrow$ & $b\cdot S\cdot b$ \\ \end{tabular}} \end{center}\pause @@ -416,7 +416,7 @@ \begin{center} \bl{\begin{tabular}{lcl} -$S$ & $\rightarrow$ & $\epsilon \;|\; aSa \;|\;bSb$ \\ +$S$ & $\rightarrow$ & $\epsilon \;|\; a\cdot S\cdot a \;|\;b\cdot S\cdot b$ \\ \end{tabular}} \end{center} @@ -434,10 +434,10 @@ \begin{center} \bl{\begin{tabular}{lcl} $E$ & $\rightarrow$ & $num\_token$ \\ -$E$ & $\rightarrow$ & $E + E$ \\ -$E$ & $\rightarrow$ & $E - E$ \\ -$E$ & $\rightarrow$ & $E * E$ \\ -$E$ & $\rightarrow$ & $( E )$ +$E$ & $\rightarrow$ & $E \cdot + \cdot E$ \\ +$E$ & $\rightarrow$ & $E \cdot - \cdot E$ \\ +$E$ & $\rightarrow$ & $E \cdot * \cdot E$ \\ +$E$ & $\rightarrow$ & $( \cdot E \cdot )$ \end{tabular}} \end{center}\pause @@ -454,9 +454,9 @@ \begin{center} \bl{\begin{tabular}{lcl} -$E$ & $\rightarrow$ & $F \;|\; F * F$\\ -$F$ & $\rightarrow$ & $T \;|\; T + T \;|\; T - T$\\ -$T$ & $\rightarrow$ & $num\_token \;|\; ( E )$\\ +$E$ & $\rightarrow$ & $F \;|\; F \cdot * \cdot F$\\ +$F$ & $\rightarrow$ & $T \;|\; T \cdot + \cdot T \;|\; T \cdot - \cdot T$\\ +$T$ & $\rightarrow$ & $num\_token \;|\; ( \cdot E \cdot )$\\ \end{tabular}} \end{center} @@ -502,10 +502,10 @@ \begin{center} \bl{\begin{tabular}{lcl} $E$ & $\rightarrow$ & $num\_token$ \\ -$E$ & $\rightarrow$ & $E + E$ \\ -$E$ & $\rightarrow$ & $E - E$ \\ -$E$ & $\rightarrow$ & $E * E$ \\ -$E$ & $\rightarrow$ & $( E )$ +$E$ & $\rightarrow$ & $E \cdot + \cdot E$ \\ +$E$ & $\rightarrow$ & $E \cdot - \cdot E$ \\ +$E$ & $\rightarrow$ & $E \cdot * \cdot E$ \\ +$E$ & $\rightarrow$ & $( \cdot E \cdot )$ \end{tabular}} \end{center} @@ -529,14 +529,33 @@ or \begin{center} -\bl{$A \rightarrow BC$} +\bl{$A \rightarrow B\cdot C$} \end{center} \end{frame}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\mode{ +\begin{frame}[c] +\frametitle{\begin{tabular}{c}CYK Algorithm\end{tabular}} + +\begin{center} +\bl{\begin{tabular}{@ {}lcl} +$S$ & $\rightarrow$ & $N\cdot P$ \\ +$P$ & $\rightarrow$ & $V\cdot N$ \\ +$N$ & $\rightarrow$ & $N\cdot N$ \\ +$N$ & $\rightarrow$ & $\texttt{students} \;|\; \texttt{Jeff} \;|\; \texttt{geometry} \;|\; \texttt{trains} $ \\ +$E$ & $\rightarrow$ & $\texttt{trains}$ +\end{tabular}} +\end{center} + +\bl{\texttt{Jeff trains geometry students}} + +\end{frame}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \mode{ \begin{frame}[c]