Non-procedural Programming

Non-procedural Programming
Tomáš Dvořák
Spring 2014/15
Lectures
6
¹
Spring Semester 2/2 (Zk, Z)
Wednesday 9:00 - 10:30 SW2
• in 4h block with a practical seminar
:
@
http://ksvi.mff.cuni.cz/~dvorak/vyuka
Examination
written part
oral part
credit necessary before taking exam
2
Lectures
@
Examination
written part
• test of foundations of logic programming
‣ April 1, 2015, 9:00
‣ Prolog, 4 problems, 60 min
• test of foundations of functional programming
‣ May 6, 2015, 9:00
‣ Haskell, 4 problems, 60 min
• final exam
‣ May 27, 2015, 9:00
‣ 1 problem Prolog, 1 problem Haskell
oral part
3
Seminar
¹
Wednesday 10:40 - 12:10 SW2
• in 4h block with lectures
@
Credit Requirements
• program
Prolog (Haskell)
user & developer documentation
test data
• other requirements
attendance
homework assignments
tests
4
Lecturer
K
*
I
Tomáš Dvořák
Tomas.Dvorak at mff.cuni.cz
MS, 4th floor, no. 405
5
Syllabus
Logic programming
• Prolog programs and their interpretation
• unification, backtracking, declarative and
procedural semantics
• lists and recursive data structures
• standard predicates and their uses
• arithmetic
• input and output, defining new operators
• cut and negation
• program efficiency, incomplete data structures
6
Syllabus
Functional Programming
• basics of Lisp (Scheme)
• programming in Haskell
» layout rule, lazy evaluation
» function definitions, currying
» list comprehensions
» definitions of types and data structures
» type classes and instances, polymorphism
» higher order functions
» infinite data structures
» input and output, monads
7
Literature
Prolog
&
&
&
&
William F. Clocksin and Christopher S. Mellish, Programming in
Prolog: Using the ISO Standard, 5th ed., Springer, 2003 (orig. 1981)
Leon Sterling and Ehud Shapiro, The Art of Prolog: Advanced
Programming Techniques, 2nd ed., MIT Press, 1994
Richard A. O'Keefe, The Craft of Prolog, MIT Press, 2009 (orig. 1990)
Ivan Bratko, PROLOG Programming for Artificial Intelligence, 4th ed.,
Addison Wesley, 2011
Lisp
&
Harold Abelson, Gerald Jay Sussman, Structure and Interpretation of
Computer Programs, 2nd ed., MIT Press, 1996
8
Literature
Haskell
&
&
&
&
&
Graham Hutton, Programming in Haskell, Cambridge University
Press, 2007
Bryan O'Sullivan, John Goerzen, Don Stewart, Real World Haskell,
O’Reilly, 2008 [html]
Richard Bird, Thinking Functionally with Haskell, Cambridge
University Press, 2014
Miran Lipovača, Learn You a Haskell for Great Good!, No Starch
Press, 2011 [html]
HaskellWiki haskell.org
9