Functional and Logic Programming
Code  Completion  Credits  Range  Language 

A4B33FLP  Z,ZK  6  2P+2C  Czech 
 Vztahy:
 It is not possible to register for the course A4B33FLP if the student is concurrently registered for or has already completed the course AE4B33FLP (mutually exclusive courses).
 During a review of study plans, the course Y33PUI can be substituted for the course A4B33FLP.
 It is not possible to register for the course A4B33FLP if the student is concurrently registered for or has previously completed the course AE4B33FLP (mutually exclusive courses).
 The requirement for course A4B33FLP can be fulfilled by substitution with the course AE4B33FLP.
 The requirement for course A4B33FLP can be fulfilled by substitution with the course Y33PUI.
 It is not possible to register for the course A4B33FLP if the student is concurrently registered for or has previously completed the course Y33PUI (mutually exclusive courses).
 Garant předmětu:
 Lecturer:
 Tutor:
 Supervisor:
 Department of Computer Science
 Synopsis:

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.
 Requirements:

Discrete Mathematics, Logic and Graphs,
Programming 1+2.
 Syllabus of lectures:

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, builtin functions, advanced data structures.
4. Scheme: relations between iterations and tail recursion optimisations guaranteed by the language standard, builtin highorder functions.
5. Scheme: state space search, applications in artificial intelligence.
6. Haskell: types, patterns, builtin 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, closedworld assumption, decidability.
11. Cut and negation. Extralogical operators, arithmetics.
12. Combinatorial search in Prolog.
13. Constraint logic programming.
14. Programming practices, debugging, builtin predicates.
 Syllabus of tutorials:

1. Scheme. First look at Scheme and its environment. Program debugging. Basic examples.
2. Recursion. Accumulator.
3. Lambda abstraction.
4. Tail recursion. Highorder 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,
11. Search algorithms
12. Constraint logic programming
13. Constraint logic programming
14. Credits
 Study Objective:

Learn principles of functional and logic programming in the respective languages LISP and PROLOG.
 Study materials:

P. Flach: Simply Logical, John Wiley 1994
I. Bratko: Prolog programing for AI, Addison Wesley 2001 (3rd edition)
V. Mařík et al: Umělá
inteligence I, II, Academia 1993 (In Czech)
P. Jirků, P. Štěpánek, O. Štěpánková: Programování v Jazyku Prolog, SNTL 1991 (In Czech)
B. O'Sullivan, D. Stewart, and J. Goerzen: Real World Haskell, O'Reilly, November 2008, English, ISBN10: 0596514980, ISBN13: 9780596514983
B. Harvey and M. Wright: Simply Scheme, Introducing Computer Science, MIT Press, 1999
 Note:
 Further information:
 http://cw.felk.cvut.cz/doku.php/courses/a4b33flp/start
 No timetable has been prepared for this course
 The course is a part of the following study plans: