In this assignment you will apply Hoare's axiomatic semantics to prove the correctness of a small program.
Let a and b be arrays (indexed from 0 to n-1) of integers.
Prove that the algorithm:
c = 0;
while( c<n ) {
b[c] = a[c];
c=c+1;
}
Meets the postcondition of:
∀i ∈ {0, 1, ..., n-1} | b[i] = a[i]
given the precondition of:
n≥0
Provide your answer in proof outline format, providing all conditions, and justifications for how you derived each condition. You must also prove any verification conditions as well. You may also want to provide some expository prose to help the grader understand why you wrote particular conditions.
Hints:
100 points total.
Turn in your assignment at the start of class.
Back to CSci 420/520 Homepage.
Last changed May 21 2008 15:31:40.
David Coppit,
coppit@cs.wm.edu
There have been 1323531 hits since Thu Jun 9 14:49:55 2005