slides/slides07.tex
changeset 173 7cfb7a6f7c99
parent 93 4794759139ea
child 184 2e9134d25a2b
equal deleted inserted replaced
172:47b5c91eff47 173:7cfb7a6f7c99
     1 \documentclass[dvipsnames,14pt,t]{beamer}
     1 \documentclass[dvipsnames,14pt,t]{beamer}
     2 \usepackage{beamerthemeplainculight}
     2 \usepackage{beamerthemeplaincu}
     3 \usepackage[T1]{fontenc}
     3 %\usepackage[T1]{fontenc}
     4 \usepackage[latin1]{inputenc}
     4 %\usepackage[latin1]{inputenc}
     5 \usepackage{mathpartir}
     5 \usepackage{mathpartir}
     6 \usepackage[absolute,overlay]{textpos}
     6 \usepackage[absolute,overlay]{textpos}
     7 \usepackage{ifthen}
     7 \usepackage{ifthen}
     8 \usepackage{tikz}
     8 \usepackage{tikz}
     9 \usepackage{pgf}
     9 \usepackage{pgf}
    70 	tabsize=2,
    70 	tabsize=2,
    71 	showspaces=false,
    71 	showspaces=false,
    72 	showstringspaces=false}
    72 	showstringspaces=false}
    73 
    73 
    74 % beamer stuff 
    74 % beamer stuff 
    75 \renewcommand{\slidecaption}{AFL 07, King's College London, 14.~November 2012}
    75 \renewcommand{\slidecaption}{AFL 07, King's College London, 13.~November 2013}
    76 \newcommand{\bl}[1]{\textcolor{blue}{#1}}       
    76 \newcommand{\bl}[1]{\textcolor{blue}{#1}}       
    77 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
    77 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
    78 
    78 
    79 
    79 
    80 % The data files, written on the first run.
    80 % The data files, written on the first run.
   236 
   236 
   237   \normalsize
   237   \normalsize
   238   \begin{center}
   238   \begin{center}
   239   \begin{tabular}{ll}
   239   \begin{tabular}{ll}
   240   Email:  & christian.urban at kcl.ac.uk\\
   240   Email:  & christian.urban at kcl.ac.uk\\
   241   Of$\!$fice: & S1.27 (1st floor Strand Building)\\
   241   Office: & S1.27 (1st floor Strand Building)\\
   242   Slides: & KEATS (also home work is there)\\
   242   Slides: & KEATS (also home work is there)\\
   243   \end{tabular}
   243   \end{tabular}
   244   \end{center}
   244   \end{center}
   245 
   245 
   246 
   246 
   247 \end{frame}}
   247 \end{frame}}
   248  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   248  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   249 
       
   250 
       
   251 
       
   252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   253 \mode<presentation>{
       
   254 \begin{frame}[t]
       
   255 \frametitle{\begin{tabular}{c}\bl{$(a?\{n\})a\{n\}$}\end{tabular}}
       
   256 
       
   257 \mbox{}\\[-13mm]
       
   258 
       
   259 \begin{tikzpicture}[y=.2cm, x=.3cm]
       
   260  	%axis
       
   261 	\draw (0,0) -- coordinate (x axis mid) (30,0);
       
   262     	\draw (0,0) -- coordinate (y axis mid) (0,30);
       
   263     	%ticks
       
   264     	\foreach \x in {0,5,...,30}
       
   265      		\draw (\x,1pt) -- (\x,-3pt)
       
   266 			node[anchor=north] {\x};
       
   267     	\foreach \y in {0,5,...,30}
       
   268      		\draw (1pt,\y) -- (-3pt,\y) 
       
   269      			node[anchor=east] {\y}; 
       
   270 	%labels      
       
   271 	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
       
   272 	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
       
   273 
       
   274 	%plots
       
   275 	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
       
   276 		file {re-python.data};
       
   277 	\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
       
   278 		file {re1.data};
       
   279          \draw[color=green] plot[mark=square*, mark options={fill=white} ] 
       
   280 		file {re2.data};
       
   281          \draw[color=brown] plot[mark=pentagon*, mark options={fill=white} ] 
       
   282 		file {re-ruby.data};
       
   283     
       
   284 	%legend
       
   285 	\begin{scope}[shift={(4,20)}] 
       
   286 	\draw[color=blue] (0,0) -- 
       
   287 		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) 
       
   288 		node[right]{\small Python};
       
   289 	\draw[yshift=-\baselineskip, color=brown] (0,0) -- 
       
   290 		plot[mark=pentagon*, mark options={fill=white}] (0.25,0) -- (0.5,0)
       
   291 		node[right]{\small Ruby (Daniel Baldwin)};
       
   292          \draw[yshift=\baselineskip, color=red] (0,0) -- 
       
   293 		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
       
   294 		node[right]{\small Scala V1};	
       
   295 	 \draw[yshift=2\baselineskip, color=green] (0,0) -- 
       
   296 		plot[mark=square*, mark options={fill=white}] (0.25,0) -- (0.5,0)
       
   297 		node[right]{\small Scala V2 with simplifications};
       
   298 	\end{scope}
       
   299 \end{tikzpicture}
       
   300 
       
   301 \end{frame}}
       
   302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   303 
       
   304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   305 \mode<presentation>{
       
   306 \begin{frame}[t]
       
   307 
       
   308 \begin{tikzpicture}[y=.7cm, x=.0009cm]
       
   309  	%axis
       
   310 	\draw (0,0) -- coordinate (x axis mid) (10000,0);
       
   311     	\draw (0,0) -- coordinate (y axis mid) (0,6);
       
   312     	%ticks
       
   313     	\foreach \x in {0,2000,...,10000}
       
   314      		\draw (\x,1pt) -- (\x,-3pt)
       
   315 			node[anchor=north] {\x};
       
   316     	\foreach \y in {0,1,...,6}
       
   317      		\draw (1pt,\y) -- (-3pt,\y) 
       
   318      			node[anchor=east] {\y}; 
       
   319 	%labels      
       
   320 	\node[below=0.6cm] at (x axis mid) {\bl{a}s};
       
   321 	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
       
   322 
       
   323 	%plots
       
   324 	\draw[color=blue] plot[mark=*, mark options={fill=white}] 
       
   325 		file {re-internal.data};
       
   326 	\only<1->{	 
       
   327          \draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
       
   328 		file {re3.data};}
       
   329     
       
   330 	%legend
       
   331 	\begin{scope}[shift={(2000,4)}] 
       
   332 	\draw[color=blue] (0,0) -- 
       
   333 		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) 
       
   334 		node[right]{\small Scala Internal};
       
   335         \only<1->{
       
   336 	\draw[yshift=\baselineskip, color=red] (0,0) -- 
       
   337 		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
       
   338 		node[right]{\small Scala V3 with explicit $\_\{\_\}$};}
       
   339 	\end{scope}
       
   340 \end{tikzpicture}
       
   341 
       
   342 \begin{center}
       
   343 \begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}}
       
   344   \\[-8mm]
       
   345   \bl{der c (r$_1$ $\cdot$ r$_2$)} & \bl{$\dn$}  & \bl{if nullable r$_1$}\\
       
   346   & & \bl{then ((der c r$_1$) $\cdot$ r$_2$) + (der c r$_2$)}\\ 
       
   347   & & \bl{else (der c r$_1$) $\cdot$ r$_2$}\\
       
   348   \bl{der c (r$\{n\}$)} & \bl{$\dn$} & \bl{if $n = 0$ then $\varnothing$}\\
       
   349   & & \bl{else (der c r) $\cdot$ r$\{n - 1\}$}
       
   350   \end{tabular}
       
   351 \end{center}
       
   352 
       
   353 \end{frame}}
       
   354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   355 
       
   356 
   249 
   357 
   250 
   358 \newcommand{\qq}{\mbox{\texttt{"}}}
   251 \newcommand{\qq}{\mbox{\texttt{"}}}
   359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   360 \mode<presentation>{
   253 \mode<presentation>{