Binary file cws/cw04.pdf has changed
--- a/cws/cw04.tex Thu Nov 24 19:05:34 2022 +0000
+++ b/cws/cw04.tex Thu Dec 01 12:51:49 2022 +0000
@@ -135,6 +135,11 @@
%will \emph{only} be judged according to the answers. You can
%submit your answers in a txt-file or as pdf.\bigskip
+\subsection*{Question 0 (Unmarked)}
+
+Please include a README file that contains your email address, your student
+number and whether you are BSc / MSci student and for the latter in which
+year your are in. Thanks!
\subsection*{Question 1}
Binary file slides/slides08.pdf has changed
--- a/slides/slides08.tex Thu Nov 24 19:05:34 2022 +0000
+++ b/slides/slides08.tex Thu Dec 01 12:51:49 2022 +0000
@@ -26,22 +26,25 @@
\begin{document}
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[t]
\frametitle{%
\begin{tabular}{@ {}c@ {}}
\\[-3mm]
\LARGE Compilers and \\[-2mm]
- \LARGE Formal Languages\\[3mm]
+ \LARGE Formal Languages\\[-3mm]
\end{tabular}}
- \normalsize
+ \normalsize
\begin{center}
\begin{tabular}{ll}
- Email: & christian.urban at kcl.ac.uk\\
- %Office Hours: & Thursdays 12 -- 14\\
- %Location: & N7.07 (North Wing, Bush House)\\
- Slides \& Progs: & KEATS (also homework is there)\\
+ Email: & christian.urban at kcl.ac.uk\\
+ Office Hour: & Fridays 11 -- 12\\
+ Location: & N7.07 (North Wing, Bush House)\\
+ Slides \& Progs: & KEATS\\
+ Pollev: & \texttt{\alert{https://pollev.com/cfltutoratki576}}\\
\end{tabular}
\end{center}
@@ -62,6 +65,40 @@
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[t,fragile]
+%%\frametitle{CW2}
+
+\small
+\begin{textblock}{13}(-0.5,1)
+\begin{lstlisting}[numbers=none]
+def mkeps(r: Rexp) : Val = r match {
+ ...
+ case PLUS(r) => Stars(List(mkeps(r)))
+ case OPTIONAL(r) => Stars(Nil)
+ case NTIMES(r, n) => Stars(List.fill(n)(mkeps(r)))
+}
+
+def inj(r: Rexp, c: Char, v: Val) : Val = (r, v) match {
+ ...
+ case (RANGE(_), Empty) => Chr(c)
+ case (PLUS(r), Sequ(v1, Stars(vs))) => Stars(inj(r, c, v1)::vs)
+ case (OPTIONAL(r), v) => Stars(inj(r, c, v)::Nil)
+ case (NTIMES(r, n), Sequ(v1, Stars(vs))) => Stars(inj(r, c, v1)::vs)
+}
+\end{lstlisting}
+\end{textblock}
+
+
+\begin{textblock}{5}(3,13.5)
+\bl{$r^? \dn r^{\{0..1\}}$}
+\end{textblock}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{frame}[c]