SE 504 (Formal Methods and Models)
Spring 2008
Syllabus
Homework Assignments
Homework #1: Developing Predicates
Homework #1: Sample Solutions
Homework #2:
skip
and assignment
Homework #2: Sample Solutions
Homework #3: Catenation and Selection
Homework #4: Repetition
Homework #4b: Repetition Redo
Homework #5: Repetition again, plus some Tail Recursion
Electronic Handouts
Developing predicates from informal statements: A checklist
On Proofs Involving the Replacement of A by B, where A ⇒ B
On the strength/weakness relationship between predicates
Properties/Laws of Hoare triples and the wp predicate transformer
Program Verification Summary
Correctness proofs of some simple programs:
A skip command
An assignment command
A catenation (or sequential composition)
A selection (i.e., if) command target="_blank"
A derivation of a selection (i.e., if) command
Repetition (Looping)
Notes on Loop Invariants
Correctness proof of a program computing 0+1+...+N
Correctness proof of a program involving a repetition (loop) command
When a selection command is nested inside a loop
Development of a linear search program
Development of a program to compute N
3
without multiplication or exponentation
Development of a program to calculate Fibonacci numbers
Development of a program that does negative-positive pair counting in an array
Development of a program for the Maximum Segment Sum Problem
Another (less formal) development of a program for the Maximum Segment Sum Problem
Developing programs to compute tail recursive functions
Arrays
Axioms for the (family of) if functions
Reasoning about arrays
Irrelevant Array Element Axiom
Development of a program for the Prefix Sums Problem
A solution to the Array Decomposition Problem
A solution to the 2-color version of Dutch National Flag Problem
Development of a program for determining the majority of a bag
External Links
Wikipedia entry on Design by Contract
Work by Bertrand Meyer on Program Correctness
Links to Publications
A Framework for Proving Contract-equipped Classes
Towards Practical Proofs of Class Correctness
Proving Pointer Program Properties Part 1: Context and Overview
Proving Pointer Program Properties Part 2: The Overall Object Structure