====== Models for Programming Paradigms ====== {{:magistraleinformatica:mpp:logo-van-gogh-like.png?150 | }} **MPP 2025/26 (0077A, 9 CFU)** Lecturer: **Roberto Bruni** [[http://www.di.unipi.it/~bruni|web]], **Filippo Bonchi** Other resources: [[https://teams.microsoft.com/l/team/19%3AC66XUZJECgys8E7GSFEGLCYhBGIBtw3nGAEb5ndsvuI1%40thread.tacv2/conversations?groupId=083da95a-18f3-4d3e-bd49-d3c1c9e0db3d&tenantId=c7456b31-a220-47f5-be52-473828670aa1|Microsoft Teams]] Office hours: **Thursday 15:00-18:00** ---- ==== Objectives ==== The objective of the course is to present: * different models of computation, * their programming paradigms, * their mathematical descriptions, both //concrete// and //abstract//, * some intellectual tools/techniques for reasoning on models. 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: * Roberto Bruni, Ugo Montanari, "[[http://www.springer.com/978-3-319-42898-7|Models of Computation]]", Springer Texts in Computer Science, 2017. Other readings: * Graham Hutton, "[[http://www.cs.nott.ac.uk/~pszgmh/pih.html|Programming in Haskell]]", 2nd edition, Cambridge University Press (2016). Chapters: 1-8, 14, 15. * Joe Armstrong, [[https://pragprog.com/titles/jaerlang2/programming-erlang-2nd-edition/|Programming Erlang]], 2nd edition. The Pragmatic Bookshelf (2013). Chapters: 1-5, 8, 10-12. * Caleb Doxsey, [[http://shop.oreilly.com/product/0636920046516.do|Introducing Go]], O'Reilly Media (2016). Chapters: 1-4, 6-7, 10. * Robin Milner, "[[https://books.google.it/books/about/Communication_and_Concurrency.html?id=QPyyQgAACAAJ&redir_esc=y|Communication and Concurrency]]", Prentice Hall (1989). Chapters: 1-7, 10. * Luca Aceto, et al, "[[https://www.cambridge.org/core/books/reactive-systems/9B91FFD3996FC77D7AF0C309F8EE4CF7#|Reactive Systems]]", Cambridge University Press (2011). Chapters: 1-7. * Jane Hillston, [[http://www.dcs.ed.ac.uk/pepa/book.pdf|A Compositional Approach to Performance Modelling]], Cambridge University Press (1996). Chapters 1-3. External resources: * [[https://www.haskell.org/|Haskell]] * [[http://www.erlang.org/|Erlang]] * [[http://golang.org/|Google Go]] * [[http://caal.cs.aau.dk/|CAAL]] * [[http://www.dcs.ed.ac.uk/pepa/|PEPA]] ---- ==== Exam ==== The evaluation will be solely based on oral exams, which can involve the assignment of written exercises. Registration to exams (mandatory): [[https://esami.unipi.it/esami/|Exams registration system]] During the oral exam the student must demonstrate * knowledge: his/her knowledge of the course material, and * problem solving: the ability to solve some simple exercises, and * understanding: the ability to discuss the reading matter thoughtfully and with propriety of expression. ---- ==== Announcements ==== * The lecture of **Friday 28/11** has been **canceled** due to conflicting institutional activities of the instructor. * The lecture of **Tuesday 25/11** has been **moved** from 16:00-18:00 to **14:00-16:00 in room D1**. * The lectures of **Thursday 09/10 and Friday (10/10)** have been **canceled** due to orientation activities. * The lecture of **Friday 03/10** has been **canceled** due to general strike. * As the course starts:\\ Each student must subscribe the [[https://teams.microsoft.com/l/team/19%3AC66XUZJECgys8E7GSFEGLCYhBGIBtw3nGAEb5ndsvuI1%40thread.tacv2/conversations?groupId=083da95a-18f3-4d3e-bd49-d3c1c9e0db3d&tenantId=c7456b31-a220-47f5-be52-473828670aa1|Microsoft Teams channel]] of the course and then fill the form [[https://forms.office.com/e/t0vmX0yf7B|Students information]] to provide the following contact data and info about her/his background: - **first name** - **last name** - enrolment number (numero di matricola), optional - **email** - **bachelor degree** (course of study and university) - **MSc course** (if Computer Science, specify which curriculum) * then, fill the (optional) form about your familiarity with some of the subjects of the course: [[https://forms.office.com/e/HrcJK4etV0|Familiar subjects]] ---- ==== Lectures (1st part) ==== [[https://teams.microsoft.com/l/team/19%3AC66XUZJECgys8E7GSFEGLCYhBGIBtw3nGAEb5ndsvuI1%40thread.tacv2/conversations?groupId=083da95a-18f3-4d3e-bd49-d3c1c9e0db3d&tenantId=c7456b31-a220-47f5-be52-473828670aa1|Microsoft Teams]]: Additional material is available on Teams. ^ N ^ Date ^^ Time ^ Room ^ Lecture notes ^ Links ^ | 1 | Tue | 16/09 | 16:00-18:00 | C1 | {{ :magistraleinformatica:mpp:2025-09-16_-_01_-_intro.pdf |01 - Introduction to the course}} | | | 2 | Thu | 18/09 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-09-18_-_02_-_semantics.pdf |02 - Preliminaries}}:\\ //from syntax to semantics, the role of formal semantics, SOS approach, small-step operational semantics, big-step operational semantics, denotational semantics, compositionality principle, normalisation, determinacy, consistency, equivalence, congruence// | | | 3 | Fri | 19/09 | 16:00-18:00 | L1 | Exercises\\ \\ {{ :magistraleinformatica:mpp:2025-09-19_-_03_-_unification.pdf |03 - Unification}}:\\ //inference process, signatures, substitutions, most general than relation, unification problem, most general unifiers, unification algorithm// | | | 4 | Tue | 23/09 | 16:00-18:00 | C1 | Exercises:\\ //unification, goal-oriented derivations//\\ \\ {{ :magistraleinformatica:mpp:2025-09-23_-_04_-_logic.pdf |04 - Logical systems}}:\\ //logical systems, derivations, theorems, logic programs, goal-oriented derivations// | | | 5 | Thu | 25/09 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-09-25_-_05a_-_induction.pdf |05a - Induction}}:\\ //precedence relation, infinite descending chains, well-founded relations, well-founded induction, mathematical induction, proof of induction principle, structural induction, termination of arithmetic expressions, 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 | Fri | 26/09 | 16:00-18:00 | L1 | Exercises:\\ //induction//\\ \\ {{ :magistraleinformatica:mpp:2025-09-26_-_05b_-_more_induction.pdf |05b - More induction (Structural Induction)}}://many-sorted signatures, arithmetic and boolean expressions, structural induction over many-sorted signatures, termination of boolean expressions, memories, update operation, operational semantics of commands// | | | 7 | Tue | 30/09 | 16:00-18:00 | C1 | Exercises:\\ //induction//\\ \\ {{ :magistraleinformatica:mpp:2025-09-30_-_05c_-_rule_induction.pdf |05c - More induction (Rule Induction)}}:\\ //divergence, rule for divergence, limits of structural induction, induction on derivations, rule induction, determinacy of commands// | | | 8 | Thu | 02/10 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-10-02_-_06_-_equivalence.pdf |06 - Equivalence}}:\\ //operational equivalence, concrete equivalences, parametric equivalences, equivalence and divergence//\\ \\ Exercises:\\ //termination, determinacy, divergence//\\ \\ {{ :magistraleinformatica:mpp:2025-10-02_-_07_-_recursion.pdf |07 - Induction and recursion}}:\\ //well-founded recursion, lexicographic precedence relation, Ackermann function, denotational semantics of arithmetic expressions, towards denotational semantics of commands// | | | - | Fri | 03/10 | 16:00-18:00 | L1 | **Canceled:**\\ //General strike// | | | 9 | Tue | 07/10 | 16:00-18:00 | C1 | Exercises:\\ //termination, determinacy, divergence//\\ \\ {{ :magistraleinformatica:mpp:2025-10-07_-_08a_-_cpo.pdf |08a - Partial orders and fixpoints}}:\\ //consistency of operational and denotational semantics for arithmetic expressions, fixpoint equations, 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// | | | - | Thu | 09/10 | 09:00-11:00 | L1 | **Canceled:**\\ //Orientation acitivities// | | | - | Fri | 10/10 | 16:00-18:00 | L1 | **Canceled:**\\ //Orientation acitivities// | | | 10 | Tue | 14/10 | 16:00-18:00 | C1 | **Prof. Bonchi**\\ {{ :magistraleinformatica:mpp:2025-10-14_-_08b_-_kleene.pdf |08b - Partial orders and fixpoints (Kleene's theorem)}}:\\ //monotonicity, continuity, Kleene's fixpoint theorem//\\ \\ Exercises:\\ //well-founded recursion, posets, semantics// | | | 11 | Thu | 16/10 | 09:00-11:00 | L1 | **Prof. Bonchi**\\ {{ :magistraleinformatica:mpp:2025-10-14_-_08c_-_ico.pdf |08c - Partial orders and fixpoints (Immediate Consequence Operator)}}:\\ //McCarthy's 91 function, recursive definitions of partial functions as logical systems, immediate consequences operator, set of theorems as fixpoint//\\ \\ {{ :magistraleinformatica:mpp:2025-10-16_-_09_-_denotational_imp.pdf |09 - Denotational semantics}}:\\ //lambda-notation, free variables, capture-avoiding substitutions, alpha-conversion, beta rule, conditionals, denotational semantics of commands, fixpoint computation// | | | 12 | Fri | 17/10 | 16:00-18:00 | L1 | **Prof. Bonchi**\\ {{ :magistraleinformatica:mpp:2025-10-16_-_10_-_consistency_imp.pdf |10 - Consistency}}:\\ //denotational equivalence, congruence, compositionality principle, consistency of commands, correctness, completeness// | | | 13 | Tue | 21/10 | 16:00-18:00 | C1 | Exercises:\\ //CPO, continuous functions, IMP// | | | 14 | Thu | 23/10 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-10-23_-_11a_-_haskell.pdf |11a - Haskell}}:\\ //an overview, Haskell ghci, basics, tuples, lists, list comprehension, guards, pattern matching, lambda, partial application, zip// | [[https://www.haskell.org/|Haskell]] | | 15 | Fri | 24/10 | 16:00-18:00 | L1 | {{ :magistraleinformatica:mpp:2025-10-24_-_11b_-_haskell.pdf |11b - Haskell GHCi}}:\\ //conditionals, cases, pattern matching, exercises, recursive definitions, let-in, where, map, filter, fixpoint operator, folds, application, function composition// | [[https://www.haskell.org/|Haskell]] | | 16 | Tue | 28/10 | 16:00-18:00 | C1 | {{ :magistraleinformatica:mpp:2025-10-28_-_12a_-_hofl_types.pdf |12a - HOFL}}:\\ //syntax, pre-terms, types, types judgements, type system, type checking, type inference, principal type, type preservation//\\ \\ Exercises:\\ //Haskell, type inference in HOFL// | | | 17 | Thu | 30/10 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-10-30_-_12b_-_hofl_operational.pdf |12b - HOFL}}:\\ //canonical forms, operational semantics, lazy vs eager evaluation//\\ \\ Exercises:\\ //HOFL, typing, operational semantics// | | | 18 | Fri | 31/10 | 16:00-18:00 | L1 | {{ :magistraleinformatica:mpp:2025-10-31_-_13a_-_domains.pdf |13a - Domain theory}}:\\ //Integers with bottom, cartesian product, projections, switching lemma, functional domains, lifting, let notation//\\ \\ Exercises:\\ //domains, HOFL denotational semantics// | | | 19 | Tue | 04/11 | 16:00-18:00 | C1 | {{ :magistraleinformatica:mpp:2025-11-04_-_13b_-_lifted_domains.pdf |13b - Lifted Domains}}:\\ //lifted domains, lifting operator, de-lifting//\\ \\ {{ :magistraleinformatica:mpp:2025-11-04_-_14_-_hofl_denotational.pdf |14 - Denotational semantics of HOFL}}:\\ //definition and examples, type consistency, continuity theorems, apply, fix, curry, uncurry, substitution lemma, compositionality, only free variables matters, canonical terms are not bottom//\\ \\ Exercises:\\ //HOFL, typing, denotational semantics, domains// | | | 20 | Thu | 06/11 | 09:11-18:00 | C1 | {{ :magistraleinformatica:mpp:2025-11-04_-_14_-_hofl_denotational.pdf |14 - Denotational semantics of HOFL (ctd.)}}:\\ //continuity theorems, fix, curry, uncurry, substitution lemma, compositionality, only free variables matters, canonical terms are not bottom//\\ \\ {{ :magistraleinformatica:mpp:2025-11-06_-_15_-_consistency_hofl.pdf |15 - Consistency of HOFL}}:\\ //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// | | ---- ==== Lectures (2nd part) ==== [[https://teams.microsoft.com/l/team/19%3AC66XUZJECgys8E7GSFEGLCYhBGIBtw3nGAEb5ndsvuI1%40thread.tacv2/conversations?groupId=083da95a-18f3-4d3e-bd49-d3c1c9e0db3d&tenantId=c7456b31-a220-47f5-be52-473828670aa1|Microsoft Teams]]: Additional material is available on Teams. ^ N ^ Date ^^ Time ^ Room ^ Lecture notes ^ Links ^ | 21 | Fri | 07/11 | 16:00-18:00 | L1 | {{ :magistraleinformatica:mpp:2025-11-06_-_15_-_consistency_hofl.pdf |15 - Consistency of HOFL (ctd.)}}:\\ //unlifted semantics, lifted vs unlifted semantics//\\ \\ Exercises:\\ //HOFL//\\ \\ {{ :magistraleinformatica:mpp:2025-11-07_-_16a_-_erlang.pdf |16a - Erlang}}:\\ //an overview, 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// | [[http://www.erlang.org/|Erlang]] | | 22 | Tue | 11/11 | 14:00-16:00 | C1 | {{ :magistraleinformatica:mpp:2025-11-11_-_16b_-_google_go.pdf |16b - GoogleGo}}:\\ //an overview, 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// | [[http://golang.org/|Google Go]] | | 23 | Thu | 13/11 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-11-13_-_17_-_ccs.pdf |17 - CCS}}:\\ //Introduction to concurrency, Syntax, operational semantics, value passing, modelling imperative programs with CCS// | | | 24 | Fri | 14/11 | 16:00-18:00 | L1 | {{ :magistraleinformatica:mpp:2025-11-14_-_18a_-_towards_bisimulation.pdf |18a - Towards bisimulation}}:\\ //abstract semantics, graph isomorphism, trace equivalence, bisimulation game// | | | 25 | Tue | 18/11 | 16:00-18:00 | C1 | {{ :magistraleinformatica:mpp:2025-11-18_-_18b_-_ccs_bisimulation.pdf |18b - Bisimulation}}:\\ //strong bisimulation, strong bisimilarity, strong bisimilarity is an equivalence, strong bisimilarity is a bisimulation, strong bisimilarity is the coarsest strong bisimulation, finitely branching processes, strong bisimilarity as a fixpoint, Phi operator, Phi is monotone, Phi is continuous (on finitely branching processes), guarded processes// | | | 26 | Thu | 20/11 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-11-20_-_18c_-_more_bisimulation.pdf |18c - More on bisimulation}}:\\ //some properties of guarded processes, Knaster-Tarski's fixpoint theorem, strong bisimilarity is a congruence, some laws for strong bisimilarity//\\ \\ {{ :magistraleinformatica:mpp:2025-11-20_-_19_-_hml.pdf |19 - Hennessy-Milner logic}}:\\ //modalities, HML syntax, formula satisfaction, converse of a formula, HML equivalence// | | | 27 | Fri | 21/11 | 16:00-18:00 | L1 | {{ :magistraleinformatica:mpp:2025-11-21_-_20_-_weak.pdf |20 - Weak Semantics}}:\\ //weak transitions, weak bisimulation, weak bisimilarity, weak bisimilarity is not a congruence, weak observational congruence, Milner's tau-laws//\\ \\ {{ :magistraleinformatica:mpp:2025-11-21_-_21_-_ccs_at_work.pdf |21 - CCS at work}}:\\ //playing with CCS (using CAAL), modelling and verification of mutual exclusion algorithms with CCS and CAAL// | | | 28 | Tue | 25/11 | **14:00-16:00** | **D1** | CCS at work:\\ //playing with CCS (using CAAL), modelling and verification of mutual exclusion algorithms with CCS and CAAL//\\ \\ {{ :magistraleinformatica:mpp:caal-2025-26.zip |CAAL session}} (copy the text and paste it in the Edit panel) | [[http://caal.cs.aau.dk/|CAAL]] | | 29 | Thu | 27/11 | 09:00-11:00 | L1 | {{ :magistraleinformatica:mpp:2025-11-27_-_22a_-_ltl_ctl.pdf |22a - Temporal logics}}:\\ //linear temporal logic (LTL), linear structures models, shifting, LTL satisfaction, equivalence of formulas, automata-like models, computational tree logic (CTL* and CTL), infinite trees, infinite paths, branching structure, CTL* satisfaction, equivalence of formulas, CTL formulas, expressiveness comparison//\\ \\ {{ :magistraleinformatica:mpp:2025-11-27_-_22b_-_mu_calculus.pdf |22b - Mu-calculus}}:\\ //mu-calculus syntax and semantics// | | | - | Fri | 28/11 | 16:00-18:00 | L1 | **Canceled:**\\ //Conflicting institutional activities of the instructor// | | | 30 | Tue | 02/12 | 16:00-18:00 | C1 | **Prof. Bruni**\\ {{ :magistraleinformatica:mpp:2025-11-27_-_22b_-_mu_calculus.pdf |22b - Mu-calculus}}:\\ //positive normal form, least and greatest fixpoints, invariant properties, possibly properties, mu-calculus with labels//\\ \\ **Prof. Bonchi**\\ KAT:\\ //Calculus of relations// | | | 31 | Thu | 04/12 | 09:00-11:00 | L1 | **Prof. Bonchi**\\ KAT:\\ //Kleene Algebras with Tests// | | | 32 | Fri | 05/12 | 16:00-18:00 | L1 | **Prof. Bonchi**\\ KAT:\\ //Kleene Algebras with Tests// | | | 33 | Tue | 09/12 | 16:00-18:00 | C1 | **Prof. Bonchi**\\ KAT:\\ //Reasoning about IMP programs// | | | 34 | Thu | 11/12 | 09:00-11:00 | L1 | **Prof. Bonchi**\\ KAT:\\ //Reasoning about IMP programs// | | | - | Fri | 12/12 | 16:00-18:00 | L1 | **Canceled:**\\ //General strike// | | | End | | | | | | | ---- ==== Past courses ==== * [[magistraleinformatica:psc:|PSC (A.A. 2024/25)]] * [[magistraleinformatica:psc:2023-24:|PSC (A.A. 2023/24)]] * [[magistraleinformatica:psc:2022-23:|PSC (A.A. 2022/23)]] * [[magistraleinformatica:psc:2021-22:|PSC (A.A. 2021/22)]] * [[magistraleinformatica:psc:2020-21:|PSC (A.A. 2020/21)]] * [[magistraleinformatica:psc:2019-20:|PSC (A.A. 2019/20)]] * [[magistraleinformatica:psc:2018-19:|PSC (A.A. 2018/19)]] * [[magistraleinformatica:psc:2017-18:|PSC (A.A. 2017/18)]] * [[magistraleinformatica:mod:|MOD (A.A. 2016/17)]] * [[magistraleinformatica:mod:2015-16:|MOD (A.A. 2015/16)]] * [[magistraleinformatica:mod:2014-15:|MOD (A.A. 2014/15)]] * [[magistraleinformatica:mod:2013-14:|MOD (A.A. 2013/14)]] ----