Title:

# Functional and Logic Programming

Code:FLP
Ac.Year:2012/2013
Term:Summer
Curriculums:
ProgrammeFieldYearDuty
IT-MSC-2MBI-Elective
IT-MSC-2MBS1stCompulsory
IT-MSC-2MGM-Compulsory-Elective - group I
IT-MSC-2MGM1stCompulsory
IT-MSC-2MIN1stCompulsory
IT-MSC-2MIS1stCompulsory
IT-MSC-2MMI1stCompulsory
IT-MSC-2MMM-Compulsory
IT-MSC-2MPV-Compulsory-Elective - group M
IT-MSC-2MSK-Elective
IT-MSC-2EITE2ndElective
Language of Instruction:Czech
Public info:http://www.fit.vutbr.cz/study/courses/FLP/public/
Private info:http://www.fit.vutbr.cz/study/courses/FLP/private/
Credits:5
Completion:credit+exam (written)
Type of
instruction:
Hour/semLecturesSem. ExercisesLab. exercisesComp. exercisesOther
Hours:26201014
ExaminationTestsExercisesLaboratoriesOther
Points:60200020
Guarantor:Kolář Dušan, doc. Dr. Ing., DIFS
Lecturer:Kolář Dušan, doc. Dr. Ing., DIFS
Instructor:Křivka Zbyněk, Ing., Ph.D., DIFS
Židek Stanislav, Ing., DIFS
Faculty:Faculty of Information Technology BUT
Department:Department of Information Systems FIT BUT
Substitute for:
 Functional and Logic Programming (FLP), DIFS

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.
Description:
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.
Knowledge and skills required for the course:
Processing (analysis, evaluation/interpretion/compilation) of programming languages, predicate logic.
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.
Syllabus of lectures:

1. Introduction to functional programming, lambda calculus
2. Programming language Haskell, introduction, lists
3. User-defined data types, type classes, and arrays 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
Syllabus of computer exercises:

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
Syllabus - others, projects and individual work of students:

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).
Fundamental 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
• Jones, S.P.: Haskell 98 Language and Libraries, Cambridge University Press, 2003, p. 272, ISBN 0521826144
Study 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
Controlled instruction:

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