Binary file coursework/cw01.pdf has changed
--- a/coursework/cw01.tex Sun Sep 21 11:46:49 2014 +0100
+++ b/coursework/cw01.tex Sun Sep 21 17:40:04 2014 +0100
@@ -1,10 +1,7 @@
\documentclass{article}
-\usepackage{hyperref}
-\usepackage{amssymb}
-\usepackage{amsmath}
+\usepackage{../style}
\usepackage{../langs}
-\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}%
\begin{document}
\section*{Coursework 1}
Binary file coursework/cw04.pdf has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coursework/cw04.tex Sun Sep 21 17:40:04 2014 +0100
@@ -0,0 +1,46 @@
+\documentclass{article}
+\usepackage{../style}
+\usepackage{../langs}
+
+\begin{document}
+
+\section*{Coursework Alternative}
+
+\noindent
+This coursework is worth 25\% and is due on 12 December at 16:00. You are
+asked to prove the correctness of a regular expression matcher with the
+Isabelle theorem prover. This theorem prover is available from
+
+\begin{center}
+\url{http://isabelle.in.tum.de}
+\end{center}
+
+\noindent
+There is a shorte user guide for Isabelle called
+``Programming and Proving in Isabelle/HOL'' at
+
+\begin{center}
+\url{http://isabelle.in.tum.de/documentation.html}
+\end{center}
+
+\noindent
+and also a longer (free) book at
+
+\begin{center}
+\url{http://www.concrete-semantics.org}
+\end{center}
+
+\noindent
+If you need more help or you are stuck somewhere, please feel free
+to contact me (christian.urban@kcl.ac.uk). I am a main developer of
+Isabelle and have used it for approximately the last 14 years.
+
+
+\subsection*{Problem}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
--- a/graphics.sty Sun Sep 21 11:46:49 2014 +0100
+++ b/graphics.sty Sun Sep 21 17:40:04 2014 +0100
@@ -3,6 +3,7 @@
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usepackage{graphicx}
+\usepackage{pgfplots}
\newenvironment{bubble}[1][]{%
\begin{tikzpicture}%
Binary file slides/slides01.pdf has changed
--- a/slides/slides01.tex Sun Sep 21 11:46:49 2014 +0100
+++ b/slides/slides01.tex Sun Sep 21 17:40:04 2014 +0100
@@ -6,35 +6,7 @@
\hfuzz=220pt
-%\setmonofont[Scale=.88]{Consolas}
-%\newfontfamily{\consolas}{Consolas}
-%\usepackage{beamerthemeplaincu}
-%\usepackage{fontenc,xltxtra,xunicode}
-%\defaultfontfeatures{Mapping=tex-text}
-%\usepackage[absolute,overlay]{textpos}
-%\usepackage{ifthen}
-%\usepackage{tikz}
-%\usepackage{pgf}
-%\usepackage{calc}
-%\usepackage{ulem}
-%\usepackage{listings}
-%\renewcommand{\uline}[1]{#1}
-%\usetikzlibrary{arrows}
-%\usetikzlibrary{automata}
-%\usetikzlibrary{shapes}
-%\usetikzlibrary{shadows}
-%\usetikzlibrary{positioning}
-%\usetikzlibrary{calc}
-%\usetikzlibrary{plotmarks}
-%\usepackage{graphicx}
-%\usepackage{pgfplots}
-%\usepackage{../langs}
-%\usepackage{../data}
-
-%\makeatletter
-%\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
-%\@empty\z@\@empty
-%\makeatother
+\newcommand{\bl}[1]{\textcolor{blue}{#1}}
% beamer stuff
\renewcommand{\slidecaption}{AFL 01, King's College London}
@@ -43,8 +15,7 @@
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
-\begin{frame}<1>[t]
+\begin{frame}[t]
\frametitle{%
\begin{tabular}{@ {}c@ {}}
\\[-3mm]
@@ -68,11 +39,10 @@
\end{center}
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
\begin{textblock}{1}(2,5)
@@ -114,12 +84,10 @@
\end{itemize}
\end{textblock}}
-
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
transforming strings into structured data\\[10mm]
@@ -130,12 +98,11 @@
{\LARGE\bf Parsing}\medskip\\
\hspace{5mm}(recognising ``sentences'')
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
The subject is quite old:
@@ -153,7 +120,7 @@
{\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}}
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -191,9 +158,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[t]
-\frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}}
+\frametitle{A Web-Crawler}
\mbox{}\\[10mm]
@@ -203,13 +169,13 @@
\item call the web-crawler again for all these links
\end{enumerate}
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>{
\begin{frame}[t]
-\frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}}
+\frametitle{A Web-Crawler}
\mbox{}\\[10mm]
@@ -228,30 +194,28 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
-\frametitle{\begin{tabular}{c}Scala\end{tabular}}
+\frametitle{Scala}
-\small a simple Scala function for reading webpages\\[-3mm]
+\small a simple Scala function for reading webpages
\footnotesize
-{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app0.scala}}}\pause
-{\lstset{language=Scala}\texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip
+\lstinputlisting{../progs/app0.scala}\pause
+\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}\pause\bigskip
-\small slightly more complicated for handling errors properly:\\[-3mm]
+\small slightly more complicated for handling errors properly:
\footnotesize
-{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app1.scala}}}
+\lstinputlisting{../progs/app1.scala}
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
-\frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
+\frametitle{Why Scala?}
\begin{textblock}{6}(1,3)
\begin{tabular}{l}
@@ -300,110 +264,95 @@
\only<5->{
\begin{textblock}{1}(3,6)
-\begin{tikzpicture}
-\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
-{\normalsize\color{darkgray}
-\begin{minipage}{8.5cm}\raggedright\normalsize
-Scala is a functional and object-oriented programming language; compiles to the JVM; does not
-need null-pointer exceptions; a course on Coursera\\
-\mbox{}\hfill\textcolor{blue}{\url{http://www.scala-lang.org}}
-\end{minipage}};
-\end{tikzpicture}
+\begin{bubble}[8.5cm]
+\normalsize
+Scala is a functional and object-oriented programming
+language; compiles to the JVM; does not need null-pointer
+exceptions; a course on Coursera\\
+\mbox{}\hfill\url{http://www.scala-lang.org}
+\end{bubble}
\end{textblock}}
-
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[t]
-\frametitle{\begin{tabular}{c}A Regular Expression\end{tabular}}
+\frametitle{A Regular Expression}
\begin{itemize}
\item \ldots{} is a pattern or template for specifying strings
\end{itemize}\bigskip
\begin{center}
-\only<1>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
-\texttt{"https?://[$\hat{\hspace{2mm}}$"]*"}}}%
-\only<2>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
-\texttt{"""\textbackslash{}"https?://[$\hat{\hspace{2mm}}$\textbackslash{}"]*\textbackslash{}"""".r}}}
+\only<1>{\code{"https?://[^\"]*"}}%
+\only<2>{\code{""""https?://[^\"]*"""".r}}
\end{center}\bigskip\bigskip
matches for example\\
-\;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
-\texttt{"http://www.foobar.com"}}\\
-\;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
-\texttt{"https://www.tls.org"}}\\
+\code{"http://www.foobar.com"}\\
+\code{"https://www.tls.org"}\\
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
-{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
-\texttt{rexp.findAllIn(string)}}\medskip
+\code{rexp.findAllIn(string)}\medskip
-returns a list of all (sub)strings that match the regular expression\bigskip\bigskip
+returns a list of all (sub)strings that match the
+regular expression\bigskip\bigskip
-{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
-\texttt{rexp.findFirstIn(string)}}\medskip
+\code{rexp.findFirstIn(string)}\medskip
-returns either {\bf\texttt{None}} if no (sub)string matches
-or {\bf\texttt{Some(s)}} with the first (sub)string
+returns either \code{None} if no (sub)string matches
+or \code{Some(s)} with the first (sub)string
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
-\small
-{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app2.scala}}}\medskip
+\footnotesize
+\lstinputlisting{../progs/app2.scala}\medskip
-{\lstset{language=Scala}\texttt{crawl(some\_start\_URL, 2)}}\
+\code{crawl(some_start_URL, 2)}\
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
\footnotesize
a version that only ``crawls'' links in my domain:
-\small
-{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app3.scala}}}
+\lstinputlisting{../progs/app3.scala}
-
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
\footnotesize
a little email ``harvester'':
-\small
-{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app4.scala}}}\bigskip
+\footnotesize
+\lstinputlisting{../progs/app4.scala}\bigskip
\tiny
-\textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}}
+\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\bl}[1]{\textcolor{blue}{#1}}
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[t]
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
@@ -424,26 +373,24 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[t]
-\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
+\frametitle{Regular Expressions}
\small
In Scala:
-
-{\lstset{language=Scala}\fontsize{8}{10}\selectfont
-\texttt{\lstinputlisting{../progs/app51.scala}}}
+\footnotesize
+\lstinputlisting{../progs/app51.scala}
-\end{frame}}
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>{
\begin{frame}[c]
-\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
+\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm]
+ Regular Expression\end{tabular}}
\begin{textblock}{15}(1,4)
\begin{tabular}{@ {}rcl}
@@ -504,21 +451,63 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
\begin{frame}[c]
-\frametitle{\begin{tabular}{c}Exam\end{tabular}}
+\frametitle{Written Exam}
+
+\begin{itemize}
+\item Accounts for 75\%.\bigskip
+
+\item You will understand the question ``Is this relevant for
+ the exam?'' is very demotivating for the lecturer!\bigskip\\
+
+\item Deal: Whatever is in the homework (and is not marked
+ ``optional'') is relevant for the exam.
+\end{itemize}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[t]
+\frametitle{Coursework}
\begin{itemize}
-\item The question ``Is this relevant for the exam?'' is not appreciated!\bigskip\\
-
-Whatever is in the homework sheets (and is not marked ``optional'') is relevant for the
-exam.\\ No code needs to be written in the exam.
+\item Accounts for 25\%. Two strands. Choose \alert{\bf one}!\bigskip
\end{itemize}
-\end{frame}}
+\begin{columns}[t]
\begin{column}{.5\textwidth}
\underline{\bf Strand 1}\medskip
+\begin{itemize}
+\item four programming subtasks:
+\begin{itemize}
+\item matcher (5\%, 13.10.)
+\item lexer (5\%, 03.11.)
+\item parser (5\%, 27.11.)
+\item compiler (10\%, 12.12.)
+\end{itemize}
+\end{itemize}
+\end{column}
+
+\hspace{-45pt}\vrule{}\hspace{10pt}
+
\begin{column}{.5\textwidth}
+\underline{\bf Strand 2}\smallskip
\begin{itemize}
+\item one task: prove the correctness of a regular expression matcher in
+the Isabelle theorem prover
+\item 25\%, submission 12.12.
+\end{itemize}
+\end{column}
+\end{columns}\medskip
+
+\small
+\begin{itemize}
+\item Solving more than one strand will {\bf not} give you more
+marks.\\[-2mm]
+\item The exam will contain in much, much smaller form
+elements from both (but will also be in lectures and HW).
+\end{itemize}
+
+\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
\end{document}
%%% Local Variables: