Lec27 - Computer Programming I TA C162. Loop Invariant...

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

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 . 15 Mar 2007 Loop Invariant Definition Examples of loop invariant Algorithm development example sin(x) series
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Computer Programming I TA C162 . 15 Mar 2007 Verification of loop segment - Loop invariant 1. Loop invariant must be true before entering in to the loop. 2. Loop invariant must be true after exiting from the loop. 3. And more importantly it must be true after the segment of  program within the loop has been executed
Background image of page 2
Computer Programming I TA C162 . 15 Mar 2007 Loop Invariant Way to verify the loop segments directly by symbolic execution  because the number of iterations required is usually arbitrary. Definition: It is property that captures the progressive computational role  of the loop while at the same time remaining true before and  after each loop traversal irrespective of how many times the  loop is executed. By the loop invariant one can verify the loop segment.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

Lec27 - Computer Programming I TA C162. Loop Invariant...

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

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