slides/slides04.tex
changeset 785 faa4489267d5
parent 743 6acabeecdf75
child 786 da2488db453e
equal deleted inserted replaced
784:7dac4492b0e6 785:faa4489267d5
    59 \end{frame}
    59 \end{frame}
    60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    61 
    61 
    62 
    62 
    63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    64 \begin{frame}[c]
    64 %\begin{frame}[c]
    65 \frametitle{Coursework}
    65 %\frametitle{Coursework}
    66 
    66 %
    67 \begin{itemize}
    67 %\begin{itemize}
    68 \item \bl{$\der\,c\,(r^+) \dn \der\,c (r\cdot r^*)$}\quad given
    68 %\item \bl{$\der\,c\,(r^+) \dn \der\,c (r\cdot r^*)$}\quad given
    69 that \bl{$r^+ \dn r\cdot r^*$}
    69 %that \bl{$r^+ \dn r\cdot r^*$}
    70 \end{itemize}\bigskip\pause
    70 %\end{itemize}\bigskip\pause
    71 
    71 
    72 \begin{center}
    72 %\begin{center}
    73 \begin{tabular}{lcl}
    73 %\begin{tabular}{lcl}
    74 \bl{$\der\,c\,(r\cdot r^*)$} & \bl{$\dn$} & 
    74 %\bl{$\der\,c\,(r\cdot r^*)$} & \bl{$\dn$} & 
    75 \only<2-4>{if \bl{$nullable\,r$}}%
    75 %\only<2-4>{if \bl{$nullable\,r$}}%
    76 \only<5>{\bl{$(\der\,c\,r)\cdot r^*$}}\\
    76 %\only<5>{\bl{$(\der\,c\,r)\cdot r^*$}}\\
    77  & & 
    77 % & & 
    78  \only<2>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, \der\,c\,(r^*)$}}%
    78 % \only<2>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, \der\,c\,(r^*)$}}%
    79  \only<3>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, (\der\,c\,r)\cdot r^*$}}%
    79 % \only<3>{then \bl{$(\der\,c\,r)\cdot r^* \,+\, (\der\,c\,r)\cdot r^*$}}%
    80  \only<4>{then \bl{$(\der\,c\,r)\cdot r^*$}}\\
    80 % \only<4>{then \bl{$(\der\,c\,r)\cdot r^*$}}\\
    81  & & \only<2-4>{else \bl{$(\der\,c\,r)\cdot r^*$}}
    81 % & & \only<2-4>{else \bl{$(\der\,c\,r)\cdot r^*$}}
    82 \end{tabular}  
    82 %\end{tabular}  
    83 \end{center}  
    83 %\end{center}  
    84 \end{frame}
    84 %\end{frame}
    85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
    85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
    86 
    86 
    87 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    87 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    88 \begin{frame}[c]
    88 %\begin{frame}[c]
    89   \frametitle{Coursework (2)}
    89 %  \frametitle{Coursework (2)}
    90   
    90 %  
    91   \begin{itemize}
    91 %  \begin{itemize}
    92   \item \bl{\texttt{CFUN(f: Char => Boolean)}}
    92 %  \item \bl{\texttt{CFUN(f: Char => Boolean)}}
    93   \end{itemize}\medskip
    93 %  \end{itemize}\medskip
    94 
    94 %
    95   \begin{center}
    95 %  \begin{center}
    96   \begin{tabular}{l}
    96 %  \begin{tabular}{l}
    97   \bl{\texttt{CHAR(c: Char)}} \bl{$\dn$}\\
    97 %  \bl{\texttt{CHAR(c: Char)}} \bl{$\dn$}\\
    98      \quad\bl{\texttt{CFUN(\_ == c)}}\medskip\\
    98 %     \quad\bl{\texttt{CFUN(\_ == c)}}\medskip\\
    99   \bl{\texttt{RANGE(cs: Set[Char])}} \bl{$\dn$}\\
    99 %  \bl{\texttt{RANGE(cs: Set[Char])}} \bl{$\dn$}\\
   100      \quad\bl{\texttt{CFUN(cs.contains(\_))}}\medskip\\
   100 %     \quad\bl{\texttt{CFUN(cs.contains(\_))}}\medskip\\
   101   \bl{\texttt{ALL}} \bl{$\dn$}\\
   101 %  \bl{\texttt{ALL}} \bl{$\dn$}\\
   102      \quad\bl{\texttt{CFUN((c: Char) => true)}}\\
   102 %     \quad\bl{\texttt{CFUN((c: Char) => true)}}\\
   103   \end{tabular}  
   103 %  \end{tabular}  
   104   \end{center}  
   104 %  \end{center}  
   105 \end{frame}
   105 %\end{frame}
   106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   107      
   107      
   108 
   108 
   109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   110 \begin{frame}[c]
   110 \begin{frame}[c]
   175 
   175 
   176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   177 \begin{frame}[c]
   177 \begin{frame}[c]
   178 \frametitle{Lexing: Test Case}
   178 \frametitle{Lexing: Test Case}
   179 
   179 
   180 ??%\mbox{\lstinputlisting[language=While]{../progs/fib.while}}
   180 \mbox{\lstinputlisting[language=While]{../progs/while-tests/fib.while}}
   181 
   181 
   182 \end{frame}
   182 \end{frame}
   183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   184 
   184 
   185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   294 
   294 
   295 Or, keywords are \code{if} etc and identifiers are 
   295 Or, keywords are \code{if} etc and identifiers are 
   296 letters followed by ``letters + numbers + \_''$^*$
   296 letters followed by ``letters + numbers + \_''$^*$
   297 
   297 
   298 \[
   298 \[
   299 \bl{if}\qquad\bl{iffoo}
   299 \bl{\texttt{if}}\qquad\bl{\texttt{iffoo}}
   300 \]
   300 \]
   301 
   301 
   302 \end{frame}
   302 \end{frame}
   303 
   303 
   304 
   304 
   579   \end{tabular}
   579   \end{tabular}
   580   \end{center}
   580   \end{center}
   581   
   581   
   582   \end{frame}
   582   \end{frame}
   583   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   583   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   584 
       
   585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   586 \begin{frame}[c]
       
   587   \frametitle{Inject}
       
   588 \large
       
   589 
       
   590   \begin{center}
       
   591 \begin{tikzpicture}[scale=3,node distance=1.2cm,
       
   592                     every node/.style={minimum size=7mm}]
       
   593 \node (r)  {$r$};
       
   594 \node (rd) [right=of r]{$r_{der}$};
       
   595 \draw[->,line width=1mm](r)--(rd) node[above,midway] {$\der\,c$};
       
   596 \node (vd) [below=of r2]{$v_{der}$};
       
   597 \draw[->,line width=1mm](rd) -- (vd);
       
   598 \node (v) [left=of vd] {$v$};
       
   599 \draw[->,line width=1mm](vd)--(v) node[below,midway] {$inj\,c$};
       
   600 \draw[->,line width=0.5mm,dotted](r) -- (v) node[left,midway,red] {\bf ?};
       
   601 \end{tikzpicture}
       
   602 \end{center}
       
   603 \end{frame}
       
   604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   605 
   584   
   606   
   585   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   607   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   586   \begin{frame}[c]
   608   \begin{frame}[c]
   587   \frametitle{Inject}
   609   \frametitle{Inject}
   588   
   610