CS 536 Activities: Proof Outlines, WP and SP
(Note: I changed Question 5 before posting the notes from Monday Oct 25.)
Thu, Oct 28, 2010  Fixed typos in Questions 4 and 5
A. Why?
•
Proof outlines are a shorthand for formal proofs, so they give us an easier way to think
about correctness than formal proofs.
•
Weakest preconditions and strongest postconditions help us expand partial proof
outlines.
B. Outcomes
At the end of this activity you should:
•
Be able to translate partial proof outlines to full proof outlines to formal proofs.
•
Be able to calculate simple weakest preconditions and strongest postconditions.
C. Questions
1.
Calculate
wp
(
if
B
then
x:= x/2
fi
;
y:= x
,
Q
)
2.
Calculate
wp
(
a:= a
*(
ab
);
b:= bc
,
Q
)
3.
Calculate
wp
(
if
x
≥
0
then
x:= x*2
else
x:= y
fi
;
x:= c*x
,
a
≤
x < y
)
4.
Calculate
wp
(
s:= s+i; i:= i+1
,
P
) where
P
is
0
≤
i
≤
n
∧
s = sum(0, i)
. Does
P
∧
i < n
imply this
wp
?
What’s the problem?
5.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 cs536
 formal methods, Illinois Institute of Technology, James Sasaki, proof outlines, partial proof outlines

Click to edit the document details