s09_a6 - + 1, postcondition: ( z-1)( z + 1) = 0 z := z + 2,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
UNIVERSITY OF WATERLOO School of Computer Science CS245 Logic and Computation Spring 2009 ASSIGNMENT 6 (Due: Tuesday, July 21, 2009 at 5:00pm) Use makeCover to produce a cover page for your assignment and hand in your assignment in the CS245 assignment box. Assignments are to be done individually. 1. (8 marks) For each of the following pairs of assignment statement, s , and postconditions, q , determine appropriate precondition, p , which satisfy the triple { p } s { q } . z := z + z , postcondition: 2 z = 20. z := z + y , postcondition: z = y . z := z
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: + 1, postcondition: ( z-1)( z + 1) = 0 z := z + 2, postcondition: z 2 + 5 z =-6 2. (6 marks) Prove or disprove that: ( | false | ) x := 2 x ( | false | ) Justify your answer. 3. (7 marks) Consider the skip command which has the eect of not changing any of the assigned values of any of the program variables. Postulate an axiom for the skip statement similar in form to the assignment axiom and reason why your axiom holds over all appropriate triples....
View Full Document

This note was uploaded on 01/19/2010 for the course CS 246 taught by Professor Wormer during the Spring '08 term at Waterloo.

Ask a homework question - tutors are online