Basic Concepts of Abstract Interpretation Patrick Cousot cole - - PowerPoint PPT Presentation

basic concepts of abstract interpretation
SMART_READER_LITE
LIVE PREVIEW

Basic Concepts of Abstract Interpretation Patrick Cousot cole - - PowerPoint PPT Presentation

Basic Concepts of Abstract Interpretation Patrick Cousot cole normale suprieure 45 rue dUlm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr www.di.ens.fr/~cousot IFIP WCC Topical day on Abstract Interpretation P.


slide-1
SLIDE 1

« Basic Concepts of Abstract Interpretation »

Patrick Cousot École normale supérieure 45 rue d’Ulm 75230 Paris cedex 05, France

Patrick.Cousot@ens.fr www.di.ens.fr/~cousot

IFIP WCC — Topical day on Abstract Interpretation

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 1 — ľ P. Cousot

slide-2
SLIDE 2

Motivations

x x

x x

x

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 2 — ľ P. Cousot

slide-3
SLIDE 3

What is (or should be) the essential preoccupation of computer scientists? The production of reliable software, its mainte- nance and safe evolution year after year (up to 20 even 30 years).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 3 — ľ P. Cousot

slide-4
SLIDE 4

What is (or should be) the essential preoccupation of computer scientists? The production of reliable software, its mainte- nance and safe evolution year after year (up to 20 even 30 years).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 3 — ľ P. Cousot

slide-5
SLIDE 5

Computer hardware change of scale

The 25 last years, computer hardware has seen its per- formances multiplied by 104 to 106=109;

ENIAC (5000 flops) Intel/Sandia Teraflops System (1012 flops)

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 4 — ľ P. Cousot

slide-6
SLIDE 6

The information processing revolution

A scale of 106 is typical of a significant revolution:

  • Energy: nuclear power station / Roman slave;
  • Transportation: distance Earth — Mars / Paris

— Toulouse

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 5 — ľ P. Cousot

slide-7
SLIDE 7

Computer software change of scale

– The size of the programs executed by these computers has grown up in similar proportions; – Example 1 (modern text editor for the general public):

  • > 1 700 000 lines of C 1;
  • 20 000 procedures;
  • 400 files;
  • > 15 years of development.

1 full-time reading of the code (35 hours/week) would take at least 3 months!

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 5 — ľ P. Cousot

slide-8
SLIDE 8

Computer software change of scale (cont’d)

– Example 2 (professional computer system):

  • 30 000 000 lines of code;
  • 30 000 (known) bugs!

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 6 — ľ P. Cousot

slide-9
SLIDE 9

Bugs

– Software bugs

  • whether anticipated (Y2K bug)
  • or unforeseen (failure of the 5.01 flight
  • f Ariane V launcher)

are quite frequent; – Bugs can be very difficult to discover in huge software; – Bugs can have catastrophic consequences either very costly

  • r inadmissible (embedded software in transportation sys-

tems);

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 7 — ľ P. Cousot

slide-10
SLIDE 10

The estimated cost of an overflow

– 500 000 000 $; – Including indirect costs (delays, lost markets, etc): 2 000 000 000 $; – The financial results of Arianespace were negative in 2000, for the first time since 20 years.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 8 — ľ P. Cousot

slide-11
SLIDE 11

Who cares?

– No one is legally responsible for bugs: This software is distributed WITHOUT ANY WARRANTY; without even the implied war- ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. – So, no one cares about software verification – And even more, one can even make money out of bugs (customers buy the next version to get around bugs in software)

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 9 — ľ P. Cousot

slide-12
SLIDE 12

Why no one cares?

– Software designers don’t care because there is no risk in writing bugged software – The law/judges can never enforce more than what is

  • ffered by the state of the art

– Automated software verification by formal methods is undecidable whence thought to be impossible – Whence the state of the art is that no one will ever be able to eliminate all bugs at a reasonable price – And so no one ever bear any responsability

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 10 — ľ P. Cousot

slide-13
SLIDE 13

Current research results

– Research is presently changing the state of the art (e.g. ASTRÉE) – We can check for the absence of large categories of bugs (may be not all of them but a significant portion

  • f them)

– The verification can be made automatically by me- chanical tools – Some bugs can be found completely automatically, without any human intervention

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 11 — ľ P. Cousot

slide-14
SLIDE 14

The next step (5 years)

– If these tools are successful, their use can be enforced by quality norms – Professional have to conform to such norms (otherwise they are not credible) – Because of complete tool automaticity, no one can be discharged from the duty of applying such state of the art tools – Third parties of confidence can check software a pos- teriori to trace back bugs and prove responsabilities

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 12 — ľ P. Cousot

slide-15
SLIDE 15

A foreseeable future (10 years)

– The real take-off of software verification must be en- forced – Development costs arguments have shown to be inef- fective – Norms/laws might be much more convincing – This requires effectiveness and complete automation (to avoid acquittal based on human capacity limita- tions arguments)

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 13 — ľ P. Cousot

