Static Stability Analysis of Embedded, Autocoded Software
Static Stability Analysis of Embedded, Autocoded Software
Static Stability Analysis of Embedded, Autocoded Software
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
invariants can always be found if the matrix A is stable, and the monotonic decay <strong>of</strong> V isequivalent to the matrix inequality (in the sense <strong>of</strong> the partial order <strong>of</strong> symmetric matrices):A T P A − P ≤ 0Assume such a matrix P is known. A s<strong>of</strong>tware implementation <strong>of</strong> (3) might include severallines <strong>of</strong> code to carry the line x + = Ax, and then several other lines <strong>of</strong> code to implementx = x + . When n > 1, the latter command can raise significant issues, especially if they aredistributed throughout the code as is <strong>of</strong>ten done. Indeed, each line <strong>of</strong> code corresponds to thesubstitution <strong>of</strong> one entry <strong>of</strong> the state vector x at a time. The effect on the invariant is, most<strong>of</strong>ten, disastrous. Indeed, considering for example a substitution <strong>of</strong> pointer values <strong>of</strong> the kindfor (i =0; i < n; i++) {∗(x + i) = ∗(x + + i);}Then the value <strong>of</strong> the invariant V after the first line <strong>of</strong> this recursion is⎡ ⎤T⎡ ⎤a 1 x a 1 xx 2⎥ ⎢ x 2⎥⎢⎣.x n⎥⎦P ⎢⎣where a 1 is the first row <strong>of</strong> the matrix A, and the difference between this and V (x) = x T P x isor⎡⎢⎣a 1 x − x 10.0⎤⎥⎦T⎡⎢⎣a 1 xx 2.x n⎡P x + x T P ⎢⎣⎤⎥⎦T⎡P ⎢⎣a 1 x − x 10.0a 1 xx 2.x n.x n⎤⎤ ⎡⎥⎦ + ⎢⎣⎥⎦ ,⎥⎦ − xT P x,a 1 x − x 10.0⎤⎥⎦T⎡P ⎢⎣a 1 x − x 10the last <strong>of</strong> the three terms is positive, such that the candidate invariant x T P x decays if andonly if, writing a 1 = [a 1 1 a 1 2 . . . a n 1 ] and introducing b = [a 11 − 1 a 1 2 . . . a n 1 ], we have, for anyx:x T b T p 1 x + x T p T 1 bx ≤ 0where p 1 is the first row <strong>of</strong> P . However, it is well known from linear algebra that such aninequality is possible only if b and p 1 are collinear and oriented in the same direction, whichis usually not the case. Thus, the invariant x T P x does not decay line-by-line, and we mustfirst collect the entire substitution <strong>of</strong> x by x + before the invariant decays. This substantiallyconstrains the design <strong>of</strong> the collecting semantics and the static analysis, since all possibleexecution traces <strong>of</strong> a loop must be collected and represented by one semantic object.8.0⎤⎥⎦ .