Act10_Q2Study_Find_Inv - Illinois Institute of Technology...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Writing Correct Programs; Finding Invariants CS 536, Mon Nov 8, 2010 Study Guide for Quiz 2 Quiz 2 will cover Lectures 6 – 9 except that loop termination and Activity 9.2 will not be included. (Activity 9.1 is included.) You’ll be given a list of the proof rules (forward and backward assignment, skip , sequence, conditional, while loop). Basic topics include: Textual substitution e [ e / v ] and P [ e / v ] (Activity 6.1, HW 4). Substitution into expressions and non-quantiFed predicates. E.g., (x/y)[z+1/y] is x/(z+1) , and (x > y > z)[z+1/y] is x > z+1 > z . Substitution into quantiFed predicates. Body shielded by bound variable (substitution does nothing). E.g. (x = y*z x.x < y)[z+1/x] is z+1 = y*z x.x < y . Body not shielded, but no capture will occur. E.g. (x = y*z x.x < y)[z+1/y] is x = (z+1)*z x.x < z+1 . Body not shielded, capture would occur (so rename bound variable). E.g. (x = y*z x.x < y)[x-1/y] is x = (x-1)*z v.v < x-1 . Iterated substitution: Work from left to right. E.g., (x/y)[x+1/y][c/x] is (x/(x+1))[c/x] is c/(c+1) . Proof rules for correctness triples (Activity 6.2, HW 4). ±or the rules for assignment, skip , sequence, conditional, loop, consequence / precondition strengthening / postcondition weakening: Verify that a proof rule has been applied correctly. E.g., does {
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the 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.

Page1 / 4

Act10_Q2Study_Find_Inv - Illinois Institute of Technology...

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