This lecture introduces fundamental concepts and techniques related to deductive program verification, such as function contracts, loop invariants, termination proofs, ghost code, modeling of data structures, weakest preconditions, etc. A particular focus is made on the use of automated theorem provers in the verification process, and on the building of a standard library for verification. The lecture includes many examples using the Why3 tool and a lot of small exercises in program verification are provided.
We strongly suggest using Why3find. Here are installation instructions:
opam init
opam install why3find alt-ergo
why3find config --detect
(It detects provers available from your PATH,
so be sure z3 and cvc5 binaries can be found.)
why3find prove file.mlw
describes the logic of Why3
the design of ghost code in Why3
verification of pointer programs with Why3
building modular proofs with Why3
how to improve over the traditional way of computing weakest preconditions (this is implemented in Why3)
a rather large case study, with a nontrivial subset of GMP's algorithms verified with Why3
another case study, with the verification of a checker for a railway information system