author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Sat, 24 Nov 2012 14:58:27 +0000 | |
changeset 77 | 49c0beef79a1 |
parent 76 | 373cf55a3ca5 |
child 79 | fd894e017e12 |
permissions | -rw-r--r-- |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
\documentclass[dvipsnames,14pt,t]{beamer} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
\usepackage{beamerthemeplainculight} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
\usepackage[T1]{fontenc} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
\usepackage[latin1]{inputenc} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
\usepackage{mathpartir} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
\usepackage[absolute,overlay]{textpos} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
\usepackage{ifthen} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
\usepackage{tikz} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
\usepackage{pgf} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
\usepackage{calc} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
\usepackage{ulem} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
\usepackage{courier} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
\usepackage{listings} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
\renewcommand{\uline}[1]{#1} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
\usetikzlibrary{arrows} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
\usetikzlibrary{automata} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
\usetikzlibrary{shapes} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
\usetikzlibrary{shadows} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
19 |
\usetikzlibrary{positioning} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
20 |
\usetikzlibrary{calc} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
21 |
\usetikzlibrary{plotmarks} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
22 |
\usepackage{graphicx} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
23 |
\usepackage{pgfplots} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
24 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
25 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
26 |
\definecolor{javared}{rgb}{0.6,0,0} % for strings |
ade6af51402c
tuned
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 |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
28 |
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords |
ade6af51402c
tuned
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 |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
30 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
31 |
\lstset{language=Java, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
32 |
basicstyle=\ttfamily, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
33 |
keywordstyle=\color{javapurple}\bfseries, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
34 |
stringstyle=\color{javagreen}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
35 |
commentstyle=\color{javagreen}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
36 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
37 |
numbers=left, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
38 |
numberstyle=\tiny\color{black}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
39 |
stepnumber=1, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
40 |
numbersep=10pt, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
41 |
tabsize=2, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
42 |
showspaces=false, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
43 |
showstringspaces=false} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
44 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
45 |
\lstdefinelanguage{scala}{ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
46 |
morekeywords={abstract,case,catch,class,def,% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
47 |
do,else,extends,false,final,finally,% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
48 |
for,if,implicit,import,match,mixin,% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
49 |
new,null,object,override,package,% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
50 |
private,protected,requires,return,sealed,% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
51 |
super,this,throw,trait,true,try,% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
52 |
type,val,var,while,with,yield}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
otherkeywords={=>,<-,<\%,<:,>:,\#,@}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
54 |
sensitive=true, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
55 |
morecomment=[l]{//}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
56 |
morecomment=[n]{/*}{*/}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
morestring=[b]", |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
morestring=[b]', |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
59 |
morestring=[b]""" |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
61 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
62 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
63 |
\lstset{language=Scala, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
64 |
basicstyle=\ttfamily, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
65 |
keywordstyle=\color{javapurple}\bfseries, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
66 |
stringstyle=\color{javagreen}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
67 |
commentstyle=\color{javagreen}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
68 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
69 |
numbers=left, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
70 |
numberstyle=\tiny\color{black}, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
71 |
stepnumber=1, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
72 |
numbersep=10pt, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
73 |
tabsize=2, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
74 |
showspaces=false, |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
75 |
showstringspaces=false} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
76 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
77 |
\lstdefinelanguage{while}{ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
78 |
morekeywords={if,then,else,while,do,true,false}, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
79 |
otherkeywords={=,!=,:=,<,>}, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
80 |
sensitive=true, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
81 |
morecomment=[n]{/*}{*/}, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
82 |
} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
83 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
84 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
85 |
\lstset{language=While, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
86 |
basicstyle=\ttfamily, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
87 |
keywordstyle=\color{javapurple}\bfseries, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
88 |
stringstyle=\color{javagreen}, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
89 |
commentstyle=\color{javagreen}, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
90 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
91 |
numbers=left, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
92 |
numberstyle=\tiny\color{black}, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
93 |
stepnumber=1, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
94 |
numbersep=10pt, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
95 |
tabsize=2, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
96 |
showspaces=false, |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
97 |
showstringspaces=false} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
98 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
99 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
100 |
% beamer stuff |
76
373cf55a3ca5
tuned
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
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
102 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
103 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
104 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
105 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
106 |
% The data files, written on the first run. |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
107 |
\begin{filecontents}{compiled.data} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
108 |
1 0.0207 |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
109 |
5000 0.0217 |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
110 |
10000 0.0297 |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
111 |
50000 0.1034 |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
112 |
100000 0.3873 |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
113 |
500000 1.27949 |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
114 |
1000000 5. 35424 |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
115 |
\end{filecontents} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
116 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
117 |
\begin{filecontents}{interpreted.data} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
118 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
119 |
\end{filecontents} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
120 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
121 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
122 |
\begin{document} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
123 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
124 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
125 |
\mode<presentation>{ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
126 |
\begin{frame}<1>[t] |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
127 |
\frametitle{% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
128 |
\begin{tabular}{@ {}c@ {}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
129 |
\\[-3mm] |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
130 |
\LARGE Automata and \\[-2mm] |
76
373cf55a3ca5
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
70
diff
changeset
|
131 |
\LARGE Formal Languages (9)\\[3mm] |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
132 |
\end{tabular}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
133 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
134 |
\normalsize |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
135 |
\begin{center} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
136 |
\begin{tabular}{ll} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
137 |
Email: & christian.urban at kcl.ac.uk\\ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
138 |
Of$\!$fice: & S1.27 (1st floor Strand Building)\\ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
139 |
Slides: & KEATS (also home work is there)\\ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
140 |
\end{tabular} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
141 |
\end{center} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
142 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
143 |
\end{frame}} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
144 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
145 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
146 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
147 |
\mode<presentation>{ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
148 |
\begin{frame}[c] |
77
49c0beef79a1
added
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
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
150 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
151 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
152 |
\begin{center} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
153 |
\bl{\begin{tabular}{@{}lcl@{}} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
154 |
$Stmt$ & $\rightarrow$ & $\text{skip}$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
155 |
& $|$ & $Id := AExp$\\ |
49c0beef79a1
added
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$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
157 |
& $|$ & $\text{while}\; B\!Exp \;\text{do}\; Block$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
158 |
& $|$ & $\alert{\text{write}\; Id}$\medskip\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
159 |
$Stmts$ & $\rightarrow$ & $Stmt \;\text{;}\; Stmts$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
160 |
& $|$ & $Stmt$\medskip\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
161 |
$Block$ & $\rightarrow$ & $\{ Stmts \}$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
162 |
& $|$ & $Stmt$\medskip\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
163 |
$AExp$ & $\rightarrow$ & \ldots\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
164 |
$BExp$ & $\rightarrow$ & \ldots\\ |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
165 |
\end{tabular}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
166 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
167 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
168 |
|
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
169 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
170 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
171 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
172 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
173 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
174 |
\begin{frame}[c] |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
175 |
\frametitle{\begin{tabular}{c}Fibonacci Numbers\end{tabular}} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
176 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
177 |
\mbox{}\\[-18mm]\mbox{} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
178 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
179 |
{\lstset{language=While}\fontsize{10}{12}\selectfont |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
180 |
\texttt{\lstinputlisting{app9.while}}} |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
181 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
182 |
\end{frame}} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
183 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
184 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
185 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
186 |
\mode<presentation>{ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
187 |
\begin{frame}[c] |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
188 |
\frametitle{\begin{tabular}{c}Interpreter\end{tabular}} |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
189 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
190 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
191 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
192 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
193 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
194 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
195 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
196 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
197 |
\begin{frame}[c] |
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
198 |
\frametitle{\begin{tabular}{c}Interpreting a List of Tokens\end{tabular}} |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
199 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
200 |
The lexer cannot prevent errors like |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
201 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
202 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
203 |
\bl{$<\!b\!>$} \ldots \bl{$<\!p\!>$} \ldots \bl{$<\!\slash{}b\!>$} \ldots \bl{$<\!\slash{}p\!>$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
204 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
205 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
206 |
or |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
207 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
208 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
209 |
\bl{$<\!\slash{}b\!>$} \ldots \bl{$<\!b\!>$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
210 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
211 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
212 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
213 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
214 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
215 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
216 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
217 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
218 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
219 |
\frametitle{\begin{tabular}{c}Parser Combinators\end{tabular}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
220 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
221 |
Parser combinators: \bigskip |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
222 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
223 |
\begin{minipage}{1.1\textwidth} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
224 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
225 |
\mbox{}\hspace{-12mm}\mbox{}$\underbrace{\text{list of tokens}}_{\text{input}}$ \bl{$\Rightarrow$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
226 |
$\underbrace{\text{set of (parsed input, unparsed input)}}_{\text{output}}$ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
227 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
228 |
\end{minipage}\bigskip |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
229 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
230 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
231 |
\item sequencing |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
232 |
\item alternative |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
233 |
\item semantic action |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
234 |
\end{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
235 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
236 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
237 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
238 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
239 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
240 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
241 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
242 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
243 |
Alternative parser (code \bl{$p\;||\;q$})\bigskip |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
244 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
245 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
246 |
\item apply \bl{$p$} and also \bl{$q$}; then combine the outputs |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
247 |
\end{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
248 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
249 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
250 |
\large \bl{$p(\text{input}) \cup q(\text{input})$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
251 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
252 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
253 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
254 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
255 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
256 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
257 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
258 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
259 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
260 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
261 |
Sequence parser (code \bl{$p\sim q$})\bigskip |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
262 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
263 |
\begin{itemize} |
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
264 |
\item apply first \bl{$p$} producing a set of pairs |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
265 |
\item then apply \bl{$q$} to the unparsed parts |
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
266 |
\item then combine the results:\\ \mbox{}\;\;((output$_1$, output$_2$), unparsed part) |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
267 |
\end{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
268 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
269 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
270 |
\begin{tabular}{l} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
271 |
\large \bl{$\{((o_1, o_2), u_2) \;|\;$}\\[2mm] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
272 |
\large\mbox{}\hspace{15mm} \bl{$(o_1, u_1) \in p(\text{input}) \wedge$}\\[2mm] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
273 |
\large\mbox{}\hspace{15mm} \bl{$(o_2, u_2) \in q(u_1)\}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
274 |
\end{tabular} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
275 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
276 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
277 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
278 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
279 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
280 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
281 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
282 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
283 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
284 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
285 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
286 |
Function parser (code \bl{$p \Longrightarrow f$})\bigskip |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
287 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
288 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
289 |
\item apply \bl{$p$} producing a set of pairs |
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
290 |
\item then apply the function \bl{$f$} to each first component |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
291 |
\end{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
292 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
293 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
294 |
\begin{tabular}{l} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
295 |
\large \bl{$\{(f(o_1), u_1) \;|\; (o_1, u_1) \in p(\text{input})\}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
296 |
\end{tabular} |
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
297 |
\end{center}\bigskip\bigskip\pause |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
298 |
|
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
299 |
\bl{$f$} is the semantic action (``what to do with the parsed input'') |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
300 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
301 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
302 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
303 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
304 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
305 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
306 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
307 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
308 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
309 |
Token parser:\bigskip |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
310 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
311 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
312 |
\item if the input is |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
313 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
314 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
315 |
\large \bl{$tok_1:: tok_2 :: \ldots :: tok_n$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
316 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
317 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
318 |
then return |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
319 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
320 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
321 |
\large \bl{$\{(tok_1,\; tok_2 :: \ldots :: tok_n)\}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
322 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
323 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
324 |
or |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
325 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
326 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
327 |
\large \bl{$\{\}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
328 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
329 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
330 |
if \bl{$tok_1$} is not the right token we are looking for |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
331 |
\end{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
332 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
333 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
334 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
335 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
336 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
337 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
338 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
339 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
340 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
341 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
342 |
Number-Token parser:\bigskip |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
343 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
344 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
345 |
\item if the input is |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
346 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
347 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
348 |
\large \bl{$num\_tok(42):: tok_2 :: \ldots :: tok_n$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
349 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
350 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
351 |
then return |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
352 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
353 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
354 |
\large \bl{$\{(42,\; tok_2 :: \ldots :: tok_n)\}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
355 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
356 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
357 |
or |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
358 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
359 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
360 |
\large \bl{$\{\}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
361 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
362 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
363 |
if \bl{$tok_1$} is not the right token we are looking for |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
364 |
\end{itemize}\pause |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
365 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
366 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
367 |
list of tokens \bl{$\Rightarrow$} set of (\alert{int}, list of tokens) |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
368 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
369 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
370 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
371 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
372 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
373 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
374 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
375 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
376 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
377 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
378 |
\item if the input is |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
379 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
380 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
381 |
\begin{tabular}{l} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
382 |
\large \bl{$num\_tok(42)::$}\\ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
383 |
\hspace{7mm}\large \bl{$num\_tok(3) ::$}\\ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
384 |
\hspace{14mm}\large \bl{$tok_3 :: \ldots :: tok_n$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
385 |
\end{tabular} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
386 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
387 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
388 |
and the parser is |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
389 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
390 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
391 |
\bl{$ntp \sim ntp$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
392 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
393 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
394 |
the successful output will be |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
395 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
396 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
397 |
\large \bl{$\{((42, 3),\; tok_2 :: \ldots :: tok_n)\}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
398 |
\end{center}\pause |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
399 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
400 |
Now we can form |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
401 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
402 |
\bl{$(ntp \sim ntp) \Longrightarrow f$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
403 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
404 |
|
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
405 |
where \bl{$f$} is the semantic action (``what to do with the pair'') |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
406 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
407 |
\end{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
408 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
409 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
410 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
411 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
412 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
413 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
414 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
415 |
\frametitle{\begin{tabular}{c}Semantic Actions\end{tabular}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
416 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
417 |
Addition |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
418 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
419 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
420 |
\bl{$T \sim + \sim E \Longrightarrow \underbrace{f((x,y), z) \Rightarrow x + z}_{\text{semantic action}}$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
421 |
\end{center}\pause |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
422 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
423 |
Multiplication |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
424 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
425 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
426 |
\bl{$F \sim * \sim T \Longrightarrow f((x,y), z) \Rightarrow x * z$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
427 |
\end{center}\pause |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
428 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
429 |
Parenthesis |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
430 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
431 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
432 |
\bl{$\text{(} \sim E \sim \text{)} \Longrightarrow f((x,y), z) \Rightarrow y$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
433 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
434 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
435 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
436 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
437 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
438 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
439 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
440 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
441 |
\frametitle{\begin{tabular}{c}Types of Parsers\end{tabular}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
442 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
443 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
444 |
\item {\bf Sequencing}: if \bl{$p$} returns results of type \bl{$T$}, and \bl{$q$} results of type \bl{$S$}, |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
445 |
then \bl{$p \sim q$} returns results of type |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
446 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
447 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
448 |
\bl{$T \times S$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
449 |
\end{center}\pause |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
450 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
451 |
\item {\bf Alternative}: if \bl{$p$} returns results of type \bl{$T$} then \bl{$q$} \alert{must} also have results of type \bl{$T$}, |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
452 |
and \bl{$p \;||\; q$} returns results of type |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
453 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
454 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
455 |
\bl{$T$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
456 |
\end{center}\pause |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
457 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
458 |
\item {\bf Semantic Action}: if \bl{$p$} returns results of type \bl{$T$} and \bl{$f$} is a function from |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
459 |
\bl{$T$} to \bl{$S$}, then |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
460 |
\bl{$p \Longrightarrow f$} returns results of type |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
461 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
462 |
\begin{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
463 |
\bl{$S$} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
464 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
465 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
466 |
\end{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
467 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
468 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
469 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
470 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
471 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
472 |
\mode<presentation>{ |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
473 |
\begin{frame}[c] |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
474 |
\frametitle{\begin{tabular}{c}Input Types of Parsers\end{tabular}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
475 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
476 |
\begin{itemize} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
477 |
\item input: \alert{list of tokens} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
478 |
\item output: set of (output\_type, \alert{list of tokens}) |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
479 |
\end{itemize}\bigskip\pause |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
480 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
481 |
actually it can be any input type as long as it is a kind of sequence |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
482 |
(for example a string) |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
483 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
484 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
485 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
486 |
|
70
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
487 |
|
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
488 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
489 |
\mode<presentation>{ |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
490 |
\begin{frame}[c] |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
491 |
\frametitle{\begin{tabular}{c}Scannerless Parsers\end{tabular}} |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
492 |
|
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
493 |
\begin{itemize} |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
494 |
\item input: \alert{string} |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
495 |
\item output: set of (output\_type, \alert{string}) |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
496 |
\end{itemize}\bigskip |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
497 |
|
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
498 |
but lexers are better when whitespaces or comments need to be filtered out |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
499 |
|
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
500 |
\end{frame}} |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
501 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
502 |
|
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
503 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
e6868bd2942b
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
69
diff
changeset
|
504 |
\mode<presentation>{ |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
505 |
\begin{frame}[t] |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
506 |
\frametitle{\begin{tabular}{c}Compiled vs.~Interpreted Code\end{tabular}} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
507 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
508 |
\begin{center} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
509 |
\begin{tikzpicture} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
510 |
\begin{axis}[axis x line=bottom, axis y line=left, xlabel=n, ylabel=mins] |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
511 |
\addplot file {compiled.data}; |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
512 |
\end{axis} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
513 |
\end{tikzpicture} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
514 |
\end{center} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
515 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
516 |
\end{frame}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
517 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
518 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
519 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
520 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
521 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
522 |
\mode<presentation>{ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
523 |
\begin{frame}[t] |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
524 |
\frametitle{\begin{tabular}{c}Compiled vs.~Interpreted Code\end{tabular}} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
525 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
526 |
\mbox{}\\[-25mm]\mbox{} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
527 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
528 |
\begin{center} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
529 |
\begin{tikzpicture}[y=.4cm, x=.00000009cm] |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
530 |
%axis |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
531 |
\draw (0,0) -- coordinate (x axis mid) (5,0); |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
532 |
\draw (0,0) -- coordinate (y axis mid) (0,5); |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
533 |
%ticks |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
534 |
\foreach \x in {0, 1000,...,10000} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
535 |
\draw (\x,1pt) -- (\x,-3pt) |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
536 |
node[anchor=north] {\small \x{}00}; |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
537 |
\foreach \y in {0,0.5,1, ..., 5.5} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
538 |
\draw (1pt,\y) -- (-3pt,\y) |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
539 |
node[anchor=east] {\small\y}; |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
540 |
%labels |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
541 |
\node[below=0.6cm] at (x axis mid) {\bl{1}s}; |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
542 |
\node[rotate=90, left=1.2cm] at (y axis mid) {secs}; |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
543 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
544 |
%plots |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
545 |
%\draw[color=blue] plot[mark=*, mark options={fill=white}] |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
546 |
% file {compiled.data}; |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
547 |
%\only<2->{\draw[color=red] plot[mark=triangle*, mark options={fill=white} ] |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
548 |
% file {interpreted.data};} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
549 |
%legend |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
550 |
%\begin{scope}[shift={(400,20)}] |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
551 |
%\draw[color=blue] (0,0) -- |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
552 |
% plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
553 |
% node[right]{\small unambiguous}; |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
554 |
%\only<2->{\draw[yshift=\baselineskip, color=red] (0,0) -- |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
555 |
% plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0) |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
556 |
% node[right]{\small ambiguous};} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
557 |
%\end{scope} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
558 |
\end{tikzpicture} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
559 |
\end{center} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
560 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
561 |
\end{frame}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
562 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
563 |
|
69
cc3f7908b942
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
67
diff
changeset
|
564 |
|
cc3f7908b942
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
67
diff
changeset
|
565 |
|
cc3f7908b942
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
67
diff
changeset
|
566 |
|
cc3f7908b942
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
67
diff
changeset
|
567 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
568 |
\end{document} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
569 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
570 |
%%% Local Variables: |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
571 |
%%% mode: latex |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
572 |
%%% TeX-master: t |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
573 |
%%% End: |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
574 |