handouts/ho02.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 15 Sep 2014 09:36:02 +0100
changeset 251 5b5a68df6d16
parent 217 cd6066f1056a
child 258 1e4da6d2490c
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
123
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
\documentclass{article}
251
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
     2
\usepackage{../style}
217
cd6066f1056a updated handouts
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 140
diff changeset
     3
\usepackage{../langs}
123
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
\begin{document}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
\section*{Handout 2}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
251
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    10
Having specified what problem our matching algorithm,
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    11
\pcode{match}, is supposed to solve, namely for a given
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    12
regular expression $r$ and string $s$ answer \textit{true} if
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    13
and only if
123
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
s \in L(r)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
251
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    19
\noindent we can look at an algorithm to solve this problem.
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    20
Clearly we cannot use the function $L$ directly for this,
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    21
because in general the set of strings $L$ returns is infinite
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    22
(recall what $L(a^*)$ is). In such cases there is no way we
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    23
can implement an exhaustive test for whether a string is
5b5a68df6d16 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 217
diff changeset
    24
member of this set or not.
123
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
140
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
    26
The algorithm we will define below consists of two parts. One is the function $nullable$ which takes a
124
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    27
regular expression as argument and decides whether it can match the empty string (this means it returns a 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    28
boolean). This can be easily defined recursively as follows:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    29
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    30
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    31
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    32
$nullable(\varnothing)$      & $\dn$ & $f\!\/alse$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    33
$nullable(\epsilon)$           & $\dn$ &  $true$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    34
$nullable (c)$                    & $\dn$ &  $f\!alse$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    35
$nullable (r_1 + r_2)$       & $\dn$ &  $nullable(r_1) \vee nullable(r_2)$\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    36
$nullable (r_1 \cdot r_2)$ & $\dn$ &  $nullable(r_1) \wedge nullable(r_2)$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    37
$nullable (r^*)$                & $\dn$ & $true$ \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    38
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    39
\end{center}
123
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
124
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    41
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    42
The idea behind this function is that the following property holds:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    43
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    44
\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    45
nullable(r) \;\;\text{if and only if}\;\; ""\in L(r)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    46
\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    47
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    48
\noindent
140
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
    49
Note on the left-hand side we have a function we can implement; on the right we have its specification. 
124
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    50
140
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
    51
The other function of our matching algorithm calculates a \emph{derivative} of a regular expression. This is a function
124
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    52
which will take a regular expression, say $r$, and a character, say $c$, as argument and return 
140
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
    53
a new regular expression. Be careful that the intuition behind this function is not so easy to grasp on first
124
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 123
diff changeset
    54
reading. Essentially this function solves the following problem: if $r$ can match a string of the form
125
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    55
$c\!::\!s$, what does the regular expression look like that can match just $s$. The definition of this
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    56
function is as follows:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    57
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    58
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    59
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    60
  $der\, c\, (\varnothing)$      & $\dn$ & $\varnothing$ & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    61
  $der\, c\, (\epsilon)$           & $\dn$ & $\varnothing$ & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    62
  $der\, c\, (d)$                     & $\dn$ & if $c = d$ then $\epsilon$ else $\varnothing$ & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    63
  $der\, c\, (r_1 + r_2)$        & $\dn$ & $der\, c\, r_1 + der\, c\, r_2$ & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    64
  $der\, c\, (r_1 \cdot r_2)$  & $\dn$  & if $nullable (r_1)$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    65
  & & then $(der\,c\,r_1) \cdot r_2 + der\, c\, r_2$\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    66
  & & else $(der\, c\, r_1) \cdot r_2$\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    67
  $der\, c\, (r^*)$          & $\dn$ & $(der\,c\,r) \cdot (r^*)$ &
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    68
  \end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    69
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    70
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    71
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    72
The first two clauses can be rationalised as follows: recall that $der$ should calculate a regular
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    73
expression, if the ``input'' regular expression can match a string of the form $c\!::\!s$. Since neither
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    74
$\varnothing$ nor $\epsilon$ can match such a string we return $\varnothing$. In the third case
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    75
we have to make a case-distinction: In case the regular expression is $c$, then clearly it can recognise
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    76
a string of the form $c\!::\!s$, just that $s$ is the empty string. Therefore we return the $\epsilon$-regular 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    77
expression. In the other case we again return $\varnothing$ since no string of the $c\!::\!s$ can be matched.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    78
The $+$-case is relatively straightforward: all strings of the form $c\!::\!s$ are either matched by the
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    79
regular expression $r_1$ or $r_2$. So we just have to recursively call $der$ with these two regular
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    80
expressions and compose the results again with $+$. The $\cdot$-case is more complicated:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    81
if $r_1\cdot r_2$ matches a string of the form $c\!::\!s$, then the first part must be matched by $r_1$.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    82
Consequently, it makes sense to construct the regular expression for $s$ by calling $der$ with $r_1$ and
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    83
``appending'' $r_2$. There is however one exception to this simple rule: if $r_1$ can match the empty
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    84
string, then all of $c\!::\!s$ is matched by $r_2$. So in case $r_1$ is nullable (that is can match the
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    85
empty string) we have to allow the choice $der\,c\,r_2$ for calculating the regular expression that can match 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    86
$s$. The $*$-case is again simple: if $r^*$ matches a string of the form $c\!::\!s$, then the first part must be
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    87
``matched'' by a single copy of $r$. Therefore we call recursively $der\,c\,r$ and ``append'' $r^*$ in order to 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    88
match the rest of $s$.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    89
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    90
Another way to rationalise the definition of $der$ is to consider the following operation on sets:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    91
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    92
\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    93
Der\,c\,A\;\dn\;\{s\,|\,c\!::\!s \in A\}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    94
\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    95
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    96
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    97
which essentially transforms a set of strings $A$ by filtering out all strings that do not start with $c$ and then
140
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
    98
