This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 536: Proof Rules and Proofs Activity 7.1: Verification Proofs for StraightLine Code A. Why? Verification of straightline code (basically, a sequence of assignments/skips) is a good base for verifying larger and more complicated programs. B. Outcomes At the end of this activity you should: Be able to write a short proof of correctness for simple programs involving a sequence of assignments. C. Questions 1. Using the assignment and precondition strengthening rules, fill in the rest of the formal proof below. 1. { ??? } y := x { y } Ass i g n me n t ??? is (y 0)[x/y] is x 0 2. x = y x < 0 x Predicate logic 3. { ??? } y := x { y } Precond. Strengthening, lines 2, 1 x = y x < 0 2. Using the skip and precondition strengthening rules, fill in the rest of the formal proof below. 1. { ??? } skip { y } skip y 2. x = y x y Predicate logic 3. { ??? } skip { y } Precond. Strengthening, l in es 2, 1 x = y x 3. Using the (backward) assignment and composition rules, fill in the rest of the formal proof below. 1. { ??? i+1 n s+i+1 = sum(0,i+1) } Ass i g n me n t i := i+1 { i n s+i = sum(0,i) } Illinois Institute of Technology Activities for Lecture 7 CS 536: Science of Programming  1 of 6  James Sasaki, 2010 2. { ??? i n s+i = sum(0,i) } Ass i g n me n t s := s+i { i n s = sum(0,i) } 3. { ??? i+1 n s+i+1 = sum(0,i+1) } Compos i t i o n 1, 2 i:= i+1; s:= s+i { i n s = sum(0,i) } 4. Using the (backward) assignment and composition rules, fill in the rest of the formal proof below....
View
Full
Document
This note was uploaded on 04/17/2011 for the course CS 536 taught by Professor Cs536 during the Fall '08 term at Illinois Tech.
 Fall '08
 cs536

Click to edit the document details