Programming in logic and functional programming WM-I-U-PWL
1. Basic properties of programming in logic: declarative style, inference mechanism, Horn formulas, controlling of inference/computation. Resolution for propositional calculus.
2. The syntax of first order logic. Herband universe. Horn formulas. Satisfaction relation for Horn formulas. Unification and resolution for first order logic. Theorem on the existence of the most general unifier (MGU).
3. SLD resolution for first order logic. The completeness theorem for resolution and SLD resolution. The undecidability of SLD resolution. The representing of knowledge in Prolog. Basics of the usage of Swi-Prolog interpreter.
4. The meaning of '=' and '=='. Controlling backtracking in Prolog: the order of the choice of clauses for unification, forcing of backtracking, cut, fail. Tracing of a program execution. Meta predicates: clause/2, assert/1, retract/1.
5. Working with files, programming input/output. Debugging the program and tracing the execution. Arithmetic in Prolog. The meaning of 'is' and '=:='.
6. Negation in Prolog. The closed world assumption. SLDNF resolution. Stable models.
7. Recursive data structures: a list, a tree. A method of programming with accumulator. Difference lists.
8. An introduction to lambda calculus. An interpretation of boolean values, conditionals, cartesian product in lambda calculus. Term reductions. The fix point combinator Y.
9. Arithmetics in lambda calculus. Properties of functional programming: referential transparency, stateless programs, non mutable variables, no side effects, functions as first class objects, recursion, lazy evaluation, types, polymorphism, higher order functions.
10. Introduction to Haskell. Basics of syntax, naming conventions, first programs. Basic types: Bool, Char, Int, Integer, Float, Double. A list, an ordered pair, types of functions. Operations of curry and uncurry. Polymorphism. Type classes. Defining types.
11. Defining functions: lambda expressions, composition, recursion, pattern matching. Defining by mutual recursion. Basic operations on lists.
12. Recursive types. Defining functions on recursive types. An implementation of a tree.
13. Programming using continuations and monads. Problems of input/output operations, side effects, non repeatable return values. IO type. Files handling.
14. Infinite objects in Haskell.
15. Elements of functional programming in imperative languages. A fusion of paradigms: functional logic programming. The language Curry.
(in Polish) E-Learning
(in Polish) Grupa przedmiotów ogólnouczenianych
Subject level
Learning outcome code/codes
Type of subject
Course coordinators
Assessment criteria
writing egzam
Bibliography
Clocksin, Mellish, Programming in Prolog, Springer
Nilsson, Małuszyński, Programming in Prolog, Wiley & Sons Ltd, free access: http://www.ida.liu.se/~ulfni53/lpp/
Harold Abelson, Gerald Jay Sussman, Julie Sussman,Structure and Interpretation of Computer Programs,
Paul Hudak, John Peterson, Joseph Fasel,
A Gentle Introduction to Haskell, Version 98, 2000,
free access: https://www.haskell.org/tutorial/
Richard Bird, Introduction to Functional Programming using Haskell.
Simon Peyton Jones (ed.), Haskell 98. Language and Libraries. The Revised Report. 2002, free access: https://www.haskell.org/definition/haskell98-report.pdf
Additional information
Additional information (registration calendar, class conductors, localization and schedules of classes), might be available in the USOSweb system: