updated
authorChristian Urban <christian.urban@kcl.ac.uk>
Wed, 21 Oct 2020 09:24:32 +0100
changeset 785 faa4489267d5
parent 784 7dac4492b0e6
child 786 da2488db453e
updated
slides/slides04.pdf
slides/slides04.tex
Binary file slides/slides04.pdf has changed
--- a/slides/slides04.tex	Mon Oct 19 17:50:11 2020 +0100
+++ b/slides/slides04.tex	Wed Oct 21 09:24:32 2020 +0100
@@ -61,48 +61,48 @@
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[c]
-\frametitle{Coursework}
-
-\begin{itemize}
-\item \bl{$\der\,c\,(r^+) \dn \der\,c (r\cdot r^*)$}\quad given
-that \bl{$r^+ \dn r\cdot r^*$}
-\end{itemize}\bigskip\pause
+%\begin{frame}[c]
+%\frametitle{Coursework}
+%
+%\begin{itemize}
+%\item \bl{$\der\,c\,(r^+) \dn \der\,c (r\cdot r^*)$}\quad given
+%that \bl{$r^+ \dn r\cdot r^*$}
+%\end{itemize}\bigskip\pause
 
-\begin{center}
-\begin{tabular}{lcl}
-\bl{$\der\,c\,(r\cdot r^*)$} & \bl{$\dn$} & 
-\only<2-4>{if \bl{$nullable\,r$}}%
-\only<5>{\bl{$(\der\,c\,r)\cdot r^*$}}\\
- & & 
- \only<2>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, \der\,c\,(r^*)$}}%
- \only<3>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, (\der\,c\,r)\cdot r^*$}}%
- \only<4>{then \bl{$(\der\,c\,r)\cdot r^*$}}\\
- & & \only<2-4>{else \bl{$(\der\,c\,r)\cdot r^*$}}
-\end{tabular}  
-\end{center}  
-\end{frame}
+%\begin{center}
+%\begin{tabular}{lcl}
+%\bl{$\der\,c\,(r\cdot r^*)$} & \bl{$\dn$} & 
+%\only<2-4>{if \bl{$nullable\,r$}}%
+%\only<5>{\bl{$(\der\,c\,r)\cdot r^*$}}\\
+% & & 
+% \only<2>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, \der\,c\,(r^*)$}}%
+% \only<3>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, (\der\,c\,r)\cdot r^*$}}%
+% \only<4>{then \bl{$(\der\,c\,r)\cdot r^*$}}\\
+% & & \only<2-4>{else \bl{$(\der\,c\,r)\cdot r^*$}}
+%\end{tabular}  
+%\end{center}  
+%\end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{frame}[c]
-  \frametitle{Coursework (2)}
-  
-  \begin{itemize}
-  \item \bl{\texttt{CFUN(f: Char => Boolean)}}
-  \end{itemize}\medskip
-
-  \begin{center}
-  \begin{tabular}{l}
-  \bl{\texttt{CHAR(c: Char)}} \bl{$\dn$}\\
-     \quad\bl{\texttt{CFUN(\_ == c)}}\medskip\\
-  \bl{\texttt{RANGE(cs: Set[Char])}} \bl{$\dn$}\\
-     \quad\bl{\texttt{CFUN(cs.contains(\_))}}\medskip\\
-  \bl{\texttt{ALL}} \bl{$\dn$}\\
-     \quad\bl{\texttt{CFUN((c: Char) => true)}}\\
-  \end{tabular}  
-  \end{center}  
-\end{frame}
+%\begin{frame}[c]
+%  \frametitle{Coursework (2)}
+%  
+%  \begin{itemize}
+%  \item \bl{\texttt{CFUN(f: Char => Boolean)}}
+%  \end{itemize}\medskip
+%
+%  \begin{center}
+%  \begin{tabular}{l}
+%  \bl{\texttt{CHAR(c: Char)}} \bl{$\dn$}\\
+%     \quad\bl{\texttt{CFUN(\_ == c)}}\medskip\\
+%  \bl{\texttt{RANGE(cs: Set[Char])}} \bl{$\dn$}\\
+%     \quad\bl{\texttt{CFUN(cs.contains(\_))}}\medskip\\
+%  \bl{\texttt{ALL}} \bl{$\dn$}\\
+%     \quad\bl{\texttt{CFUN((c: Char) => true)}}\\
+%  \end{tabular}  
+%  \end{center}  
+%\end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
      
 
@@ -177,7 +177,7 @@
 \begin{frame}[c]
 \frametitle{Lexing: Test Case}
 
-??%\mbox{\lstinputlisting[language=While]{../progs/fib.while}}
+\mbox{\lstinputlisting[language=While]{../progs/while-tests/fib.while}}
 
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
@@ -296,7 +296,7 @@
 letters followed by ``letters + numbers + \_''$^*$
 
 \[
-\bl{if}\qquad\bl{iffoo}
+\bl{\texttt{if}}\qquad\bl{\texttt{iffoo}}
 \]
 
 \end{frame}
@@ -581,6 +581,28 @@
   
   \end{frame}
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+  \frametitle{Inject}
+\large
+
+  \begin{center}
+\begin{tikzpicture}[scale=3,node distance=1.2cm,
+                    every node/.style={minimum size=7mm}]
+\node (r)  {$r$};
+\node (rd) [right=of r]{$r_{der}$};
+\draw[->,line width=1mm](r)--(rd) node[above,midway] {$\der\,c$};
+\node (vd) [below=of r2]{$v_{der}$};
+\draw[->,line width=1mm](rd) -- (vd);
+\node (v) [left=of vd] {$v$};
+\draw[->,line width=1mm](vd)--(v) node[below,midway] {$inj\,c$};
+\draw[->,line width=0.5mm,dotted](r) -- (v) node[left,midway,red] {\bf ?};
+\end{tikzpicture}
+\end{center}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   \begin{frame}[c]