s09_a7 - functionality of the program and then prove that...

Info iconThis preview shows pages 1–2. 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 7 (Due: Tuesday, July 28, 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. (6 marks) Verify that at the end of the following program M contains a value greater than or equal to both of A and B. if (A > B) { M = A; } else { M = B; } 2. (8 marks) Consider the following partially annotated program. Write a postcondition that describes the basic
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: functionality of the program and then prove that the program satises the precondition, postcondition pair. ( | m | ) j = 0; q = 0; while (j != m) { j = j + 1; q = q + x; } 3. (8 marks) Prove partial correctness of the following: ( | ( y ) | ) a = 0; z = 0; while (a != y) { z = z + x; a = a + 1; } ( | z = xy | )...
View Full Document

Page1 / 2

s09_a7 - functionality of the program and then prove that...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online