slide-16
SLIDE 16

Why will “partial software verification” ultimately succeed?

– The state of the art will change toward complete au- tomation, at least for common categories of bugs – So responsabilities can be established (at least for au- tomatically detectable bugs) – Whence the law will change (by adjusting to the new state of the art) – To ensure at least partial software verification – For the benefit of all of us

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 14 — ľ P. Cousot

slide-17
SLIDE 17

Static analysis by abstract interpretation

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 15 — ľ P. Cousot

slide-18
SLIDE 18

Example of static analysis (input)

{n0>=0} n := n0; {n0=n,n0>=0} i := n; {n0=i,n0=n,n0>=0} while (i <> 0 ) do {n0=n,i>=1,n0>=i} j := 0; {n0=n,j=0,i>=1,n0>=i} while (j <> i) do {n0=n,j>=0,i>=j+1,n0>=i} j := j + 1 {n0=n,j>=1,i>=j,n0>=i}

  • d;

{n0=n,i=j,i>=1,n0>=i} i := i - 1 {i+1=j,n0=n,i>=0,n0>=i+1}

  • d

{n0=n,i=0,n0>=0}

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 16 — ľ P. Cousot

slide-19
SLIDE 19

Example of static analysis (output)

{n0>=0} n := n0; {n0=n,n0>=0} i := n; {n0=i,n0=n,n0>=0} while (i <> 0 ) do {n0=n,i>=1,n0>=i} j := 0; {n0=n,j=0,i>=1,n0>=i} while (j <> i) do {n0=n,j>=0,i>=j+1,n0>=i} j := j + 1 {n0=n,j>=1,i>=j,n0>=i}

  • d;

{n0=n,i=j,i>=1,n0>=i} i := i - 1 {i+1=j,n0=n,i>=0,n0>=i+1}

  • d

{n0=n,i=0,n0>=0}

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 16 — ľ P. Cousot

slide-20
SLIDE 20

Example of static analysis (safety)

{n0>=0} n := n0; {n0=n,n0>=0} i := n;

n0 must be initially nonnegative (otherwise the program does not terminate properly)

{n0=i,n0=n,n0>=0} while (i <> 0 ) do {n0=n,i>=1,n0>=i} j := 0; {n0=n,j=0,i>=1,n0>=i} while (j <> i) do {n0=n,j>=0,i>=j+1,n0>=i} j := j + 1

` j < n0 so no upper overflow

{n0=n,j>=1,i>=j,n0>=i}

  • d;

{n0=n,i=j,i>=1,n0>=i} i := i - 1

` i > 0 so no lower overflow

{i+1=j,n0=n,i>=0,n0>=i+1}

  • d

{n0=n,i=0,n0>=0}

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 16 — ľ P. Cousot

slide-21
SLIDE 21

Static analysis by abstract interpretation

Verification: define and prove automatically a property of the possible behaviors of a complex computer pro- gram (example: program semantics); Abstraction: the reasoning/calculus can be done on an ab- straction of these behaviors dealing only with those elements of the behaviors related to the considered property; Theory: abstract interpretation.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 17 — ľ P. Cousot

slide-22
SLIDE 22

Example of static analysis

Verification: absence of runtime errors; Abstraction: polyhedral abstraction (affine inequalities); Theory: abstract interpretation.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 18 — ľ P. Cousot

slide-23
SLIDE 23

A very informal introduction to the principles of abstract interpretation

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 19 — ľ P. Cousot

slide-24
SLIDE 24

Semantics

The concrete semantics of a program formalizes (is a mathematical model of) the set of all its possible execu- tions in all possible execution environments.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 20 — ľ P. Cousot

slide-25
SLIDE 25

Graphic example: Possible behaviors

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 21 — ľ P. Cousot

slide-26
SLIDE 26

Undecidability

– The concrete mathematical semantics of a program is an “tinfinite” mathematical object, not computable; – All non trivial questions on the concrete program se- mantics are undecidable. Example: termination – Assume termination(P) would always terminates and returns true iff P always terminates on all input data; – The following program yields a contradiction P ” while termination(P) do skip od.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 22 — ľ P. Cousot

slide-27
SLIDE 27

Graphic example: Safety properties

The safety properties of a program express that no possi- ble execution in any possible execution environment can reach an erroneous state.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 23 — ľ P. Cousot

slide-28
SLIDE 28

Graphic example: Safety property

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 24 — ľ P. Cousot

slide-29
SLIDE 29

Safety proofs

– A safety proof consists in proving that the intersection

  • f the program concrete semantics and the forbidden

zone is empty; – Undecidable problem (the concrete semantics is not computable); – Impossible to provide completely automatic answers with finite computer resources and neither human in- teraction nor uncertainty on the answer 2.

2 e.g. probabilistic answer.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 25 — ľ P. Cousot

slide-30
SLIDE 30

Test/debugging

– consists in considering a subset of the possible execu- tions; – not a correctness proof; – absence of coverage is the main problem.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 26 — ľ P. Cousot

slide-31
SLIDE 31

Graphic example: Property test/simulation

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 27 — ľ P. Cousot

slide-32
SLIDE 32

Abstract interpretation

– consists in considering an abstract semantics, that is to say a superset of the concrete semantics of the pro- gram; – hence the abstract semantics covers all possible con- crete cases; – correct: if the abstract semantics is safe (does not in- tersect the forbidden zone) then so is the concrete se- mantics

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 28 — ľ P. Cousot

slide-33
SLIDE 33

Graphic example: Abstract interpretation

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 29 — ľ P. Cousot

slide-34
SLIDE 34

Formal methods

Formal methods are abstract interpretations, which dif- fer in the way to obtain the abstract semantics: – “model checking”:

  • the abstract semantics is given manually by the user;
  • in the form of a finitary model of the program exe-

cution;

  • can be computed automatically, by techniques rele-

vant to static analysis.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 30 — ľ P. Cousot

slide-35
SLIDE 35

– “deductive methods”:

  • the abstract semantics is specified by verification con-

ditions;

  • the user must provide the abstract semantics in the

form of inductive arguments (e.g. invariants);

  • can be computed automatically by methods relevant

to static analysis. – “static analysis”: the abstract semantics is computed automatically from the program text according to pre- defined abstractions (that can sometimes be tailored automatically/manually by the user).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 31 — ľ P. Cousot

slide-36
SLIDE 36

Required properties of the abstract semantics

– sound so that no possible error can be forgotten; – precise enough (to avoid false alarms); – as simple/abstract as possible (to avoid combinatorial explosion phenomena).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 32 — ľ P. Cousot

slide-37
SLIDE 37

Graphic example: The most abstract correct and precise semantics

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 33 — ľ P. Cousot

slide-38
SLIDE 38

Graphic example: Erroneous abstraction — I

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 34 — ľ P. Cousot

slide-39
SLIDE 39

Graphic example: Erroneous abstraction — II

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 35 — ľ P. Cousot

slide-40
SLIDE 40

Graphic example: Imprecision ) false alarms

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 36 — ľ P. Cousot

slide-41
SLIDE 41

Abstract domains

Standard abstractions – that serve as a basis for the design of static analyzers:

  • abstract program data,
  • abstract program basic operations;
  • abstract program control (iteration, procedure, con-

currency, . . . ); – can be parametrized to allow for manual adaptation to the application domains.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 37 — ľ P. Cousot

slide-42
SLIDE 42

Graphic example: Standard abstraction by intervals

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 38 — ľ P. Cousot

slide-43
SLIDE 43

Graphic example: A more refined abstraction

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 39 — ľ P. Cousot

slide-44
SLIDE 44

A very informal introduction to static analysis algorithms

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 40 — ľ P. Cousot

slide-45
SLIDE 45

Standard operational semantics

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 41 — ľ P. Cousot

slide-46
SLIDE 46

Standard semantics

– Start from a standard operational semantics that de- scribes formally:

  • states that is data values of program variables,
  • transitions that is elementary computation steps;

– Consider traces that is successions of states correspond- ing to executions described by transitions (possibly in- finite).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 42 — ľ P. Cousot

slide-47
SLIDE 47

Graphic example: Small-steps transition semantics

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 43 — ľ P. Cousot

slide-48
SLIDE 48

Example: Small-steps transition semantics of an assignment

int x; ... l: x := x + 1; l’:

