Declarative Programming

A.Y. 2023/2024
6
Max ECTS
48
Overall hours
SSD
INF/01
Language
Italian
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.
Expected learning outcomes
Students will be able to write programs of medium complexity in both paradigms and appreciate their complementary features
Single course

This course can be attended as a single course.

Course syllabus and organization

Single session

Lesson period
Second semester
Course syllabus
Part 1: the functional paradigm (F#)

1.1 Intro
- building blocks
- recursion and iteration
- typing and polymorphism
- algebraic data types
- property based testing
- higher-order functions
- lazy evaluation
- abstract data types
- monads and continuations

1.2 Case studies

1.2.1 Type checking and type inference

--------------------------------------------
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://amomiglianopd.ariel.ctu.unimi.it/v5/home/Default.aspx

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