Course detail

Functional and Logic Programming

FIT-FLPAcad. year: 2019/2020

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.

Learning outcomes of the course unit

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.
Use and understanding of recursion for expression of algorithms.

Prerequisites

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

Co-requisites

Not applicable.

Recommended optional programme components

Not applicable.

Recommended or required reading

Podklady k přednáškám (slajdy, ukázky, ...)
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
Bieliková, M., Návrat, P.: Funkcionálne a logické programovanie, Vydavateĺstvo STU, Vazovova 5, Bratislava, 2000.
Jones, S.P.: Haskell 98 Language and Libraries, Cambridge University Press, 2003, p. 272, ISBN 0521826144

Planned learning activities and teaching methods

Not applicable.

Assesment methods and criteria linked to learning outcomes

  • 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.

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.

Language of instruction

Czech

Work placements

Not applicable.

Aims

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

Specification of controlled education, way of implementation and compensation for absences


  • 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).

Classification of course in study plans

  • Programme IT-MGR-2 Master's

    branch MBI , any year of study, summer semester, 5 credits, optional
    branch MPV , any year of study, summer semester, 5 credits, compulsory-optional
    branch MGM , any year of study, summer semester, 5 credits, compulsory-optional
    branch MSK , any year of study, summer semester, 5 credits, optional
    branch MMM , any year of study, summer semester, 5 credits, compulsory

  • Programme MITAI Master's

    specialization NEMB , any year of study, summer semester, 5 credits, compulsory

  • Programme IT-MGR-2 Master's

    branch MIS , 1. year of study, summer semester, 5 credits, compulsory
    branch MBS , 1. year of study, summer semester, 5 credits, compulsory
    branch MIN , 1. year of study, summer semester, 5 credits, compulsory
    branch MMI , 1. year of study, summer semester, 5 credits, compulsory

  • Programme MITAI Master's

    specialization NADE , 1. year of study, summer semester, 5 credits, compulsory
    specialization NBIO , 1. year of study, summer semester, 5 credits, compulsory
    specialization NGRI , 1. year of study, summer semester, 5 credits, compulsory
    specialization NNET , 1. year of study, summer semester, 5 credits, compulsory
    specialization NVIZ , 1. year of study, summer semester, 5 credits, compulsory
    specialization NCPS , 1. year of study, summer semester, 5 credits, compulsory
    specialization NSEC , 1. year of study, summer semester, 5 credits, compulsory
    specialization NHPC , 1. year of study, summer semester, 5 credits, compulsory
    specialization NISD , 1. year of study, summer semester, 5 credits, compulsory
    specialization NIDE , 1. year of study, summer semester, 5 credits, compulsory
    specialization NISY , 1. year of study, summer semester, 5 credits, compulsory
    specialization NMAL , 1. year of study, summer semester, 5 credits, compulsory
    specialization NMAT , 1. year of study, summer semester, 5 credits, compulsory
    specialization NSEN , 1. year of study, summer semester, 5 credits, compulsory
    specialization NVER , 1. year of study, summer semester, 5 credits, compulsory
    specialization NSPE , 1. year of study, summer semester, 5 credits, compulsory

Type of course unit

 

Lecture

26 hours, optionally

Teacher / Lecturer

Syllabus


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

Computer exercise

12 hours, compulsory

Teacher / Lecturer

Syllabus

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

Projects

14 hours, compulsory

Teacher / Lecturer

Syllabus


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

eLearning