slides09.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Sat, 24 Nov 2012 15:10:43 +0000
changeset 79 fd894e017e12
parent 77 49c0beef79a1
child 80 191daa3ee29e
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
\usepackage{beamerthemeplainculight}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
\usepackage[T1]{fontenc}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
\usepackage[latin1]{inputenc}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
\usepackage{mathpartir}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
\usepackage{ifthen}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
\usepackage{tikz}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
\usepackage{pgf}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
\usepackage{calc} 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
\usepackage{ulem}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
\usepackage{courier}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
\usepackage{listings}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
\usetikzlibrary{automata}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
\usetikzlibrary{calc}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
\usetikzlibrary{plotmarks}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
\usepackage{graphicx} 
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    23
\usepackage{pgfplots}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    24
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
\definecolor{javared}{rgb}{0.6,0,0} % for strings
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
\lstset{language=Java,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
	basicstyle=\ttfamily,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
	stringstyle=\color{javagreen},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
	commentstyle=\color{javagreen},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
	numbers=left,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
	numberstyle=\tiny\color{black},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
	stepnumber=1,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
	numbersep=10pt,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
	tabsize=2,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
	showspaces=false,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
	showstringspaces=false}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
\lstdefinelanguage{scala}{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
  morekeywords={abstract,case,catch,class,def,%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
    do,else,extends,false,final,finally,%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
    for,if,implicit,import,match,mixin,%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
    new,null,object,override,package,%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
    private,protected,requires,return,sealed,%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
    super,this,throw,trait,true,try,%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
    type,val,var,while,with,yield},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
  sensitive=true,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
  morecomment=[l]{//},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
  morecomment=[n]{/*}{*/},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
  morestring=[b]",
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
  morestring=[b]',
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
  morestring=[b]"""
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    62
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
\lstset{language=Scala,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
	basicstyle=\ttfamily,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
	stringstyle=\color{javagreen},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
	commentstyle=\color{javagreen},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
	numbers=left,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    70
	numberstyle=\tiny\color{black},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
	stepnumber=1,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
	numbersep=10pt,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
	tabsize=2,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
	showspaces=false,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    75
	showstringspaces=false}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    77
\lstdefinelanguage{while}{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    78
  morekeywords={if,then,else,while,do,true,false},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    79
  otherkeywords={=,!=,:=,<,>},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    80
  sensitive=true,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    81
  morecomment=[n]{/*}{*/},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    82
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    83
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    84
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    85
\lstset{language=While,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    86
	basicstyle=\ttfamily,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    87
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    88
	stringstyle=\color{javagreen},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    89
	commentstyle=\color{javagreen},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    90
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    91
	numbers=left,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    92
	numberstyle=\tiny\color{black},
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    93
	stepnumber=1,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    94
	numbersep=10pt,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    95
	tabsize=2,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    96
	showspaces=false,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    97
	showstringspaces=false}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    98
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
    99
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
% beamer stuff 
76
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   101
\renewcommand{\slidecaption}{AFL 09, King's College London, 28.~November 2012}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
% The data files, written on the first run.
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   107
\begin{filecontents}{compiled.data}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   108
1 0.0207
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   109
5000 0.0217
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   110
10000 0.0297
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   111
50000 0.1034
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   112
100000 0.3873
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   113
500000 1.27949
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   114
1000000 5. 35424
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   115
\end{filecontents}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   116
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   117
\begin{filecontents}{interpreted.data}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   118
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   119
\end{filecontents}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   121
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   122
\begin{document}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   123
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   124
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   125
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   126
\begin{frame}<1>[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   127
\frametitle{%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   128
  \begin{tabular}{@ {}c@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   129
  \\[-3mm]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   130
  \LARGE Automata and \\[-2mm] 
76
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 70
diff changeset
   131
  \LARGE Formal Languages (9)\\[3mm] 
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   132
  \end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   133
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   134
  \normalsize
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   135
  \begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   136
  \begin{tabular}{ll}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   137
  Email:  & christian.urban at kcl.ac.uk\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   138
  Of$\!$fice: & S1.27 (1st floor Strand Building)\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   139
  Slides: & KEATS (also home work is there)\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   140
  \end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   141
  \end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   142
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   143
\end{frame}}
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   144
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   145
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   146
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   147
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   148
\begin{frame}[c]
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   149
\frametitle{\begin{tabular}{c}While-Language\end{tabular}}
66
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   150
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   151
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   152
\begin{center}
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   153
\bl{\begin{tabular}{@{}lcl@{}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   154
$Stmt$ & $\rightarrow$ &  $\text{skip}$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   155
              & $|$ & $Id := AExp$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   156
              & $|$ & $\text{if}\; B\!Exp \;\text{then}\; Block \;\text{else}\; Block$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   157
              & $|$ & $\text{while}\; B\!Exp \;\text{do}\; Block$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   158
               & $|$ & $\alert{\text{write}\; Id}$\medskip\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   159
$Stmts$ & $\rightarrow$ &  $Stmt \;\text{;}\; Stmts$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   160
              & $|$ & $Stmt$\medskip\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   161
$Block$ & $\rightarrow$ &  $\{ Stmts \}$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   162
                & $|$ & $Stmt$\medskip\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   163
$AExp$ & $\rightarrow$ & \ldots\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   164
$BExp$ & $\rightarrow$ & \ldots\\
66
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   165
\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   166
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   167
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   168
66
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   169
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   170
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   171
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   172
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   173
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   174
\begin{frame}[c]
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   175
\frametitle{\begin{tabular}{c}Fibonacci Numbers\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   176
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   177
\mbox{}\\[-18mm]\mbox{}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   178
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   179
{\lstset{language=While}\fontsize{10}{12}\selectfont
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   180
\texttt{\lstinputlisting{app9.while}}}
66
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   181
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   182
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   183
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   184
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   185
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   186
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   187
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   188
\frametitle{\begin{tabular}{c}Interpreter\end{tabular}}
66
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   189
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   190
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   191
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   192
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   193
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 65
diff changeset
   194
70
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 69
diff changeset
   195
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 69
diff changeset
   196
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 69
diff changeset
   197
\mode<presentation>{
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   198
\begin{frame}[t]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   199
\frametitle{\begin{tabular}{c}Compiled vs.~Interpreted Code\end{tabular}}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   200
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   201
\begin{center}
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   202
\begin{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   203
\begin{axis}[axis x line=bottom, axis y line=left, xlabel=n, ylabel=mins]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   204
\addplot file {compiled.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   205
\end{axis}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   206
\end{tikzpicture}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   207
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   208
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   209
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   210
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   211
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   212
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   213
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   214
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   215
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   216
\begin{frame}[t]
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   217
\frametitle{\begin{tabular}{c}Compiled vs.~Interpreted Code\end{tabular}}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   218
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   219
\mbox{}\\[-25mm]\mbox{}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   220
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   221
\begin{center}
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   222
\begin{tikzpicture}[y=.4cm, x=.00000009cm]
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   223
 	%axis
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   224
	\draw (0,0) -- coordinate (x axis mid) (5,0);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   225
    	\draw (0,0) -- coordinate (y axis mid) (0,5);
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   226
    	%ticks
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   227
    	\foreach \x in {0, 1000,...,10000}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   228
     		\draw (\x,1pt) -- (\x,-3pt)
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   229
			node[anchor=north] {\small \x{}00};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   230
    	\foreach \y in {0,0.5,1, ..., 5.5}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   231
     		\draw (1pt,\y) -- (-3pt,\y) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   232
     			node[anchor=east] {\small\y}; 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   233
	%labels      
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   234
	\node[below=0.6cm] at (x axis mid) {\bl{1}s};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   235
	\node[rotate=90, left=1.2cm] at (y axis mid) {secs};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   236
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   237
	%plots
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   238
	%\draw[color=blue] plot[mark=*, mark options={fill=white}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   239
	%	file {compiled.data};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   240
         %\only<2->{\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   241
          %        file {interpreted.data};}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   242
	%legend
77
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   243
	%\begin{scope}[shift={(400,20)}] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   244
	%\draw[color=blue] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   245
	%	plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   246
	%	node[right]{\small unambiguous};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   247
	%\only<2->{\draw[yshift=\baselineskip, color=red] (0,0) -- 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   248
          %      plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   249
          %      node[right]{\small ambiguous};}  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 76
diff changeset
   250
	%\end{scope}
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   251
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   252
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   253
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   254
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   255
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   256
69
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 67
diff changeset
   257
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 67
diff changeset
   258
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 67
diff changeset
   259
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 67
diff changeset
   260
65
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   261
\end{document}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   262
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   263
%%% Local Variables:  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   264
%%% mode: latex
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   265
%%% TeX-master: t
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   266
%%% End: 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   267