strips off the $c$ from all the remaining strings. For example suppose $A = \{"f\!oo", "bar", "f\!rak"\}$ then
125
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
    99
\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   100
Der\,f\,A = \{"oo", "rak"\}\quad,\quad
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   101
Der\,b\,A = \{"ar"\}  \quad \text{and} \quad
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   102
Der\,a\,A = \varnothing
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   103
\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   104
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   105
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   106
Note that in the last case $Der$ is empty, because no string in $A$ starts with $a$. With this operation we can
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   107
state the following property about $der$:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   108
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   109
\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   110
L(der\,c\,r) = Der\,c\,(L(r))
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   111
\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   113
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   114
This property clarifies what regular expression $der$ calculates, namely take the set of strings
140
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   115
that $r$ can match (that is $L(r)$), filter out all strings not starting with $c$ and strip off the $c$ from the
125
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   116
remaining strings---this is exactly the language that $der\,c\,r$ can match.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   117
140
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   118
If we want to find out whether the string $"abc"$ is matched by the regular expression $r$
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   119
then we can iteratively apply $Der$ as follows
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   120
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   121
\begin{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   122
\item $Der\,a\,(L(r))$
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   123
\item $Der\,b\,(Der\,a\,(L(r)))$
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   124
\item $Der\,c\,(Der\,b\,(Der\,a\,(L(r))))$
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   125
\end{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   126
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   127
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   128
In the last step we need to test whether the empty string is in the set. Our matching algorithm will work similarly, 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 133
diff changeset
   129
just using regular expression instead of sets. For this we need to lift the notion of derivatives from characters to strings. This can be
125
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   130
done using the following function, taking a string and regular expression as input and a regular expression 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   131
as output.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   132
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   133
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   134
\begin{tabular}{@ {}l@ {\hspace{2mm}}c@ {\hspace{2mm}}l@ {\hspace{-10mm}}l@ {}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   135
  $der\!s\, []\, r$     & $\dn$ & $r$ & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   136
  $der\!s\, (c\!::\!s)\, r$ & $\dn$ & $der\!s\,s\,(der\,c\,r)$ & \\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   137
  \end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   138
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   139
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   140
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   141
Having $ders$ in place, we can finally define our matching algorithm:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   142
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   143
\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   144
match\,s\,r = nullable(ders\,s\,r)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   145
\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   146
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   147
\noindent
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   148
We claim that
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   149
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   150
\[
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   151
match\,s\,r\quad\text{if and only if}\quad s\in L(r)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   152
\]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   153
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 124
diff changeset
   154
\noindent
133
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 126
diff changeset
   155
holds, which means our algorithm satisfies the specification. This algorithm was introduced by
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 126
diff changeset
   156
Janus Brzozowski in 1964. Its main attractions are simplicity and being fast, as well as
09efdf5cf07c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 126
diff changeset
   157
being easily extendable for other regular expressions such as $r^{\{n\}}$, $r^?$, $\sim{}r$ and so on.
126
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 125
diff changeset
   158
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 125
diff changeset
   159
\begin{figure}[p]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 125
diff changeset
   160
{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app5.scala}}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 125
diff changeset
   161
{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app6.scala}}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 125
diff changeset
   162
\caption{Scala implementation of the nullable and derivatives functions.}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 125
diff changeset
   163
\end{figure}
123
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   164
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   165
\end{document}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   166
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   167
%%% Local Variables: 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   168
%%% mode: latex
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   169
%%% TeX-master: t
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   170
%%% End: