Hoare2: Hoare Logic, Part II

This chapter shows how to write Hoare logic proofs as decorated programs.

Author
Not stated
Published
Undated
Kind
Textbook chapter with exercises, from Software Foundations Volume 2
Original
softwarefoundations.cis.upenn.edu/plf-current/Hoare2.html
Subject
Formal methods and proof

What it is

The page is a chapter of an online course text on programming language foundations. It sets out to make Hoare logic proofs compact and mostly automatic. It ends with an optional section on weakest preconditions.

What it says

What evidence it gives

The chapter works through example programs, including swapping, division, subtraction and parity. It proves in Rocq that its verification condition generator is correct. Many exercises ask for decorations and proofs, such as factorial and Fibonacci.

Interests and limits

Only the prose was read closely; code, formal proofs and most exercises were skimmed. The examples are small programs in a toy language. The chapter does not test its methods on real software.