Declarative Programming
A.Y. 2024/2025
Learning objectives
The aim of the course is to provide the students with a solid understanding of declarative programming, in the functional and logic flavor. The peculiarity of the course is to see the latter as an extension of the former. We will apply the paradigm to several areas, including automated theorem proving and the semantics of programming
languages.
languages.
Expected learning outcomes
Students will be able to write programs of medium complexity in both paradigms and appreciate their complementary features
Lesson period: Second semester
Assessment methods: Esame
Assessment result: voto verbalizzato in trentesimi
Single course
This course can be attended as a single course.
Course syllabus and organization
Single session
Responsible
Lesson period
Second semester
Course syllabus
Part 1: the functional paradigm (F#)
- recursion and iteration
- typing and polymorphism
- algebraic data types
- property based testing
- higher-order functions
- lazy evaluation
- abstract data types
- monads and continuations
--------------------------------------------
Part 2: the relational paradigm
(Twelf)
- facts, rules and queries
- unification and proof search
- examples
+ knowledge representation
+ combinatorial examples (8 queens)
- mode, coverage e termination checking
- PL examples, revisited:
+ interpreters and type checkers for MiniML
+ dependent types for type preserving computations
- recursion and iteration
- typing and polymorphism
- algebraic data types
- property based testing
- higher-order functions
- lazy evaluation
- abstract data types
- monads and continuations
--------------------------------------------
Part 2: the relational paradigm
(Twelf)
- facts, rules and queries
- unification and proof search
- examples
+ knowledge representation
+ combinatorial examples (8 queens)
- mode, coverage e termination checking
- PL examples, revisited:
+ interpreters and type checkers for MiniML
+ dependent types for type preserving computations
Prerequisites for admission
None. We suggest you have taken Logic, programming and Algorithms
Teaching methods
Lectures and labs.
Teaching Resources
Web page:
https://myariel.unimi.it/mod/folder/view.php?id=38751
References:
Parte 1: Functional Programming using F# , Michael R. Hansen and Hans Rischel.
Parte 2: Lecure Notes by Camillo Fiorentini and slides by AM
Additional references: Frank Pfenning:
Logic programming https://www.cs.cmu.edu/~fp/courses/lp/
Computation and Deduction https://www.cs.cmu.edu/~fp/courses/comp-ded/
https://myariel.unimi.it/mod/folder/view.php?id=38751
References:
Parte 1: Functional Programming using F# , Michael R. Hansen and Hans Rischel.
Parte 2: Lecure Notes by Camillo Fiorentini and slides by AM
Additional references: Frank Pfenning:
Logic programming https://www.cs.cmu.edu/~fp/courses/lp/
Computation and Deduction https://www.cs.cmu.edu/~fp/courses/comp-ded/
Assessment methods and Criteria
The exam (three hours long) takes place in the lab and consists of writing short programs on topics covered in the course. The grade on a 1-30 scale will depend on the correctness and elegance of the given solutions. Grades will be communicated on the course home page in an anonymous way
INF/01 - INFORMATICS - University credits: 6
Lessons: 48 hours
Professors:
Fiorentini Camillo, Momigliano Alberto Davide Adolfo
Shifts:
Professor(s)