fl : x = v ! l0 : x = v + 1 j v 2 [min_int; max_int ` 1]g [ fl : x = max_int ! l0 : x = ˙g (runtime error)

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 44 — ľ P. Cousot

slide-49
SLIDE 49

Example: Small-steps transition semantics of a loop

l1: x := 1; l2: while x < 10 do l3: x := x + 1 l4:

  • d

l5:

l1 : : : : l1 : x = `1 l1 : x = 0 l1 : x = 1 l1 : : : :

3 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 5

& ! %

l2 : x = 1 l2 : x = 1 ! l3 : x = 1 l3 : x = 1 ! l4 : x = 2 l4 : x = 2 ! l3 : x = 2 l3 : x = 2 ! l4 : x = 3

: : :

l4 : x = 10 ! l5 : x = 10

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 45 — ľ P. Cousot

slide-50
SLIDE 50

Example: Trace semantics of loop

l1: x := 1; l2: while x < 10 do l3: x := x + 1 l4:

  • d

l5: l1 : : : : l1 : x = `1 l1 : x = 0 l1 : x = 1 l1 : : : :

3 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 5

& ! %

l2 : x = 1 ! l3 : x = 1 ! l4 : x = 2 ! l3 : x = 2 ! l4 : x = 3 : : : ! l4 : x = 10 ! l5 : x = 10

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 46 — ľ P. Cousot

slide-51
SLIDE 51

Transition systems

– hS; t !i where:

  • S is a set of states/vertices/. . .
  • t

! 2 }(SˆS) is a transition relation/set of arcs/. . . t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 47 — ľ P. Cousot

slide-52
SLIDE 52

Collecting semantics in fixpoint form

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 48 — ľ P. Cousot

slide-53
SLIDE 53

Collecting semantics

– consider all traces simultaneously; – collecting semantics:

  • sets of states that describe data values of program

variables on all possible trajectories;

  • set of states transitions that is simultaneous elemen-

tary computation steps on all possible trajectories;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 49 — ľ P. Cousot

slide-54
SLIDE 54

Graphic example: sets of states

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 50 — ľ P. Cousot

slide-55
SLIDE 55

Graphic example: set of states transitions

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 51 — ľ P. Cousot

slide-56
SLIDE 56

Example: Reachable states of a transition system

I

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 52 — ľ P. Cousot

slide-57
SLIDE 57

Reachable states in fixpoint form

F(X) = I [ fs0 j 9s 2 X : s t ! s0g R = lfp

„ ; F

= +1

[

n=0 F n(;)

where f0(x) = x fn+1(x) = f(fn(x))

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 53 — ľ P. Cousot

slide-58
SLIDE 58

Example of fixpoint iteration for reachable states lfp

„ ; –X . I [ fs0 j 9s 2 X : s t

! s0g

I

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 54 — ľ P. Cousot

slide-59
SLIDE 59

Example of fixpoint iteration for reachable states lfp

„ ; –X . I [ fs0 j 9s 2 X : s t

! s0g

  • F
  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 54 — ľ P. Cousot

slide-60
SLIDE 60

Example of fixpoint iteration for reachable states lfp

„ ; –X . I [ fs0 j 9s 2 X : s t

! s0g

  • F F
  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 54 — ľ P. Cousot

slide-61
SLIDE 61

Example of fixpoint iteration for reachable states lfp

„ ; –X . I [ fs0 j 9s 2 X : s t

! s0g

  • F F F
  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 54 — ľ P. Cousot

slide-62
SLIDE 62

Example of fixpoint iteration for reachable states lfp

„ ; –X . I [ fs0 j 9s 2 X : s t

! s0g

  • F F F F
  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 54 — ľ P. Cousot

slide-63
SLIDE 63

Abstraction by Galois connections

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 55 — ľ P. Cousot

slide-64
SLIDE 64

Abstracting sets (i.e. properties)

– Choose an abstract domain, replacing sets of objects (states, traces, . . . ) S by their abstraction ¸(S) – The abstraction function ¸ maps a set of concrete ob- jects to its abstract interpretation; – The inverse concretization function ‚ maps an abstract set of objects to concrete ones; – Forget no concrete objects: (abstraction from above) S „ ‚(¸(S)).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 56 — ľ P. Cousot

slide-65
SLIDE 65

Interval abstraction ¸

  • fx : [1; 99]; y : [2; 77]g

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 57 — ľ P. Cousot

slide-66
SLIDE 66

Interval concretization ‚

  • fx : [1; 99]; y : [2; 77]g

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 58 — ľ P. Cousot

slide-67
SLIDE 67

The abstraction ¸ is monotone

  • fx : [33; 89]; y : [48; 61]g

v fx : [1; 99]; y : [2; 90]g X „ Y ) ¸(X) v ¸(Y )

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 59 — ľ P. Cousot

slide-68
SLIDE 68

The concretization ‚ is monotone

fx : [33; 89]; y : [48; 61]g v fx : [1; 99]; y : [2; 90]g X v Y ) ‚(X) „ ‚(Y )

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 60 — ľ P. Cousot

slide-69
SLIDE 69

The ‚ ‹ ¸ composition is extensive

  • fx : [1; 99]; y : [2; 77]g

X „ ‚ ‹ ¸(X)

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 61 — ľ P. Cousot

slide-70
SLIDE 70

The ¸ ‹ ‚ composition is reductive

  • fx : [1; 99]; y : [2; 77]g

==v fx : [1; 99]; y : [2; 77]g ¸ ‹ ‚(Y ) ==v Y

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 62 — ľ P. Cousot

slide-71
SLIDE 71

Correspondance between concrete and abstract properties

– The pair h¸; ‚i is a Galois connection: h}(S); „i ` ` ` ! ` ` `

¸ ‚

hD; vi – h}(S); „i ` ` `! ` ! ` ` ` `

¸ ‚

hD; vi when ¸ is onto (equivalently ¸ ‹ ‚ = 1 or ‚ is one-to-one).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 63 — ľ P. Cousot

slide-72
SLIDE 72

Galois connection

hD; „i ` ` ` ! ` ` `

¸ ‚

hD; vi iff 8x; y 2 D : x „ y = ) ¸(x) v ¸(y) ^ 8x; y 2 D : x v y = ) ‚(x) „ ‚(y) ^ 8x 2 D : x „ ‚(¸(x)) ^ 8y 2 D : ¸(‚(y)) v x iff 8x 2 D; y 2 D : ¸(x) v y ( ) x „ ‚(y)

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 64 — ľ P. Cousot

slide-73
SLIDE 73

Graphic example: Interval abstraction

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 65 — ľ P. Cousot

slide-74
SLIDE 74

Graphic example: Abstract transitions

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 66 — ľ P. Cousot

slide-75
SLIDE 75

Example: Interval transition semantics of assignments

int x; ... l: x := x + 1; l’:

fl : x 2 [‘; h] ! l0 : x 2 [l + 1; min(h + 1; max_int)] [ f˙ j h = max_intg j ‘ » hg where [‘; h] = ; when h < ‘.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 67 — ľ P. Cousot

slide-76
SLIDE 76

Function abstraction

  • F ] = ¸ ‹ F ‹ ‚

i:e: F ] =  ‹ F hP; „i ` ` ` ! ` ` `

¸ ‚

hQ; vi ) hP

mon

7` ! P; _ „i ` ` ` ` ` ` ` ` ` ` ! ` ` ` ` ` ` ` ` ` `

–F . ¸‹F ‹‚ –F ] . ‚‹F ]‹¸

