This page contains lecture highlights and links to lecture notes, reading assignments, and exercises. It will be updated and adjusted as needed as the semester progresses.
Abbreviations: CGFM = "Concise Guide to Formal Methods" textbook; PA = "Practical Alloy" textbook; PP = "Program Proofs" textbook.
Dates | Highlights, Readings, and Exercises |
---|---|
Aug 26 |
Course introduction and administration. Introduction to Formal Methods. What are formal methods and how they help in software development. Required Readings:
Recommended Readings: |
Aug 28 |
More on Formal Methods. Introduction to sets and relations. Recap of basic notions in set theory. Relations and relational operators. Required Readings: Exercises:
|
Sep 2 Sep 4 |
Relations. Functions as relations. Operations on relations. Modeling general software systems. Introduction to the Alloy modeling language. Alloy's foundations. Signatures, fields and multiplicity constraints. Modeling simple domains in Alloy. Generating and analyzing model instances with the Alloy Analyzer. Relations and operations on them. Formulas, Boolean operators and quantifiers. Required Readings:
|
Sep 9 Sep 11 |
Relational operators in Alloy. Expressing constraints on relations using Alloy formulas. Examples of constraints. Operator precedence and parsing. Facts: constraining models with formulas. In-class exercises. Required Readings:
Recommended Readings:
Exercises:
|
Sep 16 Sep 18 |
More on Alloy models. Checking models with the Alloy Analyzer. Signature scopes. Assertions. Checking assertions. Scope restrictions. Functions and predicates. Examples and in-class exercises. Practice with modeling in Alloy: the Academia domain. Required Readings:
Recommended Readings:
Exercises:
|
Sep 23 Sep 25 |
More practice with modeling in Alloy: the Academia domain. Modeling dynamic systems in Alloy. Explicit time modeling. Example: making the family model dynamic. Required Readings:
Exercises:
|
Sep 30 Oct 2 |
Explicit vs. implicit time modelling in Alloy 6. Trace semantics. Temporal operators and their semantics. Examples. General approach to model dynamic systems: state transition systems. Operators. Preconditions, postconditions and frame conditions. Examples of operators for the family model. Required Readings:
Recommended Readings:
Exercises:
|
Oct 7 Oct 9 |
More on modeling and analyzing dynamic systems in Alloy. Family and traffic light examples. Group exercises. A complete Alloy modeling case study: the hotel room lock system. Required Readings:
Recommended Readings:
|
Oct 14 Oct 16 |
Specifying and verifying programs in high-level programming languages. Introduction to Dafny. Method contracts in Dafny. Specifying pre and post-conditions. Compositional verification of methods through the use of contracts. Introduction to Floyd-Hoare logic. Formalizing program behavior with Hoare triples. Strongest postconditions and weakest preconditions. The WP and SP operators. Computing WPs and SPs for assignments. Weakest preconditions and strongest postconditions for variable introduction, and sequential composition. Required Readings:
Recommended Readings:
Exercises:
|
Oct 21 Oct 23 |
Weakest preconditions and strongest postconditions for conditional statements, methods calls, and assert and assume statements. Method vs function calls in Dafny. Partial expressions. Examples in Dafny. Termination of recursive methods and functions. Well founded orders. Required Readings:
Recommended Readings:
Exercises:
|
Oct 28 | Midterm exam |
Oct 30 | [To be determined] |
Nov 4 Nov 6 |
Inductive datatypes. Definition and examples. Lemmas and proofs. Motivation, uses and examples. Required Readings:
Recommended Readings:
Exercises:
|
Nov 11 Nov 13 |
Verifying functional programs over lists. More on lemmas and proofs. Specifying and verifying sorting algorithms. Required Readings:
Recommended Readings:
Exercises:
|
Nov 18 Nov 20 |
Specifying and verifying list sorting algorithms. Insert sort and merge sort.
Specifying and verifying while loops.
Examples.
Loop termination.
Required Readings:
Exercises:
|
Nov 25 Nov 27 |
Fall break |
Dec 2 Dec 4 |
Linear and binary search.
Classes and Objects in Dafny. Specifying classes as abstract data types to separate observable behavior from internal implementation. Examples: counters and alternative implementations of FIFO queues. Required Readings:
Exercises:
|
Dec 9 Dec 11 |
More on abstract view vs. concrete implementation of classes. The FIFO queue example. The use of dynamic frames in Dafny to specify and verify programs using objects. Motivation and uses. Counter, bank account and linked list examples. Required Readings:
|
Dec 16 |
Final Exam |