**Unformatted text preview: **(A Λ B Λ C) D D Their logical interpretation is identical, but the “Rule of Inference” form on the left implies that the writer believes the conditional statement to be True (i.e., valid). 3. (6 pts.) Give an appropriate pre- and post-condition for a program that sets variable I to the index of the first instance of Y in the non-empty array A[1:N], or to -1 if Y is not an element of array A[1:N]. pre-condition: {N≥1} post-condition: {[(1≤I≤N AND A[I]=Y AND for every 1≤k<I, A[k]<>Y) OR (for every 1≤k≤N, A[k]<>Y) AND I=-1] AND UNCH(A,Y)} 4. (6 pts.) Give a conditional function comprised of two (predicate -> rule) pairs using concurrent assignment functions for the following program: if x>0 then x := x-3; y := x+3 end_if f = (x>0 x,y := x-3,x | x≤0 x,y := x,y)...

View
Full Document

- Fall '08
- Thebaut