State of Practice Jerome C. Hunsaker Visiting Professor Department - - PowerPoint PPT Presentation

state of practice
SMART_READER_LITE
LIVE PREVIEW

State of Practice Jerome C. Hunsaker Visiting Professor Department - - PowerPoint PPT Presentation

Automatic Verification of Embedded Control Software with ASTRE and beyond Patrick Cousot State of Practice Jerome C. Hunsaker Visiting Professor Department of Aeronautics and Astronautics, MIT c o u s o t mi t e d u w w w . mi t . e d u /


slide-1
SLIDE 1

Automatic Verification of Embedded Control Software with ASTRÉE and beyond Patrick Cousot

Jerome C. Hunsaker Visiting Professor Department of Aeronautics and Astronautics, MIT

c o u s o t mi t e d u w w w . mi t . e d u / ~ c o u s o t

École normale supérieure, Paris

c o u s o t e n s f r w w w . d i . e n s . f r / ~ c o u s o t

Workshop on Critical Research Areas in Aerospace Software

  • Aero. Astro. Dept., MIT, August 9th, 2005

State of Practice

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 2 — ľ P. Cousot

An example among many others (Matlab code)

» h=get(gca,’children’); apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.ArrayIndexOutOfBoundsException: 2 >= 2 java.lang.ArrayIndexOutOfBoundsException: 2 >= 2 at java.util.Vector.elementAt(Vector.java:431) at com.mathworks.mde.help.IndexItem.getFilename(IndexItem.java:100) at com.mathworks.mde.help.Index.getFilenameForLocation(Index.java:706) at com.mathworks.mde.help.Index.access$3100(Index.java:29) at com.mathworks.mde.help.Index$IndexMouseMotionAdapter.mouseMoved(Index.java:768) at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:272) at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271) at java.awt.Component.processMouseMotionEvent(Component.java:5211) at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2779) at com.mathworks.mwswing.MJTable.processMouseMotionEvent(MJTable.java:725) at java.awt.Component.processEvent(Component.java:4967) at java.awt.Container.processEvent(Container.java:1613) at java.awt.Component.dispatchEventImpl(Component.java:3681) at java.awt.Container.dispatchEventImpl(Container.java:1671) at java.awt.Component.dispatchEvent(Component.java:3543) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3255) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172) at java.awt.Container.dispatchEventImpl(Container.java:1657) at java.awt.Window.dispatchEventImpl(Window.java:1606) at java.awt.Component.dispatchEvent(Component.java:3543) at java.awt.EventQueue.dispatchEvent(EventQueue.java:456) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170) at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) » Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 3 — ľ P. Cousot

The software challenge for next 10 years

  • Present-day software engineering is almost exclusively

manual, with very few automated tools;

  • Trust and confidence in specifications and software can

no longer be entirely based on the development process (e.g. DO178B);

  • In complement, quality assurance must be ensured by

new design, modeling, checking, verification and certi- fication tools based on the product itself.

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 4 — ľ P. Cousot

slide-2
SLIDE 2

State of the Art in Automatic Static Program Analysis

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 5 — ľ P. Cousot

Static analysis tools

  • Determine automatically from the program text pro-

gram properties of a certain class that do hold at run- time (e.g. absence of runtime error);

  • Based on the automatic computation of machine repre-

sentable abstractions 1 of all possible executions of the program in any possible environment;

  • Scales up to hundreds of thousands lines;
  • Undecidable whence false alarms are possible 2

1 sound but (in general) uncomplete approximations. 2 cases when a question on the program runtime behavior cannot be answered automatically for sure

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 6 — ľ P. Cousot

Degree of specialization

  • Specialization for a class of runtime properties (e.g. ab-

sence of runtime errors)

  • Specialization for a programming language (e.g. PolySpace

Suite for Ada, C or C++)

  • Specialization for a programming style (e.g. C Global

Surveyor)

  • Specialization for an application type (e.g. ASTRÉE for

embedded real-time synchronous 3 autocodes) ) The more specialized, the less false alarms 4!

3 deterministic 4 but the less specialized, the larger commercial market (and the less client satisfaction)!

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 7 — ľ P. Cousot

The ASTRÉE static analyzer

  • ASTRÉE is a static program analyzer aiming at proving

the absence of Run Time Errors (started Nov. 2001)

  • C programs, no dynamic memory allocation and recur-

sion

  • Encompass many (automatically generated) synchro-

