


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This course includes software-- development process, process models, project planning, quality assurance, configuration management, process and project metrics, change, re-engineering, risk analysis and management and project management. This lecture includes: Loop, Invariants, Elements, Incremented, Weakest, Precondition, Condition, Termination, True
Typology: Slides
1 / 4
This page cannot be seen from the preview
Don't miss anything!



s = s + a[i];
What is the ‘loop invariant’?
s is the sum of elements from a[1] to a[i] immediately before i is incremented!
-^ Let W be while B do S -^ condition for termination of the loopP
0 (not B) P^1
^ B and wp(S,P
)^0
^ wp(S, not B)
Pk
^ B and wp(S, P
)k-
wp(W, not B)
(k: k
)k docsity.com
a = 0;i = 0;while (i < N)
a = a + i++; Loop Invariant: a =
i