Indice

Models for Programming Paradigms

MPP 2025/26 (0077A, 9 CFU)

Lecturer: Roberto Bruni web, Filippo Bonchi

Other resources: Microsoft Teams

Office hours: Thursday 15:00-18:00


Objectives

The objective of the course is to present:

The course will cover the basic techniques for assigning meaning to programs with higher-order, concurrent and probabilistic features (e.g., domain theory, logical systems, well-founded induction, structural recursion, labelled transition systems, Markov chains, probabilistic reactive systems, stochastic process algebras) and for proving their fundamental properties, such as termination, normalisation, determinacy, behavioural equivalence and logical equivalence. Temporal and modal logics will also be studied for the specification and analysis of programs. In particular, some emphasis will be posed on modularity and compositionality, in the sense of guaranteeing some property of the whole by proving simpler properties of its parts.


Prerequisites

There are no prerequisites, but the students are expected to have some familiarity with discrete mathematics, first-order logic, context-free grammars, and code fragments in imperative and functional style.


Textbook(s)

Main text:

Other readings:

External resources:


Exam

The evaluation will be solely based on oral exams, which can involve the assignment of written exercises.

Registration to exams (mandatory): Exams registration system

During the oral exam the student must demonstrate


Announcements


Lectures (1st part)

Microsoft Teams: Additional material is available on Teams.

N Date Time Room Lecture notes Links
1 Tue 16/09 16:00-18:00 C1 01 - Introduction to the course

02 - Preliminaries:
from syntax to semantics, the role of formal semantics, SOS approach, small-step operational semantics, big-step operational semantics
2 Thu 18/09 09:00-11:00 L1 02 - Preliminaries (ctd):
denotational semantics, compositionality principle, normalisation, determinacy, consistency, equivalence, congruence

03 - Unification:
inference process, signatures, substitutions, most general than relation, unification problem
3 Fri 19/09 16:00-18:00 L1 03 - Unification (ctd):
unification problem, most general unifiers, unification algorithm

04 - Logical systems:
logical systems, derivations, theorems, logic programs, goal-oriented derivations
4 Exercises:
unification, goal-oriented derivations

05 - Induction:
precedence relation, infinite descending chains, well-founded relations, well-founded induction, mathematical induction, proof of induction principle, structural induction, termination of arithmetic expressions
5 Exercises:
induction

05 - Induction (ctd.):
determinacy of arithmetic expressions, many-sorted signatures, arithmetic and boolean expressions, structural induction over many-sorted signatures, termination of boolean expressions, memories, update operation, operational semantics of commands
6 05 - Induction (ctd.):
divergence, rule for divergence, limits of structural induction, induction on derivations, rule induction, determinacy of commands
7 06 - Equivalence:
operational equivalence, concrete equivalences, parametric equivalences, equivalence and divergence

07 - Induction and recursion:
well-founded recursion, lexicographic precedence relation, Ackermann function, denotational semantics of arithmetic expressions, consistency of operational and denotational semantics for arithmetic expressions, fixpoint equations
8 08 - Partial orders and fixpoints:
partial orders, Hasse diagrams, chains, least element, minimal element, bottom element, upper bounds, least upper bound, limits, complete partial orders, powerset completeness, prefix independence, CPO of partial functions, monotonicity
9 Exercises:
induction, termination, determinacy, divergence

08 - Partial orders and fixpoints (ctd.):
continuity, Kleene's fixpoint theorem, McCarthy's 91 function
10 08 - Partial orders and fixpoints (ctd.):
recursive definitions of partial functions as logical systems, immediate consequences operator, set of theorems as fixpoint

09 - Denotational semantics:
lambda-notation, free variables, capture-avoiding substitutions, alpha-conversion, beta rule, conditionals, denotational semantics of commands, fixpoint computation
11 Exercises:
posets

10 - Consistency:
denotational equivalence, congruence, compositionality principle, consistency of commands, correctness, completeness
12 Exercises:
well-founded recursion, posets, semantics

11 - Haskell:
an overview

Haskell ghci:
basics, tuples, lists, list comprehension, guards, pattern matching, lambda, partial application, zip, exercises
13 Haskell ghci (ctd):
recursive definitions, tail recursion, let-in, where, map, filter, fixpoint operator
14 Haskell ghci (ctd.):
folds, application, function composition, exercises

12 - HOFL:
syntax, pre-terms, types, types judgements, type system, type checking, type inference, principal type
15 12 - HOFL (ctd.):
canonical forms, operational semantics, lazy vs eager evaluation
16 Exercises:
Haskell

13 - Domain theory:
Integers with bottom, cartesian product, projections
17 13 - Domain theory (ctd.):
switching lemma, functional domains, lifting, let notation
18 13 - Domain theory (ctd.):
continuity theorems

