slides/slides05.tex
changeset 582 d236e75e1d55
parent 550 71fc4a7a7039
child 583 200d2a3eb1b1
--- a/slides/slides05.tex	Tue Oct 16 14:40:30 2018 +0100
+++ b/slides/slides05.tex	Mon Oct 22 23:37:11 2018 +0100
@@ -1,3 +1,4 @@
+
 \documentclass[dvipsnames,14pt,t]{beamer}
 \usepackage{../slides}
 \usepackage{../graphics}
@@ -30,7 +31,7 @@
   \begin{center}
   \begin{tabular}{ll}
   Email:  & christian.urban at kcl.ac.uk\\
-  Office: & N7.07 (North Wing, Bush House)\\
+  Office: & N\liningnums{7.07} (North Wing, Bush House)\\
   Slides: & KEATS (also home work is there)\\
   \end{tabular}
   \end{center}
@@ -371,6 +372,29 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{frame}[c]
+\frametitle{Coursework: PLs (16)}
+
+\begin{itemize}
+\item Java (16)
+\item C++, C, C\# (14)
+\item JavaScript (10)
+\item Scala (9)
+\item Python (9)  
+\item PHP (6)
+\item Haskell (3)
+\item Ruby (4)
+\item Bash, Perl, Powershell (2)
+\item TypeScript (1)
+\item R (1)
+\item Coconut (1)  
+\item Pascal (1)
+\end{itemize}  
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
 \frametitle{Coursework: Nullable}
 
 \begin{center}
@@ -400,18 +424,18 @@
   \bl{$der\, c\, (r^+)$}                   & \bl{$\dn$} & $?$\\
   \bl{$der\, c\, (r^?)$}                   & \bl{$\dn$} & $?$\\
   \bl{$der\, c\, (r^{\{n\}})$}              & \bl{$\dn$} &
-     \bl{$if\;n=0\;then\;\ZERO\;else\;(der\,c\,r)\cdot r^{\{n-1\}}$}\\
+     \bl{$if\;n=0\;then\;\ZERO\;else\;(der\,c\,r)\cdot r^{\{n-\liningnums{1}\}}$}\\
   \bl{$der\, c\, (r^{\{n..\}})$}            & \bl{$\dn$} &
      \bl{$if\;n=0\;then (der\,c\,r)\cdot r^*$}\\
-  & & \bl{$\phantom{if\;n=0\;}else \;(der\,c\,r)\cdot r^{\{n-1..\}}$}\\
+  & & \bl{$\phantom{if\;n=0\;}else \;(der\,c\,r)\cdot r^{\{n-\liningnums{1}..\}}$}\\
   \bl{$der\, c\, (r^{\{..n\}})$}            & \bl{$\dn$} &
-     \bl{$if\;n=0\;then\;\ZERO\;else\;(der\,c\,r)\cdot r^{\{..n-1\}}$}\\
+     \bl{$if\;n=0\;then\;\ZERO\;else\;(der\,c\,r)\cdot r^{\{..n-\liningnums{1}\}}$}\\
   
   \bl{$der\, c\, (r^{\{n..m\}})$}          & \bl{$\dn$} &
      \bl{$if\;n = 0 \wedge m = 0\;then\;\ZERO\; else$}\\
-  \multicolumn{3}{l}{\bl{$if\;n = 0 \wedge m > 0\;then\;(der\,c\,r)\cdot r^{\{..m-1\}}$}}\\
+  \multicolumn{3}{l}{\bl{$if\;n = 0 \wedge m > 0\;then\;(der\,c\,r)\cdot r^{\{..m-\liningnums{1}\}}$}}\\
   \multicolumn{3}{l}{\bl{$\phantom{if\;n = 0 \wedge m > 0\;}else
-          \;(der\,c\,r)\cdot r^{\{n-1..m-1\}}$}}\\
+          \;(der\,c\,r)\cdot r^{\{n-\liningnums{1}..m-\liningnums{1}\}}$}}\\
   \bl{$der\, c\, (\sim{}r)$}              & \bl{$\dn$} & $?$\\
 \end{tabular}
 \end{center}
@@ -436,7 +460,7 @@
 
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+ 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{frame}[t]
 \frametitle{Lexer, Parser}
@@ -568,7 +592,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[c]
+\begin{frame}[t]
 \frametitle{Palindromes}
 
 A grammar for palindromes over the alphabet~\bl{$\{a,b\}$}:
@@ -616,7 +640,7 @@
 \item Begin with a string containing only the start symbol, say \bl{\meta{S}}\bigskip
 \item Replace any nonterminal \bl{\meta{X}} in the string by the
 right-hand side of some production \bl{$\meta{X} ::= \textit{rhs}$}\bigskip
-\item Repeat 2 until there are no nonterminals
+\item Repeat 2 until there are no nonterminals left
 \end{enumerate}
 
 \begin{center}
@@ -726,7 +750,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{frame}[t]
 \frametitle{Parse Trees}
-\mbox{}\\[-16mm]
+\mbox{}\\[-12mm]
 
 \bl{\begin{plstx}: \meta{E} ::= \meta{F} | \meta{T} \cdot + \cdot \meta{E} |  \meta{T} \cdot - \cdot \meta{E}\\
 : \meta{T} ::= \meta{F} | \meta{F} \cdot * \cdot \meta{T}\\
@@ -805,7 +829,7 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{frame}[c]
-\frametitle{Dangling Else}
+\frametitle{`Dangling' Else}
 
 Another ambiguous grammar:\bigskip
 
@@ -938,19 +962,19 @@
 Addition
 
 \begin{center}
-\bl{$T \sim + \sim E \Rightarrow \underbrace{f((x,y), z) \Rightarrow x + z}_{\text{semantic action}}$}
+\bl{$\meta{T} \sim + \sim \meta{E} \Rightarrow \underbrace{f\,((x,y), z) \Rightarrow x + z}_{\text{semantic action}}$}
 \end{center}\pause
 
 Multiplication
 
 \begin{center}
-\bl{$F \sim * \sim T \Rightarrow f((x,y), z) \Rightarrow x * z$}
+\bl{$\meta{F} \sim * \sim \meta{T} \Rightarrow f\,((x,y), z) \Rightarrow x * z$}
 \end{center}\pause
 
 Parenthesis
 
 \begin{center}
-\bl{$\text{(} \sim E \sim \text{)} \Rightarrow f((x,y), z) \Rightarrow y$}
+\bl{$\text{(} \sim \meta{E} \sim \text{)} \Rightarrow f\,((x,y), z) \Rightarrow y$}
 \end{center}
 
 \end{frame}}
@@ -1062,14 +1086,14 @@
 
 \begin{center}
 \bl{\begin{tabular}{lcl}
-$S$ & $\rightarrow$ &  $1 \cdot S \cdot S$\\
+$\meta{S}$ & $\rightarrow$ &  $1 \cdot \meta{S} \cdot \meta{S}$\\
         & $|$ & $\epsilon$
 \end{tabular}}
 \end{center}\bigskip
 
 \begin{center}
 \bl{\begin{tabular}{lcl}
-$U$ & $\rightarrow$ &  $1 \cdot U$\\
+$\meta{U}$ & $\rightarrow$ &  $1 \cdot \meta{U}$\\
         & $|$ & $\epsilon$
 \end{tabular}}
 \end{center}
@@ -1199,7 +1223,7 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \begin{frame}[c]
-\frametitle{\begin{tabular}{c}Test Program\end{tabular}}
+\frametitle{Test Program}
 
 \mbox{}\\[-18mm]\mbox{}