Notice that when the loop is exited, we require the invariant to be true while clearly the loop-guard must be false. We also require that the final result has been computed. This means that the predicate
( Pinv &and ¬ G ) &rArr Ppost
must be true. If we now substitute the loop-invariant Pinv and post-condition Ppost into this predicate we find that we must find a condition G that makes
(
&and ¬ G
)
&rArr
true.
Notice that if submatrix LTL consists of all of L then
(
&and ( LTL = L )
)
&rArr
is true so that we pick G as G: ¬ ( LTL = L ) which we will write as the condition
G: ( m( LTL ) &ne m( L ) )
where m(X) returns the row dimension of matrix X.[ UPDATE SOURCE ] [ VIEW PDF PS ]