14 - Denotational semantics of HOFL:
definition and examples, type consistency, substitution lemma, compositionality
19 13 - Domain theory (ctd.):
continuity theorems, apply, fix, curry, uncurry

14 - Denotational semantics of HOFL (ctd.):
only free variables matters, canonical terms are not bottom

15 - Consistency of HOFL (ctd.):
Counterexample to completeness, correctness of the operational semantics, operational convergence, denotational convergence, operational convergence implies denotational convergence (and vice versa), operational and denotational equivalence, correspondence for type int, unlifted semantics, lifted vs unlifted semantics

Exercises:
HOFL, domains

Lectures (2nd part)

Microsoft Teams: Additional material is available on Teams.

N Date Time Room Lecture notes Links
20 Exercises:
HOFL, domains

16 - Erlang:
an overview
21 Erlang erl:
numbers, atoms, tuples, lists, terms, variables, term comparison, pattern matching, list comprehension, modules, functions, guards, higher order, recursion, pids, spawn, self, send, receive, examples

17 - CCS:
Introduction to concurrency
22 17 - CCS (ctd.)
Syntax, operational semantics, value passing, finitely branching processes, guarded processes
23 18 - Bisimulation:
abstract semantics, graph isomorphism, trace equivalence, bisimulation game, strong bisimulation
24 18 - Bisimulation (ctd.):
strong bisimilarity, strong bisimilarity is an equivalence, strong bisimilarity is a bisimulation, strong bisimilarity is the coarsest strong bisimulation, strong bisimilarity is a congruence, some laws for strong bisimilarity, strong bisimilarity as a fixpoint, strong bisimilarity as a fixpoint, Phi operator, Phi is monotone, Phi is continuous (on finitely branching processes)
25 18 - Bisimulation (ctd.):
Guarded processes (again, from Lecture 17), Knaster-Tarski's fixpoint theorem

19 - Hennessy-Milner logic:
modalities, HML syntax, formula satisfaction, converse of a formula, HML equivalence

20 - Weak Semantics:
weak transitions, weak bisimulation, weak bisimilarity, weak bisimilarity is not a congruence, weak observational congruence, Milner's tau-laws

21 - CCS at work:
modelling imperative programs with CCS
26 21 - CCS at work (ctd.) :
modelling imperative programs with CCS, playing with CCS (using CAAL), modelling and verification of mutual exclusion algorithms with CCS and CAAL

CAAL session (copy the text and paste it in the Edit panel)
27 Exercises:
Erlang, CCS

22 - Temporal and modal logics:
linear temporal logic (LTL), linear structures models, shifting, LTL satisfaction, equivalence of formulas, automata-like models
28 22 - Temporal and modal logics (ctd.):
computational tree logic (CTL* and CTL), infinite trees, infinite paths, branching structure, CTL* satisfaction, equivalence of formulas, CTL formulas, expressiveness comparison, mu-calculus, positive normal form, least and greatest fixpoints, invariant properties, possibly properties, mu-calculus with labels
29 23 - GoogleGo:
an overview

GoogleGo playground:
Go principles, variable declaration, type conversion, multiple assignments, type inference, imports, packages and public names, named return values, naked return, multiple results, conditionals and loops, pointers, struct, receiver arguments and methods, interfaces, goroutines, bidirectional channels, channel types, send, receive, asynchronous communication with buffering, close, select, communicating communication means, range, handling multiple senders, concurrent prime sieve
30 24 - Pi-calculus:
name mobility, free names, bound names, syntax and operational semantics, scope extrusion, early and late bisimilarities, weak semantics
31 Exercises:
logics, GoogleGo, pi-calculus

25 - Measure theory and Markov chains:
probability space, random variables, stochastic processes, homogeneous Markov chains, DTMC, DTMC as matrices, DTMC as PTS, next state probability, ergodic DTMC, steady state distribution, finite path probability
32 25 - Measure theory and Markov chains (ctd):
negative exponential distribution, CTMC, embedded DTMC, infinitesimal generator matrix, CTMC stationary distribution

26 - Probabilistic bisimilarities:
bisimilarity revisited, reachability predicate, CTMC bisimilarity, DTMC bisimilarity, Markov chains with actions, probabilistic reactive systems, bisimilarity for reactive systems, Larsen-Skou logic
33 27 - PEPA:
motivation, basic ideas, PEPA workflow, PEPA syntax, cooperation combinator, bounded capacity, apparent rate, PEPA operational semantics, performance analysis, reward structures
34 Exercises:
Markov chains, probabilistic systems, PEPA
35 Exercises:
Samples from exam exercises
36 Mini-projects:
discussion
End

Past courses