Plan for 02157 Functional Programming (Autumn 2012)

Teacher: Michael R. Hansen.

Textbook: Functional Programming using F#, Chapters 1-7, 9. Michael R. Hansen and Hans Rischel, Manuscript, 2012. (Abbreviated HR.)

Week Date Topic Read Exercises
36   7. Sept. Course introduction
Introduction to functional programming and F#
Lists (brief introduction)
Lecture1.pdf Lecture1_handout.pdf
HR 1 (a careful reading) and HR 2.1-2.6 (a fast reading) Introduction to using F#.
  1. Exercises to get started: HR 1.1-6
  2. Exercise on polynomials represented by lists and Program skeleton
37   14. Sept. Functions, Basic types and Tuples
Elements of list. Lecture2.pdf Lecture2_handout.pdf
HR 2 and HR 3.1 - 3.7 (excluding 3.3 records)
Browse through HR pages 67-76.
  1. HR 2.1, 2.2, 2.6, 2.7, 2.8
  2. Declare a function to generate the list of prime numbers between m and n
  3. Declare a function to generate the first n prime numbers
  4. Merge sort. A program to generate random lists is here randomList.fsx
38 21. Sept. Lists
Lecture3.pdf Lecture3_handout.pdf
HR 4
  1. HR 4.1, 4.2, 4.3, 4.9, 4.11, 4.22
  2. Solve HR 4.18, 4.19 to improve the map-colouring program
39 28. Sept. Tagged values
Lists - Higher-order functions
Lecture4.pdf Lecture4_handout.pdf
HR 3.8-11
HR 5.1
HR 3.5, 3.6, 5.2, 5.3, 5.5
The curve mini-project. Available on CampusNet
40 5. Oct. Collections: Sets and Maps
Lecture6.pdf Lecture6_handout.pdf
HR 5.2, 5.3
  1. Solve Problem 1 from last year's exam. Available on CampusNet. Make a solution on paper first -- the final exam will be laptop-free. Try out your program. Revise your solution so that the register is modelled as a map.
  2. HR 5.11, 5,7.
  3. Continue with the mini-project on piecewise linear curves.
41 12. Oct. Finite trees (I)
Lecture6.pdf Lecture6_handout.pdf
HR 6 HR 6.2, 6.8, 6.9
42 19. Oct. Autumn vacation
43 26. Oct. Finite trees (II)
- Simple interpreters
Lecture7.pdf
Lecture7_handout.pdf
- Lambda calculus (briefly)
LectureLambda.pdf LectureLambda_handout.pdf
HR 6
Have a look at Lambda Calculus
  1. 6.10. The program you should extend is here.
  2. Interpreter for simple imperative language (see slides) by completion of this program skeleton
  3. Interpreter for Lambda Calculus based language by completion of this program skeleton
44 2. Nov. Efficiency
Lecture8.pdf Lecture8_handout.pdf
HR 9
  1. 9.1, 9.2, 9.3, 9.4, 9.6, 9.9.
  2. Solve the problems 2 and 3 from last year's exam. Available on CampusNet. Make a solution on paper first -- the final exam will be laptop-free.
  3. If you have completed your lambda-calculus interpreter, then you may have a go at the simple sat-solving mini-project that you can find on CampusNet.
45 9. Nov. Modules
Lecture9.pdf Lecture9_handout.pdf Verification (I)
Verification1.pdf Verification1_handout.pdf
HR 7
Notes
  1. 7.2, 7.4, 7.5. Make a curve library (mini-project 1)
  2. Solve verification exercises on the slides and Problem 4 from last year's exam.
46 16. Nov. Sequences
Lecture10.pdf Lecture10_handout.pdf Verification (II)
VerificationII.pdf VerificationII_handout.pdf
Notes: Paulson pages 188-210 The last verification exercise on the slides.
Exam 02157 from 2008 problems 2 and 3, and exam 02157 from 2009 problems 3 and 4.
Available on CampusNet. (F# versions of old exam questions.)
47 23. Nov. Test exam: Starts 8.15 in the auditorium
Questions are now available on CampusNet
At about 10.15: solutions are presented in the auditorium
At about 11.00: a solution to the Lambda-calculus mini-project is presented.
  1. HR 6.7.
  2. Verification problems 1+2 (see CampusNet Folder: Verification Material)
48 30. Nov. Imperative, asynchronous, parallel and monadic programming: A short story
SML briefly.
Lecture12.pdf Lecture12_handout.pdf
  1. Problem 1 from Exam in 02157, 2009. (See CampusNet)
  2. Problems 1-3 from Exam in 02157, 2010. (See CampusNet)
49 7. Dec. Course evaluation
Selected topic (short presentation)
Exercise class


Michael R. Hansen, November 29, 2012