Logic and Functional Programming

Lecture is addressed to second year students, English.

Organizatorial items

Topics

Grading

  1. 20%: in-class quizzes, individual assignments
  2. 25%: partial exam (quiz) from functional programming
    -- week 8, on the e-learning platform of WUT
  3. 25%: partial exam (quiz) from logic programming
    -- week 14, on the e-learning platform of WUT
  4. 30%: written exam (session)

Links to lecture notes and labworks

  1. Lecture 1: Introduction: Programming paradigms. Characteristics of functional programming.
  2. Lecture 2: Theoretical foundations. The lambda calculus.
  3. Lecture 3: Environment-based computations. Functions as values. Tail recursion. Structural recursion.
  4. Lecture 4: Advanced uses of functions. Local definitions; functions with local state; variadic functions; problem solving strategies.
  5. Lecture 5: Lazy evaluation. Introduction to Haskell.
  6. Lecture 6: Haskell. Overloading and type classes. Algebraic types.
  7. Lecture 7: Type Checking and Type Inference in Haskell. Simulating lazy evaluation in Racket.
  8. Lecture 8: Logic, Logic Programming, and Prolog.
  9. Lecture 9: Foundations of Logic Programming. Unification, SLD-resolution, SLDNF-resolution.
  10. Lecture 10: Recursion in Prolog
  11. Lecture 11: Efficiency issues in Prolog. Declarative and procedural thinking. Controlling the search for answers with cut (!) and fail. Tail recursion. Techniques to write efficient code.
  12. Lecture 12: Working with lists. Difference lists: applications. The maze problem.
  13. Lecture 13: Special applications of Logic Programming (Prolog code)
  14. Lecture 14:

Recommended bibliography:

For functional programming

  1. H. Abelson, G. J. Sussman, and J. Sussman: Structure and Interpretation of Computer Programs. MIT Press, second edition, 1996.
  2. M. Felleisen, R. B. Findler, M. Flatt, and S. Krishnamurthi: How to Design Programs: An Introduction to Programming and Computing. MIT Press, Cambridge, MA, USA, First edition, 2001. Available online here.
  3. M. Marin, V. Negru, I Dramnesc: Principles and Practice of Functional Programming. Editura UVT. 2016.
  4. Simon Thompson: Haskell: The Craft of Functional Programming. Second edition. Pearson Addison Wesley. 1999.
  5. Paul Hudak: The Haskell School of Expression. Learning Functional Programming through Multimedia. Cambridge University Press. 2007 (8th printing).
  6. Haskell tutorialss

For logic programming

  1. W.F. Clocksin and C.S. Mellish: Programming in Prolog. Fifth edition. Springer. 2003.
  2. M.A. Covington et al: Coding Guidelines for Prolog. Theory and Practice of Logic Programming. 12(6): 889-927 (2012) (Highly recommended).
  3. P. Gloess. Constraint Logic Programming (PowerPoint format).