Functional Data Structures
Prof. Tobias Nipkow, Dr. Mohammad Abdulaziz, Summer semester 2020
 Module: IN2347 SS20
 Lectures: 2 lecture hours per week, Fri 8:3010:00 MI Hörsaal 2
 Tutorials: 2 lecture hours per week, Fri, 12:1513:45 MI Hörsaal 2
 Start of lectures: first week (April 24). Start of tutorials: first week (April 24)
 Tutors: Mohammad Abdulaziz
The course introduces students to the design and analysis of data structures for functional programming languages. It assumes that the students are familiar with functional programming and with running time analysis of algorithms. The course covers a range of functional data structures with an emphasis on their precise analysis. Proofs of both functional correctness and complexity will be a core part of the course. Proofs are carried out with the help of a computerbased proof assistant Isabelle. An introduction to Isabelle is part of the course.
There is an emphasis on search trees and priority queues, but the syllabus is still evolving.At the end of the course students should be familiar with a number of efficient functional data structures and algorithms and should be able able to prove both functional and complexity properties about them with the theorem prover Isabelle.
On this page: Important notices News Written Material Lectures Homework Literature
Important notices
 Prerequesites

 You must be familiar with some functional programming language like Haskell, Objective Caml, Standard ML or F# (e.g. Functional Programming and Verification (IN0003)).
 You must have taken a first course on data structures and algorithms (e.g. Fundamentals of Algorithms and Data Structures (IN0007)).
 You must have taken some basic course in discrete mathematics where you learned about sets, relations and proof principles like induction (e.g. Discrete Structures).
 You need not be familiar with formal logic but you must be motivated to learn how to write precise and detailed mathematical proofs that are checked for correctness by a machine, the theorem prover Isabelle.
 Homework, exam, grading:
 Throughout the course there will be homework assignments. They will involve the use of Isabelle and will be graded. At the end of the course there will be a written or oral examination, depending on the number of students. The final grade will combine the grades from the examination (60%) and the homework (40%).
 Plagiarism:

Discussing ideas and problems with others is encouraged. When working
on homework problems, however, you need to solve and write up the
actual solutions alone. If you misuse the opportunity for
collaboration, we will consider this as
cheating.
Plagiarizing somebody else's homework results in failing the course immediately. This applies for both parties, that is, the one who plagiarized and the one who provided his/her solution.  Language:
 All lectures are in English.
 Isabelle:
 Please install Isabelle 2020 on your computer. You will need Isabelle for (almost) everything, in particular tutorials and homework.
News
 Until further notice, all lectures and tutorials take place
online only. In particular the lectures will be replaced to a large
extent by recorded material. Also, every Friday at 13:00 we will:
 Upload a tutorial video online and provide its link on this webpage.
 Add a sheet that contains the tutorial exercises and the homework to the github repository. Homework solutions should be uploaded to the competition system in the link below by the next Friday at 10:00.
Written Material
All written material (lectures notes, slides, demo material, exercises, homework, ...) will be provided via a github repository, such that you can easily keep up to date.Lectures
Until we can all meet safely in the classroom again, all lectures are will be replaced by video recordings of the same. We will use a mixture of TTT recordings from previous years (2018, 2019) and new recordings. For each Friday (when the lecture would take place) we list which recordings to watch and what to read up to that date: 24.4.: Watch #01 from
2018,
read up to/incl 2.2.5 in progprove.pdf.
Note: at the very end of the lecture I could not demo the last proof (because of a problem with the projector). Do look at the full proof in Demos/List_Demo.thy.  1.5.: Watch #02 from
2019,
read up to/incl 2.5.3 in progprove.pdf
Note: May 1st is a holiday, but we ignore this because classes do not take place on a fixed day at the moment. Promise: we will not cover more material than last year and most likely we can finish one week earlier as a result.  8.5.: Watch #03 from 2019, read up to/incl 3.3 in progprove.pdf
 15.5.: Watch #04 from 2019, read up to/incl 4.1 in progprove.pdf
 22.5.: Watch #05 from 2019, read up to the end of progprove.pdf
 This is the beginning of Part II of the course: Functional Data
Structures. In addition to the videos there are the
slides slidesfds.pdf and a textbookinprogress
bookfds.pdf.
NB: The videos are of last year, but a few details have changed since then, for example in redblack trees. The definitive references are the 2020 theories, the slides and the textbook.
29.5.: Watch #06 and #07 from 2019 (there is an interruption after 10 minutes), read bookfds.pdf up to the end of 2.4 but without 2.3.
Tutorials
Homework
Homework is the heart and soul of this course. It is provided in the repository and needs to be carried out with Isabelle.

Solved homework should be uploaded to the submission system according to the following instructions.
 Register an account in the system and send the tutor an email with your username.
 Select the competition "FDS2020" and submit your solution following the instructions on the website.
 The system will check that your solution can be loaded in Isabelle2018 without any errors and reports how many of the main theorems you were able to prove.
 You can upload multiple times; the last upload before the deadline is the one that will be graded.
 If you have any problems uploading, or if the submission seems to be rejected for reasons you cannot understand, please contact the tutor.
 If you cannot prove a lemma, that you need for a subsequent proof, assume this lemma by using sorry.
 Define the functions as simply as possible. In particular, do not try to make them tail recursive by introducing extra accumulator parameters  this will complicate the proofs!
 All proofs should be straightforward, and take only a few lines.
 Make sure that your submission gets a "Passed" status in the system. We will not grade it otherwise!
 The latest submission date is given on each exercise sheet. Late submissions will not be graded! If you have a good excuse (such as being very sick), you should contact the tutors before the deadline.

Discussing ideas and problems with others is encouraged. When working
on homework problems, however, you need to solve and write up the actual
solutions alone. If you misuse the opportunity for collaboration, we
will consider this as cheating.
Plagiarizing somebody else's homework results in failing the course immediately. This applies for both parties, that is, the one who plagiarized and the one who provided his/her solution.  Important: all homework is graded and contributes 40% towards the final grade.
Literature
There is currently no book that covers the material of the course. However, this is the canonical reference to functional data structures: Chris Okasaki. Purely Functional Data Structures. Cambridge University Press, 1999.