Course detail

Functional and Logic Programming

FIT-FLPAcad. year: 2010/2011

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), and Goedel. Moreover, principles of their implementation are mentioned too.

Language of instruction

Czech

Number of ECTS credits

5

Mode of study

Not applicable.

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/interpretion/compilation) of programming languages, predicate logic.

Co-requisites

Not applicable.

Planned learning activities and teaching methods

Not applicable.

Assesment methods and criteria linked to learning outcomes

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.

Course curriculum

  1. Introduction to functional programming, lambda calculus
  2. Programming language Haskell, introduction, lists
  3. User-defined data types, type classes, and arrays in Haskell
  4. Input/Ouput in Haskell - type classes IO and Monad
  5. Simple applications/programs in Haskell
  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

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 exersises to be answered and solved (there are even questions with selection of one from several predefined answers), 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 exersises to be answered and solved (there are even questions with selection of one from several predefined answers), 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).

Recommended optional programme components

Not applicable.

Prerequisites and corequisites

Not applicable.

Basic literature

  • 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

Recommended reading

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

Classification of course in study plans

  • Programme IT-MGR-2 Master's

    branch MBI , any year of study, summer semester, elective
    branch MSK , any year of study, summer semester, elective
    branch MPS , any year of study, summer semester, elective
    branch MPV , 1. year of study, summer semester, compulsory
    branch MGM , 1. year of study, summer semester, compulsory
    branch MIS , 1. year of study, summer semester, compulsory
    branch MBS , 1. year of study, summer semester, compulsory
    branch MIN , 1. year of study, summer semester, compulsory
    branch MMI , 1. year of study, summer semester, compulsory
    branch MMM , 1. year of study, summer semester, compulsory

Type of course unit

 

Lecture

26 hours, optionally

Teacher / Lecturer

Syllabus

  1. Introduction to functional programming, lambda calculus
  2. Programming language Haskell, introduction, lists
  3. User-defined data types, type classes, and arrays in Haskell
  4. Input/Ouput in Haskell - type classes IO and Monad
  5. Simple applications/programs in Haskell
  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

Exercise in computer lab

12 hours, optionally

Teacher / Lecturer

Syllabus

  1. Introduction to Haskell environment (Hugs), simple functions, recursion, lists
  2. Infinite data structures
  3. User defined data types, input/output
  4. Practical problem
  5. Introduction to Prolog environment (Hugs), lists
  6. Practical problem

Project

14 hours, optionally

Teacher / Lecturer