Functional Programming

Semestr: Summer

Range: 2+2c


Credits: 6

Programme type:

Study form: Fulltime

Course language: English


This course introduces students into the techniques of functional programming in the LISP (or more precisely SCHEME) and HASKELL language and logic programming in the PROLOG language. Both languages are declarative in that the programmer symbolically describes the problem to be solved, rather than enumerating the exact sequence of actions to be taken. In PROLOG, one describes the problem by specifying properties of objects and relations thereamong through logic formulas. In LISP, the problem description takes the form of function definitions. Both languages have found significant applications in artificial intelligence fields, such as agent systems or symbolic machine learning. Motivating tasks from these domains will be used throughout the course.


Course syllabus:

1. Introduction to declarative programming languages. Comparison to classical imperative languages. Introduction to programming for artificial intelligence.
2. Lisp and Scheme: basic language idioms, atoms, lists, recursion.
3. Scheme: lambda abstraction, built-in functions, advanced data structures.
4. Scheme: relations between iterations and tail recursion optimisations guaranteed by the language standard, built-in high-order functions.
5. Scheme: state space search, applications in artificial intelligence.
6. Haskell: types, patterns, built-in functions, lambda abstraction.
7. Haskell: advanced properties of the language in comparison to Scheme.
8. Prolog: facts, rules and queries. Recursion. Query answering.
9. Functions, unification, list operations.
10. Prolog and logic: clauses, Herbrand base, interpretation, model, closed-world assumption, decidability.
11. Cut and negation. Extralogical operators, arithmetics.
12. Combinatorial search in Prolog.
13. Constraint logic programming.
14. Programming practices, debugging, built-in predicates.

Seminar syllabus:

1. Scheme. First look at Scheme and its environment. Program debugging. Basic examples.
2. Recursion. Accumulator.
3. Lambda abstraction.
4. Tail recursion. High-order function.
5. Haskell.
6. Prolog as a database. Facts, rules, queries.
7. Recursion. Program debugging.
8. Unificaton. List operations.
9. List, cut and negation operations.
10. Search algorithms, individual task assignment
11. Search algorithms
12. Constraint logic programming
13. Constraint logic programming
14. Credits


Michaelson, Greg. An introduction to functional programming through lambda calculus. Courier Corporation, 2011.

Touretzky, David S. COMMON LISP: A Gentle Introduction to Symbolic Computation. Courier Corporation, 2013.

Hudak, Paul, and Joseph H. Fasel. "A gentle introduction to Haskell." ACM Sigplan Notices 27.5 (1992): 1-52.

Harvey, Brian, and Matthew Wright. Simply Scheme: introducing computer science. Mit Press, 1999.