Lectures

This page summarizes the content of past lectures and provides lecture notes and exercises.

(Jump to most recent class)

Dates Topics and Readings HomeWork
Aug 25
Aug 27

Course introduction and administration. Introduction to Formal Methods.


Required Readings:
  • Syllabus
  • Course overview [pdf] and introduction [pdf]
  • [Haxt10] An introduction to formal methods, with examples of industrial usage
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.
 
 
Sep 1
Sep 3

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.


Required Readings:
  • Lecture notes on sets and relations (as needed) [pdf]
  • Lecture notes: An introduction to Alloy 4 - Part 1 [pdf]
Recommended Readings:
All exercises in lecture notes
 
Sep 08
Sep 10

More on the Alloy language. Relations and operations on them. Formulas, Boolean operators and quantifiers. Expressing constraints on relations using Alloy formulas. Facts and assertions. Checking models and assertions with the Alloy Analyzer.


Required Readings: Recommended Readings:
  • Lecture notes by Dana Nau on First Order Logic, pages 1-22 [pdf]
  • Alloy 4 tutorial, notes by Greg Dennis and Rob Seater, Part I [pdf] and II [pdf]
Exercises in lecture notes
 
Sep 15
Sep 17

Functions and predicates. Practice with modeling in Alloy: the Academia domain.
Examples and exercises.


Required Readings: Recommended Readings:
  • Alloy language reference (as needed) [pdf]
All exercises in the intro to Alloy notes
 
Sep 22
Sep 24

More on the Academia model. Alloy's module system. Motivations and uses. Parametric modules. An example: the predefined Ordering module.


Required Readings: Recommended Readings:
  • util/ordering.als sample model in the Alloy Analyzer
 
 
Sep 29
Oct 1

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


Required Readings:
All exercises on page in Dynamic Models notes
 
Oct 6
Oct 8

Discussion of homework 1 and sample solution.
Introduction to reactive systems. Introduction to the Lustre specification language.
Examples of Lustre programs. Specifying simple reactive systems in Lustre.


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

Practice with writing Lustre models and expressing their properties. Checking properties via synchronous observers.
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]
  • Lustre examples seens in class
  • Notes on synchronous observers
  • 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
 
Oct 20
Oct 22

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


Required Readings: Recommended Readings:
  • [Halb91], the main reference paper for Lustre
  • [Halb99], an introduction to verification and testing with Lustre
Simulate and verify in Kind 2 all Lustre examples seen in class
 
Oct 27
Oct 29

More group exercises on writing requirements for the traffic light example.
Modeling systems and building simulators. The elevator case study.

Discussion of Homework 2 and its solution.


Required Readings:
Exercise 5
 
Nov 3

Midterm exam.

 
Nov 5

Specifying and verifying programs in high-level programming languages. Introduction to Dafny. Main features. Specifying pre and post-conditions. Examples.


Required Readings:
Exercises 0-6 in [Koen12]
 
Nov 10
Nov 12

Discussion of midterm solutions.

More on Dafny. Compositional verification of methods through the use of contracts. Loop invariants. Abstraction of while loops by loop invariants. Functions. Examples.


Required Readings:
  • [Koen12], an introduction to the Dafny language
Recommended Readings:
Exercises 7-10 in [Koen12]
 
Nov 17
Nov 19

Complex specifications using recursive functions. Arrays and quantified verification conditions. Loop invariants for arrays. Predicates. Termination of while loops and recursive functions in Dafny. Reading Frames.
Discussion of sample solutions for Mini-project 2.


Required Readings: Recommended Readings:
All exercises in [Koen12]
 
Nov 24
Nov 26

No class (Thanksgiving recess)

 
 
Dec 1
Dec 3

More on loop invariants for arrays, predicates and termination.
Introduction to value types in Dafny: 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:
 
 
Dec 8
Dec 10

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. Bank account and linked list examples.

Required Readings:
 
 
 

Copyright: Cesare Tinelli, The University of Iowa, 2015   Credits