nous, time-triggered, real-time, safety critical, embed- ded software

  • automotive, energy and aerospace applications

) e.g. No false alarm on the electric flight control codes for the A340 (Nov. 2003) and A380 (Nov. 2004) gener- ated from SAO/SCADE.

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 8 — ľ P. Cousot

slide-3
SLIDE 3

Ellipsoid Abstract Domain for Filters

2d Order Digital Filter:

j

Switch
  • a

b i z-1

Unit delay

z-1 B

+ + +

t x(n)

Unit delay Switch Switch
  • Computes X n =

 ¸ X n` 1 + ˛ X n` 2 + Yn I n

  • The concrete computation is bounded, which

must be proved in the abstract.

  • There is no stable interval or octagon.
  • The simplest stable surface is an ellipsoid.

X U F(X) X F(X) F(X) X X U F(X)

execution trace unstable interval stable ellipsoid

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 9 — ľ P. Cousot

Filter Example

t y pedef enum { FALSE = 0, TRUE = 1} BOOLEAN; BOOLEAN I NI T; f l oat P, X; v oi d f i l t er ( ) { s t at i c f l oat E[ 2] , S[ 2] ; i f ( I NI T) { S[ 0] = X; P = X; E[ 0] = X; } el s e { P = ( ( ( ( ( 0. 5 * X)

  • ( E[ 0]

*

  • 0. 7) )

+ ( E[ 1] *

  • 0. 4) )

+ ( S[ 0] *

  • 1. 5) )
  • ( S[ 1]

*

  • 0. 7) ) ;

} E[ 1] = E[ 0] ; E[ 0] = X; S[ 1] = S[ 0] ; S[ 0] = P; / * S[ 0] , S[ 1] i n [ - 1327. 02698354,

  • 1327. 02698354]

* / } v oi d mai n ( ) { X = 0. 2 * X + 5; I NI T = TRUE; whi l e ( 1) { X = 0. 9 * X + 35; / * s i mul at ed f i l t er i nput * / f i l t er ( ) ; I NI T = FALSE; } } Reference see h t t p : / / w w w . a s t r e e . e n s . f r /

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 10 — ľ P. Cousot

Arithmetic-geometric progressions

  • Abstract domain: (R + )5

