This page gives highlights of past lectures and provides lecture notes, reading assignments, and exercises.
Dates | Topics, Readings, and Exercises |
---|---|
Aug 22 |
Course introduction and administration. Introduction to Formal Methods. What are formal methods and how they help in software development. Required Readings:
Recommended Readings: |
Aug 24 |
More on Formal Methods. Introduction to sets and relations. Recap of basic notions in set theory. Relations and relational operators. Required Readings: Exercises:
|
Aug 29 Aug 31 |
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. Relational operators. Required Readings:
|
Sep 5 Sep 7 |
More on relational operators in Alloy. Expressing constraints on relations using Alloy formulas. Examples of constraints. Operator precedence and parsing. Exercises. Required Readings:
Recommended Readings:
Exercises:
|
Sep 12 Sep 14 |
More on Alloy models. Facts. 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 19 Sep 21 |
More practice with modeling in Alloy: the Academia domain. Examples and exercises. Modeling dynamic systems in Alloy. Explicit time modeling. Example: making the family model dynamic. Required Readings:
Exercises:
|
Sep 26 Sep 28 |
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 3 Oct 5 |
More on modeling and analyzing dynamic systems in Alloy. Family and traffic light examples. A complete Alloy modeling case study: the hotel room lock system. Required Readings: Recommended Readings:
|
Oct 10 Oct 12 |
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. Required Readings:
Recommended Readings:
Exercises:
|
Oct 17 Oct 19 |
Weakest preconditions and strongest postconditions for variable introduction, sequential composition, 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 24 | Midterm exam |
Oct 26 | No class |
Oct 31 Nov 2 |
More on termination and well founded orders in Dafny. Inductive datatypes. Definition and examples. Lemmas and proofs. Motivation, uses and examples. Required Readings:
Recommended Readings:
Exercises:
|
Nov 7 Nov 9 |
Verifying functional programs over lists. More on lemmas and proofs. Specifying and verifying sorting algorithms. Required Readings:
Recommended Readings:
Exercises:
|
Nov 14 Nov 16 |
Specifying and verifying list sorting algorithms. Insert sort and merge sort.
Specifying and verifying while loops.
Examples.
Loop termination.
Required Readings:
Exercises:
|
Nov 21 Nov 23 |
Fall break |
Nov 28 Nov 30 |
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 5 Dec 7 |
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 12 |
Final Exam |