Held: Wednesday, 2 April 2003
Summary: Today we consider an interesting new form of conditional and the formal definition of that form of conditional.
if guard1 -> S1 | guard2 -> S2 | guard3 -> S3 ... | guardn -> Sn fi
if x >= y -> m := x | y >= x -> m := y fi
wp(if G1 | G2 ... | Gn fi, P) =
(for all 1 <= i <= n, domain(Gi))
and (exists 1 <= i <= n, Gi)
and (forall 1 <= i <= n, Gi => wp(Si, P)
guess := a; i := 2; while (i <= n) if guess < a[i] -> guess,i := a[i],i+1 | guess > a[i] -> i := i+1 fi eliwh
if guess < a[i] -> guess,i := a[i],i+1 | guess > a[i] -> i := i+1 fi
Suppose (Q => (for all i Bi)) and (for all i, Q and B => wp(Si, P)). Then Q => wp(if-statement, P).
Tuesday, 7 January 2003 [Samuel A. Rebelsky]
I usually create these pages
on the fly, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Fri May 2 14:20:53 2003.
The source to the document was last modified on Mon Jan 20 12:41:05 2003.
This document may be found at