5

  • Concretization (any function bounded by the arithmetic-

geometric progression): ‚ 2 (R + )5 7 ` ! } (N 7 !

R )

‚ (M ; a; b; a0 ; b ) = f f j 8k 2 N : jf (k)j » “ –x . ax + b ‹ (–x . a0 x + b )k” (M )g

Reference see h t t p : / / w w w . a s t r e e . e n s . f r / 5 here in R

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 11 — ľ P. Cousot

Arithmetic-Geometric Progressions (Example 1)

% c at c ount . c t y pedef enum { FALSE = 0, TRUE = 1} BOOLEAN; v ol at i l e BOOLEAN I ; i nt R; BOOLEAN T; v oi d mai n( ) { R = 0; whi l e ( TRUE) { __ASTREE_l og_v ar s ( ( R) ) ; i f ( I ) { R = R + 1; } el s e { R = 0; } T = ( R >= 100) ; __ASTREE_wai t _f or _c l oc k ( ( ) ) ; } } % c at c ount . c onf i g __ASTREE_v ol at i l e_i nput ( ( I [ 0, 1] ) ) ; __ASTREE_max _c l oc k ( ( 3600000) ) ; % as t r ee –ex ec - f n mai n –c onf i g- s em c ount . c onf i g c ount . c | gr ep ’ | R| ’ | R| <= 0. + c l oc k * 1. <= 3600001.

potential overflow!

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 12 — ľ P. Cousot

slide-4
SLIDE 4

Arithmetic-geometric progressions (Example 2)

% c at r et r o. c t y pedef enum { FALSE=0, TRUE=1} BOOL; BOOL FI RST; v ol at i l e BOOL SW I TCH; v ol at i l e f l oat E; f l oat P, X, A, B; v oi d dev ( ) { X=E; i f ( FI RST) { P = X; } el s e { P = ( P - ( ( ( ( 2. 0 * P)

  • A)
  • B)

*

  • 4. 491048e- 03) ) ;

} ; B = A; i f ( SW I TCH) { A = P; } el s e { A = X; } } v oi d m ai n( ) { FI RST = TRUE; whi l e ( TRUE) { dev ( ) ; FI RST = FALSE; __ASTREE_wai t _f or _c l oc k ( ( ) ) ; } } % c at r et r o. c onf i g __ASTREE_v ol at i l e_i nput ( ( E [ - 15. 0,

  • 15. 0] ) ) ;

__ASTREE_v ol at i l e_i nput ( ( SW I TCH [ 0, 1] ) ) ; __ASTREE_m ax _c l oc k ( ( 3600000) ) ;

| P| <= ( 15. + 5. 87747175411e- 39 /

  • 1. 19209290217e- 07)

* ( 1 +

  • 1. 19209290217e- 07) ˆ c l oc k
  • 5. 87747175411e- 39 /
  • 1. 19209290217e- 07 <=
  • 23. 0393526881

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 13 — ľ P. Cousot

Towards System Verification Tools

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 14 — ľ P. Cousot

Computer controlled systems Approximations: program ! precise, system ! precise

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 15 — ľ P. Cousot

Software test Abstractions: program ! none, system ! precise

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 16 — ľ P. Cousot

slide-5
SLIDE 5
  • Very expensive
  • Not exhaustive
  • Extended during flight test period
  • Late discovery of errors can delay the program by months

(the whole software development process must be rechecked)

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 17 — ľ P. Cousot

Software analysis & verification with ASTRÉE

  • Abstractions: program !

precise, system ! coarse

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 18 — ľ P. Cousot

  • Exhaustive
  • Can be made precise by specialization 6 to get no false

alarm

  • No specification of the controlled system (but for ranges
  • f values of a few sensors)
  • Impossible to prove essential properties of the controlled

system (e.g. controlability, stability)

6 To specific families of properties and programs

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 19 — ľ P. Cousot

System analysis & verification by control engineers Abstractions: program ! imprecise, system ! precise

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 20 — ľ P. Cousot

slide-6
SLIDE 6
  • The controler model is a rough abstraction of the con-

trol program:

  • Continuous, not discrete
  • Limited to control laws
  • Does not take into account fault-tolerance to fail-

ures and computer-related system dependability.

  • In theory, SDP-based search of system invariants (Lyapunov-

like functions) can be used to prove reachability and inevitability properties

  • Problems to scale up (e.g. over long periods of time)
  • In practice, the system/controler model is explored by

discrete simulations (testing)

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 21 — ľ P. Cousot

Exploring new avenues in static analysis

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 22 — ľ P. Cousot

System analysis & verification, Avenue 1 Abstractions: program ! precise, system ! precise

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 23 — ľ P. Cousot

  • Exhaustive (contrary to current simulations)
  • Traditional abstractions (e.g.

polyhedral abstraction with widening) seem to be too imprecise

  • Currently exploring new abstractions (issued from con-

trol theory like ellipsoidal calculus using SDP)

  • Prototype implementation in construction!

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 24 — ľ P. Cousot

slide-7
SLIDE 7

System analysis & verification, Avenue 2 Abstractions: program ! precise, system ! precise

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 25 — ľ P. Cousot

  • Example of invariant translation: ellipsoidal ` !

polyhedral 7

  • The static analysis is easier on the system/controller

model using continuous optimization methods

  • The translated invariants can be checked for the sys-

tem simulator/control program (easier than invariant discovery)

  • Should scale up since these complex invariants are rel-

evant to a small part of the control program only

7 For which floating point computations can be taken into account

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 26 — ľ P. Cousot

System analysis & verification, Avenue 3 Abstractions: program ! precise, system ! precise

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 27 — ľ P. Cousot

  • The invariant hypotheses on the controlled system are

assumed to be true

  • It remains to perform the control program analysis un-

der these hypothesis

  • The results can then be checked on the whole system

(as in case 2, but now using refined invariants on the control program!)

  • Iterating this process leads to static analysis by refine-

ment of specifications

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 28 — ľ P. Cousot

slide-8
SLIDE 8

Conclusion

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 29 — ľ P. Cousot

Scientific and technologic objective To develop formal tools to answer questions about soft- ware:

  • from control model design to software implementation,
  • for a wide range of design and software properties,

which would be general enough to benefit all software- intensive industries, and can be adapted to specific ap- plication domains.

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 30 — ľ P. Cousot

Research on software safety and security

  • Investing

1 10000 or even less of the software costs in re-

search is far from sufficient

  • A sustained effort of 1 to 3% would be more realistic

and could significantly contribute to progress in the 10 forthcoming years.

Critical Research Areas in Aerospace Software, MIT August 9th, 2005 — 30 — ľ P. Cousot