Course details

# Functional and Logic Programming

FLP Acad. year 2020/2021 Summer semester 5 credits

Practical applications and broader introduction into lambda calculus and predicate logic within the context of functional and logic programming languages. Within functional programming, abstract data types are discussed, as well as the use of recursion and induction, manipulation of lists and infinite data structures in language Haskell. Experience in logic programming is gained in programming languages Prolog (cut operator, state space search, database modification), CLP, and Goedel. Moreover, principles of their implementation are mentioned too.

Guarantor

Deputy Guarantor

Language of instruction

Completion

Time span

Assessment points

Department

Lecturer

Instructor

Course Web Pages

Subject specific learning outcomes and competences

Students will get basic knowledge and practical experience in functional and logic programming (two important representatives of declarative programming). Moreover, they will get basic information about theoretical basis of both paradigms and implementation techniques.

Generic learning outcomes and competences

Use and understanding of recursion for expression of algorithms.

Learning objectives

Obtaining a basic knowledge and practical experience in functional and logic programming. Introduction into formal concepts used as a theoretical basis for both paradigms.

Why is the course taught

Purely declarative programming languages are such a phenomenon, which enables to get a new viewpoint on many problems and, thus, one can obtain new, original solutions.

Prerequisite kwnowledge and skills

Processing (analysis, evaluation/interpretation/compilation) of programming languages, predicate logic.

Study literature

- Lecture materials (slides, demos, etc.)
- Lipovača, M.: Learn You a Haskell for Great Good!, No Starch Press, 2011, ISBN-13: 978-1-59327-283-8
- Thompson, S.: Haskell, The Craft of Functional Programming, ADDISON-WESLEY, 1999, ISBN 0-201-34275-8
- Nilsson, U., Maluszynski, J.: Logic, Programming and Prolog (2ed), John Wiley & Sons Ltd., 1995
- Hill, P., Lloyd, J.: The Gödel Programming Language, MIT Press, 1994, ISBN 0-262-08229-2

Fundamental literature

- Lipovača, M.: Learn You a Haskell for Great Good!, No Starch Press, 2011, ISBN-13: 978-1-59327-283-8
- Thompson, S.: Haskell, The Craft of Functional Programming, ADDISON-WESLEY, 1999, ISBN 0-201-34275-8
- Nilsson, U., Maluszynski, J.: Logic, Programming and Prolog (2ed), John Wiley & Sons Ltd., 1995
- Hill, P., Lloyd, J.: The Gödel Programming Language, MIT Press, 1994, ISBN 0-262-08229-2
- Jones, S.P.: Haskell 98 Language and Libraries, Cambridge University Press, 2003, p. 272, ISBN 0521826144

Syllabus of lectures

- Introduction to functional programming
- Lambda calculus
- Programming language Haskell, introduction, lists
- User-defined data types, type classes, and arrays in Haskell
- Input/Output in Haskell - type classes IO and Monad
- Proofs in functional programming
- Denotational semantics, implementation of functional languages
- Introduction to logic programming, Prolog
- Lists, cut operator, and sorting in Prolog
- Data structures, text strings, operators - extensions of SWI Prolog
- Searching state space, clause management, and parsing in Prolog
- Goedel - logic programming language not using Horn clauses
- Implementation of logic languages, CLP, conclusion

Syllabus of computer exercises

- Haskell - basic language features, recursion, lists, partial application, higher-order functions (map, filter, foldX), infinite lists, partial evaluation
- Haskell - data types, monads, I/O
- Haskell - demonstration - construction of a simple interpreter using library Parsec
- Prolog - program structure, recursion, lists
- Prolog - dynamic predicates, advanced example on dynamic predicates
- Prolog - more advanced examples, tests on variable instantiation, state space search

Syllabus - others, projects and individual work of students

- A simple program in Haskell programming language (Hugs, GHC, GHCi).
- A simple program in Prolog/Gödel/CLP(R) (SWIPL, Gödel, CiaoProlog).

Progress assessment

- Mid-term exam, for which there is only one schedule and, thus, there is no possibility to have another trial.
- Two projects should be solved and delivered in a given date during a term.

Controlled instruction

- Mid-term exam - written form, questions and exercises to be answered and solved, no possibility to have a second/alternative trial - 20 points.
- Projects realization - 2 projects, implementation of a simple program according to the given specification - one in a functional programming language the other in a logic programming language - 20 points all projects together.
- Final exam - written form, questions and exercises to be answered and solved, 2 another corrections trials possible (60 points - the minimal number of points which can be obtained from the final exam is 25, otherwise, no points will be assigned to a student).

Exam prerequisites

At the end of a term, a student should have at least 50% of points that he or she could obtain during the term; that means at least 20 points out of 40. Plagiarism and not allowed cooperation will cause that involved students are not classified and disciplinary action can be initiated.

Schedule

Day | Type | Weeks | Room | Start | End | Lect.grp | Groups | Info |
---|---|---|---|---|---|---|---|---|

Mon | lecture | lectures | E104 E105 E112 | 13:00 | 15:50 | 1MIT 2MIT | NBIO - NSPE NEMB xx | |

Mon | comp.lab | lectures | N204 N205 | 18:00 | 19:50 | 1MIT 2MIT | xx | |

Tue | comp.lab | lectures | N204 N205 | 18:00 | 19:50 | 1MIT 2MIT | xx | |

Thu | comp.lab | lectures | N204 N205 | 17:00 | 18:50 | 1MIT 2MIT | xx | |

Thu | comp.lab | lectures | N204 N205 | 19:00 | 20:50 | 1MIT 2MIT | xx |

Course inclusion in study plans

- Programme IT-MSC-2, field MBI, MSK, any year of study, Elective
- Programme IT-MSC-2, field MBS, MIN, MIS, MMI, 1st year of study, Compulsory
- Programme IT-MSC-2, field MGM, any year of study, Compulsory-Elective group I
- Programme IT-MSC-2, field MMM, any year of study, Compulsory
- Programme IT-MSC-2, field MPV, any year of study, Compulsory-Elective group M
- Programme MITAI, specialisation NADE, NBIO, NCPS, NGRI, NHPC, NIDE, NISD, NISY, NMAL, NMAT, NNET, NSEC, NSEN, NSPE, NVER, NVIZ, 1st year of study, Compulsory
- Programme MITAI, specialisation NEMB, any year of study, Compulsory