Lectures

This page gives highlights of past lectures and provides lecture notes, reading assignments, and exercises.


Dates Topics and Readings HomeWork
Aug 22
Aug 24

Course introduction and administration. Introduction to Formal Methods.

Introduction to sets and relations.


Required Readings:
  • Syllabus
  • Course overview [pdf] and introduction (revised) [pdf]
  • [Haxt10] An introduction to formal methods, with examples of industrial usage
  • Lecture notes on sets and relations (as needed) [pdf]
Recommended Readings:
  • [vLam00] An introduction to formal specifications, and a survey of formal specification approaches.
  • Chap. 1-2 of [Gara13] A fairly comprehensive recent survey on the use and practice of FM.
  • [Barr13] Notes on expert reports and testimony of the Toyota Unintended Acceleration Litigation.
All exercises in lecture notes
Aug 29
Aug 31

Recap of basic notions in set theory. Relations and relational operators.

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. Expressing constraints on relations using Alloy formulas.


Required Readings:
  • Lecture notes on sets and relations (as needed) [pdf]
  • Lecture notes: An introduction to Alloy 4 - Part 1 [pdf] and 2 [pdf]
Recommended Readings:
All exercises in lecture notes except for those in Part 2
Sep 5
Sep 7

More on the Alloy language. Facts and assertions. Checking models and assertions with the Alloy Analyzer. Examples and exercises.


Required Readings: Recommended Readings:
Exercises in lecture notes
Sep 12
Sep 14

Functions and predicates. Examples.
Practice with modeling in Alloy: the Academia domain. Examples and exercises.
Alloy's module system. Motivations and uses. Parametric modules. An example: the predefined Ordering module.


Required Readings:
  • Lecture notes: an introduction to Alloy 4 - Part 2 [pdf]
  • Lecture notes: the Academia model [pdf]
  • Academia examples from the notes
  • Lecture notes: Alloy Modules [pdf]
Recommended Readings:
All exercises in the Academia model notes
Sep 19
Sep 21

Modeling dynamic systems in Alloy. Example: making the family model dynamic. General approach: dynamic systems as state transition systems. Operators. Preconditions, postconditions and frame conditions. Examples of operators for the family model.


Required Readings:
  • Lecture notes: Dynamic Models in Alloy [pdf]
  • Family examples from the notes
  • Posted solutions for Homework 1
All exercises on page in Dynamic Models notes
Sep 26
Sep 28

More on modeling dynamic systems in Alloy. Example: rovers on a two-dimensional space. Group exercises.
A complete Alloy modeling case study: the hotel room lock system.

Required Readings:
  • Lecture notes on Autonomous Rovers [pdf]
  • The rover.als rover model in dynamic systems examples
  • Lecture notes: Hotel Lock System [pdf]
  • The book/chapter6/hotel*.als sample models (first 2 only) in the Alloy Analyzer
 
Oct 3
Oct 5

Introduction to reactive systems. Introduction to the Lustre specification language.
Examples of Lustre programs. Specifying simple reactive systems in Lustre. Simulating Lustre programs with the Kind 2 tool (online examples).


Required Readings:
  • Lecture notes: Reactive Systems and the Lustre language, Part 1 [pdf]
  • Chap. 1 of [Halb02], a Lustre tutorial
Recommended Readings:
Exercises in Lustre notes
Oct 10

Practice with writing Lustre models and expressing their properties.
Simulating Lustre programs with the Kind 2 tool (online examples).


Required Readings:
  • Lecture notes: Reactive Systems and the Lustre language, Part 1 [pdf] and 2 [pdf]
  • Chap. 1 of [Halb02], a Lustre tutorial
Recommended Readings:
  • [Halb91], the main reference paper for Lustre
  • [Halb99], an introduction to verification and testing with Lustre
Exercises in Lustre notes
Oct 12

Midterm exam

Oct 17
Oct 19

More practice with writing Lustre models and expressing their properties. Checking properties via synchronous observers. Useful temporal operators. A few examples.
Checking properties. Boolean Switches and traffic light examples. In-class exercises.


Required Readings:
  • Lustre examples on the Kind 2 online page except for CruiseController.
Simulate and verify in Kind 2 all Lustre examples in the readings
Oct 24
Oct 26

Contract-based specification and compositional verification. Motivation and uses. Extending Lustre with contracts. Contract basics: assumptions, guarantees and execution modes. Examples of contracts.


Required Readings:
  • Lecture notes: A Mode-aware Contract Language for Reactive System [pdf]
  • StopwatchSpec and ElevatorSpec examples on the Kind 2 online page.
Recommended Readings:
Simulate and verify in Kind 2 the Lustre examples in the readings
Oct 31
Nov 2

Specifying and verifying programs in high-level programming languages. Introduction to Dafny. Main features. Method contracts in Dafny. Specifying pre and post-conditions. Compositional verification of methods through the use of contracts. Abstraction of while loops by loop invariants. Examples.


Required Readings: Recommended Readings:
  • [Wing95], which provides several hints to specifiers
Exercises 0-6 in [Koen12]
Nov 7
Nov 9

More on loop invariants in Dafny. Functions and predicates. Complex specifications using recursive functions. Reading Frames. Termination of while loops and recursive functions in Dafny. Arrays and quantified verification conditions. Loop invariants for arrays. Examples.


Required Readings: Recommended Readings:
Exercises 7-10 in [Koen12]
Nov 14
Nov 16

Introduction to value types in Dafny: sets and sequences. Classes. Constructors, fields and class methods. Class invariants. Ghost fields. Using ghost fields to represent abstract states. Connecting concrete and abstract state in a class. Examples.


Required Readings:
 
Nov 21
Nov 23

No class (Thanksgiving recess)

 
Nov 28
Nov 30

Specifying classes as abstract datatypes to separate observable behavior from internal implementation. Two examples of FIFO queue implementation.
The use of dynamic frames in Dafny to specify and verify programs using objects. Motivation and uses. Queue, counter, bank account and linked list examples.

Required Readings:
 
Dec 5
Dec 7

Introduction to the Lean prover. Motivation and uses. The Lean logic. Examples.

Recommended Readings:
 
Dec 12  

Final Exam

 
 

Copyright: Cesare Tinelli, The University of Iowa, 2017