Lecturers: Michael R. Hansen (MRH) and Anne Haxthausen (AH).
Textbook: Introduction to Programming using SML, Hansen and Rischel, Addison Wesley 1999. (Abbreviated HR.)
This part of the course will start with an introduction to the functional programming language SML and declarative modelling using a functional programming language with a strong type system. Later in the course we will touch upon more advanced concepts like program correctness.
The system used in the first part of the courses is Moscow ML, which give an implementation of Standard ML. On this page you can for example see how to download the system on your own computer and there links to other SML resources.
Week | Date | Topic | Read | Exercises | Lecturer |
---|---|---|---|---|---|
36 | 7. Sept. |
Introduction to declarative modelling Introduction to functional programming and SML. Lists (brief introduction) |
HR(1,2) |
Introduction to using SML in the G-databar.
Exercise on polynomials: .ps, .pdf. |
MRH |
37 | 14. Sept. | Tuples, records, lists, modelling | HR(3,4,5(first half)) | Exercises: .ps, .pdf. | MRH |
38 | 21. Sept. | Records, Lists, Modelling | HR(3(pg.39-42)) + HR(5(rest), 6) |
Exercises: HR 6.2, 6.3 | AWB |
39 | 28. Sept. |
One-day project: Piecewise linear curves |
AWB | ||
40 | 5. October | Tagged values, Trees | HR(7,8 (most of)) | Exercises: HR 7.3, 7.4, 8.2, 8.6 | AH |
41 | 12. Oct. |
Trees. Abstract types. Recursion. (New version.) Interpreter for a simple programming language |
HR(8 (rest)) | Some instructions Exercises: HR 8.5, 8.8, Abstract syntax, Program skeleton for interpreter, On Parsers in Moscow ML For more challenges: 8.4 |
AH MRH |
43 | 26. Oct. | Higher-order functions: part 1 , part 2 , part 3 | HR(9) | Exercises: (1) HR 9.1. (2) Give examples of functions on curves (those you made in week 39) that can be revised to use higher order list functions. (3) Complete exercises 8.8 and 8.5 from last week if not already done. (4) For more training/challenges: complete 8.4. |
AH |
44 | 2. Nov. | Sets, Modules. | HR(10, 11) | Exercises: 10.1, 11.4, 11.7, 10.2-3. Set.sig, Set.sml | AH |
45 | 9. Nov. | Tables, Modelling | HR(12, 13) | Exercises: 13.1, 13.2,13.4, 12.1-2 Table.sig, Table.sml | AH |
46 | 16. Nov. | Programming techniques: Iteration and Lazy lists Two old exam questions. Solution Problem 3 and Problem 4 |
HR(17) | Exercises on iteration: 17.1 - 17.4. Lazy lists: exercises and programs |
MRH |
47 | 23. Nov. | Program correctness |
Exercises and solutions. | MRH | |
48 | 30. Nov. | Test Exam. Solutions to the functional part. |
As preparation try: Exam in 49135 from 1999. This was a 4 hours exam, and verification was not in the curriculum that year. |
Solve the following verification problems and the questions from the exam in 49135 from 1999, which you have not already solved. | MRH |
49 | 7. Dec. | 8:15 - 8:45 Lecture on Extended ML 8:55 - 9:15 Evaluation of the functional part 9:20 - 10:00 A real-time logic 10:00 - ... : Questions From 11:00 - 12:00 there will be a teaching assistant in the databar. |
4 lecture notes by Don Sannella: Specifying functions in Extended ML, Proving that a funtion meets its specification, Specifying structures in Extended ML, Proving that a structure meets its specification | MRH, AH |