hQ mon 7` ! Q; _ vi

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 68 — ľ P. Cousot

slide-77
SLIDE 77

Example: Set of traces to trace of intervals abstraction

Set of traces: ¸1 # Trace of sets: ¸2 # Trace of intervals

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 69 — ľ P. Cousot

slide-78
SLIDE 78

Example: Set of traces to reachable states abstraction

Set of traces: ¸1 # Trace of sets: ¸3 # Reachable states

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 70 — ľ P. Cousot

slide-79
SLIDE 79

Composition of Galois Connections

The composition of Galois connections: hL; »i ` ` ` ! ` ` `

¸1 ‚1

hM; vi and: hM; vi ` ` ` ! ` ` `

¸2 ‚2

hN; —i is a Galois connection: hL; »i ` ` ` ` ` ` ! ` ` ` ` ` `

¸2‹¸1 ‚1‹‚2

hN; —i

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 71 — ľ P. Cousot

slide-80
SLIDE 80

Abstract semantics in fixpoint form

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 72 — ľ P. Cousot

slide-81
SLIDE 81

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-82
SLIDE 82

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-83
SLIDE 83

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-84
SLIDE 84

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-85
SLIDE 85

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-86
SLIDE 86

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-87
SLIDE 87

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-88
SLIDE 88

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-89
SLIDE 89

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-90
SLIDE 90

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-91
SLIDE 91

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-92
SLIDE 92

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-93
SLIDE 93

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-94
SLIDE 94

Graphic example: traces of sets of states in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 73 — ľ P. Cousot

slide-95
SLIDE 95

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-96
SLIDE 96

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-97
SLIDE 97

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-98
SLIDE 98

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-99
SLIDE 99

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-100
SLIDE 100

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-101
SLIDE 101

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-102
SLIDE 102

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-103
SLIDE 103

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-104
SLIDE 104

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-105
SLIDE 105

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-106
SLIDE 106

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-107
SLIDE 107

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-108
SLIDE 108

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-109
SLIDE 109

Graphic example: traces of intervals in fixpoint form

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 74 — ľ P. Cousot

slide-110
SLIDE 110

Approximate fixpoint abstraction

F F

]

Concrete domain Abstract domain F F F F F F F

]

F

]

F

]

F

]

â Approximation relation ? ?

]

v

F ] = ¸ ‹ F ‹ ‚ ) ¸(lfp F) v lfp F ]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 75 — ľ P. Cousot

slide-111
SLIDE 111

approximate/exact fixpoint abstraction

Exact Abstraction:

¸(lfp F) = lfp F ]

Approximate Abstraction:

¸(lfp F) @] lfp F ]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 76 — ľ P. Cousot

slide-112
SLIDE 112

Convergence acceleration by widening/narrowing

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 77 — ľ P. Cousot

slide-113
SLIDE 113

Graphic example: upward iteration with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 78 — ľ P. Cousot

slide-114
SLIDE 114

Graphic example: upward iteration with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 78 — ľ P. Cousot

slide-115
SLIDE 115

Graphic example: upward iteration with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 78 — ľ P. Cousot

slide-116
SLIDE 116

Graphic example: upward iteration with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 78 — ľ P. Cousot

slide-117
SLIDE 117

Graphic example: stability of the upward iteration

x(t) t

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 79 — ľ P. Cousot

slide-118
SLIDE 118

Convergence acceleration with widening

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 80 — ľ P. Cousot

slide-119
SLIDE 119

Widening operator

A widening operator

  • 2 L ˆ L 7! L is such that:

– Correctness:

  • 8x; y 2 L : ‚(x) v ‚(x
  • y)
  • 8x; y 2 L : ‚(y) v ‚(x
  • y)

– Convergence:

  • for all increasing chains x0 v x1 v . . . , the in-

creasing chain defined by y0 = x0, . . . , yi+1 = yi xi+1, . . . is not strictly increasing.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 81 — ľ P. Cousot

slide-120
SLIDE 120

Fixpoint approximation with widening

The upward iteration sequence with widening: – ^ X0 = ?

  • (infimum)

– ^ Xi+1 = ^ Xi if F( ^ Xi) v ^ Xi = ^ Xi F( ^ Xi)

  • therwise

is ultimately stationary and its limit ^ A is a sound upper approximation of lfp

?

  • F:

lfp

?

  • F v ^

A

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 82 — ľ P. Cousot

slide-121
SLIDE 121

Interval widening

– L = f?g[f[‘; u] j ‘; u 2 Z[f`1g^u 2 Z[fg^‘ » ug – The widening extrapolates unstable bounds to infinity: ?

  • X = X

X

  • ? = X

[‘0; u0]

  • [‘1; u1] = [if ‘1 < ‘0 then ` 1 else ‘0;

if u1 > u0 then + 1 else u0] Not monotone. For example [0; 1] v [0; 2] but [0; 1]

  • [0; 2] = [0; +1] 6v [0; 2] = [0; 2]
  • [0; 2]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 83 — ľ P. Cousot

slide-122
SLIDE 122

Example: Interval analysis (1975)

Program to be analyzed: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 84 — ľ P. Cousot

slide-123
SLIDE 123

Example: Interval analysis (1975)

Equations (abstract interpretation of the semantics): x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 85 — ľ P. Cousot

slide-124
SLIDE 124

Example: Interval analysis (1975)

Resolution by chaotic increasing iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = ; X2 = ; X3 = ; X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 86 — ľ P. Cousot

slide-125
SLIDE 125

Example: Interval analysis (1975)

Increasing chaotic iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = ; X3 = ; X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-126
SLIDE 126

Example: Interval analysis (1975)

Increasing chaotic iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 1] X3 = ; X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-127
SLIDE 127

Example: Interval analysis (1975)

Increasing chaotic iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 1] X3 = [2; 2] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-128
SLIDE 128

Example: Interval analysis (1975)

Increasing chaotic iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 2] X3 = [2; 2] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-129
SLIDE 129

Example: Interval analysis (1975)

Increasing chaotic iteration: convergence ! x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 2] X3 = [2; 3] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-130
SLIDE 130

Example: Interval analysis (1975)

Increasing chaotic iteration: convergence !! x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 3] X3 = [2; 3] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-131
SLIDE 131

Example: Interval analysis (1975)

Increasing chaotic iteration: convergence !!! x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 3] X3 = [2; 4] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-132
SLIDE 132

Example: Interval analysis (1975)

Increasing chaotic iteration: convergence !!!! x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 4] X3 = [2; 4] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-133
SLIDE 133

Example: Interval analysis (1975)

Increasing chaotic iteration: convergence !!!!! x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 4] X3 = [2; 5] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-134
SLIDE 134

Example: Interval analysis (1975)

Increasing chaotic iteration: convergence !!!!!! x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 5] X3 = [2; 5] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-135
SLIDE 135

Example: Interval analysis (1975)

Increasing chaotic iteration: convergence !!!!!!! x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 5] X3 = [2; 6] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 87 — ľ P. Cousot

slide-136
SLIDE 136

Example: Interval analysis (1975)

Convergence speed-up by widening: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; +1] ( widening X3 = [2; 6] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 88 — ľ P. Cousot

slide-137
SLIDE 137

Example: Interval analysis (1975)

Decreasing chaotic iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; +1] X3 = [2; +1] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 89 — ľ P. Cousot

slide-138
SLIDE 138

Example: Interval analysis (1975)

Decreasing chaotic iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 9999] X3 = [2; +1] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 89 — ľ P. Cousot

slide-139
SLIDE 139

Example: Interval analysis (1975)

Decreasing chaotic iteration: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 9999] X3 = [2; +10000] X4 = ;

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 89 — ľ P. Cousot

slide-140
SLIDE 140

Example: Interval analysis (1975)

Final solution: x := 1; 1: while x < 10000 do 2: x := x + 1 3:

  • d;

4:

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 9999] X3 = [2; +10000] X4 = [+10000; +10000]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 90 — ľ P. Cousot

slide-141
SLIDE 141

Example: Interval analysis (1975)

Result of the interval analysis: x := 1; 1: {x = 1} while x < 10000 do 2: {x 2 [1; 9999]} x := x + 1 3: {x 2 [2; +10000]}

  • d;

4: {x = 10000}

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = [1; 9999] X3 = [2; +10000] X4 = [+10000; +10000]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 91 — ľ P. Cousot

slide-142
SLIDE 142

Example: Interval analysis (1975)

Checking absence of runtime errors with interval analysis: x := 1; 1: {x = 1} while x < 10000 do 2: {x 2 [1; 9999]} x := x + 1 3: {x 2 [2; +10000]}

  • d;

4: {x = 10000}

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

X1 = [1; 1] X2 = (X1 [ X3) \ [`1; 9999] X3 = X2 ˘ [1; 1] X4 = (X1 [ X3) \ [10000; +1]

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

` no overflow X2 = [1; 9999] X3 = [2; +10000] X4 = [+10000; +10000]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 92 — ľ P. Cousot

slide-143
SLIDE 143

Refinement of abstractions

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 93 — ľ P. Cousot

slide-144
SLIDE 144

Approximations of an [in]finite set of points: from above

x y

f: : : ; h19; 77i; : : : ; h20; 03i; : : :g

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 94 — ľ P. Cousot

slide-145
SLIDE 145

Approximations of an [in]finite set of points: from above

x y

  • f: : : ; h19; 77i; : : : ;

h20; 03i; h?; ?i; : : :g

From Below: dual 3 + combinations.

3 Trivial for finite states (liveness model-checking), more difficult for infinite states (variant functions).

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 95 — ľ P. Cousot

slide-146
SLIDE 146

Effective computable approximations of an [in]finite set of points; Signs

4

x y

8 > > > > > > < > > > > > > :

x – 0 y – 0

4 P. Cousot & R. Cousot. Systematic design of program analysis frameworks. ACM POPL’79, pp. 269–282, 1979.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 96 — ľ P. Cousot

slide-147
SLIDE 147

Effective computable approximations of an [in]finite set of points; Intervals

5

x y

8 > > > > > > < > > > > > > :

x 2 [19; 77] y 2 [20; 03]

5 P. Cousot & R. Cousot. Static determination of dynamic properties of programs. Proc. 2nd Int. Symp. on Programming, Dunod, 1976.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 97 — ľ P. Cousot

slide-148
SLIDE 148

Effective computable approximations of an [in]finite set of points; Octagons

6

x y

8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > :

1 » x » 9 x + y » 77 1 » y » 9 x ` y » 99

6 A. Miné. A New Numerical Abstract Domain Based on Difference-Bound Matrices. PADO ’2001. LNCS 2053,

  • pp. 155–172.

Springer 2001. See the The Octagon Abstract Domain Library

  • n

http://www.di.ens.fr/~mine/oct/

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 98 — ľ P. Cousot

slide-149
SLIDE 149

Effective computable approximations of an [in]finite set of points; Polyhedra

7

x y

8 > > > > > > < > > > > > > :

19x + 77y » 2004 20x + 03y – 0

7 P. Cousot & N. Halbwachs. Automatic discovery of linear restraints among variables of a program. ACM POPL, 1978, pp. 84–97.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 99 — ľ P. Cousot

slide-150
SLIDE 150

Effective computable approximations of an [in]finite set of points; Simple congruences

8

x y

8 > > > > > > < > > > > > > :

x = 19 mod 77 y = 20 mod 99

8 Ph. Granger. Static Analysis of Arithmetical Congruences. Int. J. Comput. Math. 30, 1989, pp. 165–190.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 100 — ľ P. Cousot

slide-151
SLIDE 151

Effective computable approximations of an [in]finite set of points; Linear congruences

9

x y

8 > > > > > > < > > > > > > :

1x + 9y = 7 mod 8 2x ` 1y = 9 mod 9

9 Ph. Granger. Static Analysis of Linear Congruence Equalities among Variables of a Program. TAPSOFT ’91, pp. 169–192. LNCS 493, Springer, 1991.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 101 — ľ P. Cousot

slide-152
SLIDE 152

Effective computable approximations of an [in]finite set of points; Trapezoidal lin- ear congruences

10

x y

8 > > < > > :

1x + 9y 2 [0; 77] mod 10 2x ` 1y 2 [0; 99] mod 11

10 F. Masdupuy. Array Operations Abstraction Using Semantic Analysis of Trapezoid Congruences. ACM ICS ’92.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 102 — ľ P. Cousot

slide-153
SLIDE 153

Refinement of iterates

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 103 — ľ P. Cousot

slide-154
SLIDE 154

Graphic example: Refinement required by false alarms

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 104 — ľ P. Cousot

slide-155
SLIDE 155

Graphic example: Partitionning

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 105 — ľ P. Cousot

slide-156
SLIDE 156

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-157
SLIDE 157

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-158
SLIDE 158

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-159
SLIDE 159

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-160
SLIDE 160

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-161
SLIDE 161

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-162
SLIDE 162

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-163
SLIDE 163

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-164
SLIDE 164

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-165
SLIDE 165

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-166
SLIDE 166

Graphic example: partitionned upward itera- tion with widening

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 106 — ľ P. Cousot

slide-167
SLIDE 167

Graphic example: safety verification

x(t) t

  • IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004

— 107 — ľ P. Cousot

slide-168
SLIDE 168

Examples of partitionnings

– sets of control states: attach local information to pro- gram points instead of global information for the whole program/procedure/loop – sets of data states:

  • case analysis (test, switches)

– fixpoint iterates:

  • widening with threshold set

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 108 — ľ P. Cousot

slide-169
SLIDE 169

Interval widening with threshold set

– The threshold set T is a finite set of numbers (plus +1 and `1), – [a; b]

  • T [a0; b0] = [if a0 < a then maxf‘ 2 T j ‘ » a0g

else a; if b0 > b then minfh 2 T j h – b0g else b] : – Examples (intervals):

  • sign analysis: T = f`1; 0; +1g;
  • strict sign analysis: T = f`1; `1; 0; +1; +1g;

– T is a parameter of the analysis.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 109 — ľ P. Cousot

slide-170
SLIDE 170

Combinations of abstractions

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 110 — ľ P. Cousot

slide-171
SLIDE 171

Forward/reachability analysis

I I

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 111 — ľ P. Cousot

slide-172
SLIDE 172

Backward/ancestry analysis

I I F

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 112 — ľ P. Cousot

slide-173
SLIDE 173

Iterated forward/backward analysis

I F I

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 113 — ľ P. Cousot

slide-174
SLIDE 174

Example of iterated forward/backward analysis

Arithmetical mean of two integers x and y:

{x>=y} while (x <> y) do {x>=y+2} x := x - 1; {x>=y+1} y := y + 1 {x>=y}

  • d

{x=y}

Necessarily x – y for proper termination

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 114 — ľ P. Cousot

slide-175
SLIDE 175

Example of iterated forward/backward analysis

Adding an auxiliary counter k decremented in the loop body and asserted to be null on loop exit:

{x=y+2k,x>=y} while (x <> y) do {x=y+2k,x>=y+2} k := k - 1; {x=y+2k+2,x>=y+2} x := x - 1; {x=y+2k+1,x>=y+1} y := y + 1 {x=y+2k,x>=y}

  • d

{x=y,k=0} assume (k = 0) {x=y,k=0}

Moreover the differ- ence of x and y must be even for proper ter- mination

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 115 — ľ P. Cousot

slide-176
SLIDE 176

Bibliography

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 116 — ľ P. Cousot

slide-177
SLIDE 177

Seminal papers

– Patrick Cousot & Radhia Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by con- struction or approximation of fixpoints. In 4th Symp. on Prin- ciples of Programming Languages, pages 238—252. ACM Press, 1977. – Patrick Cousot & Nicolas Halbwachs. Automatic discovery of linear restraints among variables of a program. In 5th Symp.

  • n Principles of Programming Languages, pages 84—97. ACM

Press, 1978. – Patrick Cousot & Radhia Cousot. Systematic design of pro- gram analysis frameworks. In 6th Symp. on Principles of Pro- gramming Languages pages 269—282. ACM Press, 1979.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 117 — ľ P. Cousot

slide-178
SLIDE 178

Recent surveys

– Patrick Cousot. Interprétation abstraite. Technique et Science Informatique, Vol. 19, Nb 1-2-3. Janvier 2000, Hermès, Paris,

  • France. pp. 155-164.

– Patrick Cousot. Abstract Interpretation Based Formal Meth-

  • ds and Future Challenges. In Informatics, 10 Years Back —

10 Years Ahead, R. Wilhelm (Ed.), LNCS 2000, pp. 138-156, 2001. – Patrick Cousot & Radhia Cousot. Abstract Interpretation Based Verification of Embedded Software: Problems and Per-

  • spectives. In Proc. 1st Int. Workshop on Embedded Software,

EMSOFT 2001, T.A. Henzinger & C.M. Kirsch (Eds.), LNCS 2211, pp. 97–113. Springer, 2001.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 118 — ľ P. Cousot

slide-179
SLIDE 179

Conclusion

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 119 — ľ P. Cousot

slide-180
SLIDE 180

Theoretical applications of abstract interpretation

– Static Program Analysis [POPL ’77,78,79] inluding Data- flow Analysis [POPL ’79,00], Set-based Analysis [FPCA ’95], etc – Syntax Analysis [TCS 290(1) 2002] – Hierarchies of Semantics (including Proofs) [POPL ’92, TCS 277(1–2) 2002] – Typing [POPL ’97] – Model Checking [POPL ’00] – Program Transformation [POPL ’02] – Software watermarking [POPL ’04]

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 120 — ľ P. Cousot

slide-181
SLIDE 181

Practical applications of abstract interpretation

– Program analysis and manipulation: a small rate of false alarms is acceptable

  • AiT: worst case execution time – Christian Ferdi-

nand – Program verification: no false alarms is acceptable

  • TVLA: A system for generating abstract interpreters

– Mooly Sagiv

  • Astrée: verification of absence of run-time errors –

Laurent Mauborgne

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 121 — ľ P. Cousot

slide-182
SLIDE 182

Industrial applications of abstract interpretation

– Both to Program analysis and verification – Experience with the industrial use of abstract interpre- tation-based static analysis tools – Jean Souyris (Air- bus France)

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 122 — ľ P. Cousot

slide-183
SLIDE 183

THE END

More references at URL www.di.ens.fr/~cousot.

IFIP WCC — Topical day on Abstract Interpretation, Toulouse, 24 August 2004 — 123 — ľ P. Cousot