+ All Categories
Home > Documents > Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow...

Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow...

Date post: 05-Feb-2018
Category:
Upload: duongcong
View: 226 times
Download: 1 times
Share this document with a friend
64
Acceleration in Convex Data-Flow Analysis Jérôme Leroux and Grégoire Sutre LaBRI, Université de Bordeaux, CNRS, France Conference on Foundations of Software Technology and Theoretical Computer Science, 2007 Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 1 / 25
Transcript
Page 1: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Acceleration in Convex Data-Flow Analysis

Jérôme Leroux and Grégoire Sutre

LaBRI, Université de Bordeaux, CNRS, France

Conference on Foundations of Software Technology andTheoretical Computer Science, 2007

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 1 / 25

Page 2: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Motivations

Invariants for VerificationVerification of safety properties

Efficient computation of precise enough invariants

Data-flow analysis, abstract interpretation

Widenings/narrowings: successful approach, but might lead toinvariants to coarse for verification

Our ObjectiveComputation of the exact solution to data-flow analysis problems

Meet Over all Paths

Minimum Fix Point

Acceleration-based techniques

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 2 / 25

Page 3: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Motivations

Invariants for VerificationVerification of safety properties

Efficient computation of precise enough invariants

Data-flow analysis, abstract interpretation

Widenings/narrowings: successful approach, but might lead toinvariants to coarse for verification

Our ObjectiveComputation of the exact solution to data-flow analysis problems

Meet Over all Paths

Minimum Fix Point

Acceleration-based techniques

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 2 / 25

Page 4: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Outline

1 Introduction

2 Convex Data Flow Analysis of Guarded Translation Systems

3 Acceleration for Self-Loops

4 Acceleration for Cycles

5 Conclusion

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 3 / 25

Page 5: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Guarded Translation Systems (Syntax)

We focus on topologically closed convex subsets of Rn

{~x | A~x ≤ ~b} is called a{

(real) polyhedron when A ∈ Rn×m

rational polyhedron when A ∈ Qn×m

guarded commands of the form if ~x ∈ G then ~x := ~x + ~d

DefinitionAn n-dim guarded translation system (GTS) is any pair S = (X , T )where:

X is a finite set of variables

T is a finite set of transitions of the form XG,~d−−→ X ′

Transition XG,~d−−→ X ′ represents the assignment X ′ := (X ∩G) + ~d

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 4 / 25

Page 6: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Guarded Translation Systems (Syntax)

We focus on topologically closed convex subsets of Rn

{~x | A~x ≤ ~b} is called a{

(real) polyhedron when A ∈ Rn×m

rational polyhedron when A ∈ Qn×m

guarded commands of the form if ~x ∈ G then ~x := ~x + ~d

DefinitionAn n-dim guarded translation system (GTS) is any pair S = (X , T )where:

X is a finite set of variables

T is a finite set of transitions of the form XG,~d−−→ X ′

Transition XG,~d−−→ X ′ represents the assignment X ′ := (X ∩G) + ~d

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 4 / 25

Page 7: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Guarded Translation Systems (Semantics)

DefinitionAn n-dim guarded translation system (GTS) is any pair S = (X , T )where:

X is a finite set of variables

T is a finite set of transitions of the form XG,~d−−→ X ′

Valuation: function ρ from X to closed convex subsets of Rn

Semantics JtK of transition t = XG,~d−−→ X ′ defined by:

(JtK(ρ))(Y ) =

{

(ρ(X ) ∩G) + ~d if Y = X ′

ρ(Y ) if Y 6= X ′

An n-dim initialized GTS (IGTS) is any triple S = (X , T , ρ0)

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 5 / 25

Page 8: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

IGTS

XG, ~d

X = {X}

T = {X G,~d−−→ X} with

{

G = R2+

~d = (−1, 1)

ρ0 = {X 7→ 1× [−1, 1]}

Semantics

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 6 / 25

Page 9: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Convex Data-Flow Analysis

We consider the complete lattice of convex closed subsets of Rn.partial order is set inclusion ⊆greatest lower bound is set intersection ∩least upper bound ⊔ is set union followed by closed convex hull

Extended to valuations

Minimum Fix-Point (MFP) SolutionMFP(S) =

⋂ {ρ : valuation | ρ0 ⊆ ρ and JtK(ρ) ⊆ ρ for all t ∈ T}

MFP(S) is the least fix-point of τ(ρ) = ρ0 ⊔⊔

t∈T

JtK(ρ).

Kleene fix-point iteration:⊔

i∈N τ i(⊥) ⊆ MFP(S)

Meet Over all Paths (MOP) SolutionMOP(S) =

⊔ {Jt1K ◦ · · · ◦ JtkK(ρ0) | t1 · · · tk ∈ T ∗ is a path}Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 7 / 25

Page 10: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Convex Data-Flow Analysis

We consider the complete lattice of convex closed subsets of Rn.partial order is set inclusion ⊆greatest lower bound is set intersection ∩least upper bound ⊔ is set union followed by closed convex hull

Extended to valuations

Minimum Fix-Point (MFP) SolutionMFP(S) =

⋂ {ρ : valuation | ρ0 ⊆ ρ and JtK(ρ) ⊆ ρ for all t ∈ T}

MFP(S) is the least fix-point of τ(ρ) = ρ0 ⊔⊔

t∈T

JtK(ρ).

Kleene fix-point iteration:⊔

i∈N τ i(⊥) ⊆ MFP(S)

Meet Over all Paths (MOP) SolutionMOP(S) =

⊔ {Jt1K ◦ · · · ◦ JtkK(ρ0) | t1 · · · tk ∈ T ∗ is a path}Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 7 / 25

Page 11: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Convex Data-Flow Analysis

We consider the complete lattice of convex closed subsets of Rn.partial order is set inclusion ⊆greatest lower bound is set intersection ∩least upper bound ⊔ is set union followed by closed convex hull

Extended to valuations

Minimum Fix-Point (MFP) SolutionMFP(S) =

⋂ {ρ : valuation | ρ0 ⊆ ρ and JtK(ρ) ⊆ ρ for all t ∈ T}

MFP(S) is the least fix-point of τ(ρ) = ρ0 ⊔⊔

t∈T

JtK(ρ).

Kleene fix-point iteration:⊔

i∈N τ i(⊥) ⊆ MFP(S)

Meet Over all Paths (MOP) SolutionMOP(S) =

⊔ {Jt1K ◦ · · · ◦ JtkK(ρ0) | t1 · · · tk ∈ T ∗ is a path}Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 7 / 25

Page 12: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 13: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 14: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

MFP Solution

-2 -1 0 1 2-1

0

1

2

3

τ1(⊥) = ρ0

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 15: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

MFP Solution

-2 -1 0 1 2-1

0

1

2

3

τ1(⊥) = ρ0

τ2(⊥) = ρ0 ⊔ JtK(τ1(⊥))

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 16: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

MFP Solution

-2 -1 0 1 2-1

0

1

2

3

τ1(⊥) = ρ0

τ2(⊥) = ρ0 ⊔ JtK(τ1(⊥))

τ i(⊥) = ρ0 ⊔ JtK(τ i−1(⊥))

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 17: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

MFP Solution

-2 -1 0 1 2-1

0

1

2

3

τ1(⊥) = ρ0

τ2(⊥) = ρ0 ⊔ JtK(τ1(⊥))

τ i(⊥) = ρ0 ⊔ JtK(τ i−1(⊥))

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 18: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

MFP Solution

-2 -1 0 1 2-1

0

1

2

3

τ1(⊥) = ρ0

τ2(⊥) = ρ0 ⊔ JtK(τ1(⊥))

τ i(⊥) = ρ0 ⊔ JtK(τ i−1(⊥))

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 19: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Example

MOP Solution

-2 -1 0 1 2-1

0

1

2

3

ρ1 = JtK (ρ0)ρ2 = JtK (ρ1)ρ3 = JtK (ρ2) = {X 7→ ∅}

MFP Solution

-2 -1 0 1 2-1

0

1

2

3

RemarkKleene fix-point iterationdoes not stabilize

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 8 / 25

Page 20: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Acceleration in Data-Flow Analysis [L. & S., SAS’07]

ObjectivesSpeed up Kleene fix-point iteration

Don’t loose precision

Minimum Fix-Point Computation with Acceleration

1 do ρ← ρ ⊔ JtK(ρ) for some transition t = XG,~d−−→ X ′

2 or select a cycle in S and:

1 let S′ denote the cyclic sub-IGTS, initialized with ρ (restricted to X ′)

2 ρ← ρ ⊔MFP(S′) (or ρ← ρ ⊔MOP(S′))

Acceleration ProblemCompute the MOP/MFP solution for cyclic IGTS

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 9 / 25

Page 21: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Acceleration in Data-Flow Analysis [L. & S., SAS’07]

ObjectivesSpeed up Kleene fix-point iteration

Don’t loose precision

Minimum Fix-Point Computation with Acceleration

1 do ρ← ρ ⊔ JtK(ρ) for some transition t = XG,~d−−→ X ′

2 or select a cycle in S and:

1 let S′ denote the cyclic sub-IGTS, initialized with ρ (restricted to X ′)

2 ρ← ρ ⊔MFP(S′) (or ρ← ρ ⊔MOP(S′))

Acceleration ProblemCompute the MOP/MFP solution for cyclic IGTS

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 9 / 25

Page 22: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Acceleration in Data-Flow Analysis [L. & S., SAS’07]

ObjectivesSpeed up Kleene fix-point iteration

Don’t loose precision

Minimum Fix-Point Computation with Acceleration

1 do ρ← ρ ⊔ JtK(ρ) for some transition t = XG,~d−−→ X ′

2 or select a cycle in S and:

1 let S′ denote the cyclic sub-IGTS, initialized with ρ (restricted to X ′)

2 ρ← ρ ⊔MFP(S′) (or ρ← ρ ⊔MOP(S′))

Acceleration ProblemCompute the MOP/MFP solution for cyclic IGTS

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 9 / 25

Page 23: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Outline

1 Introduction

2 Convex Data Flow Analysis of Guarded Translation Systems

3 Acceleration for Self-Loops

4 Acceleration for Cycles

5 Conclusion

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 10 / 25

Page 24: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

MFP Solution for Self-Loop IGTS

Theorem

For any n-dim self-loop IGTS ({X}, {X G,~d−−→ X}, ρ0), the MFP solutionis the valuation:

X 7→{

ρ0(X ) if G ∩ ρ0(X ) = ∅ρ0(X ) ⊔ ((G ∩ (ρ0(X ) + R+

~d)) + ~d) otherwise

Proof Ideas

⊆ The given expression is a post-fix-point ofs

XG,~d−−→ X

{.

⊇ Proof by contradiction, using topological and convexity properties

of both the guard and MFP solution.

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 11 / 25

Page 25: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Standard Widening on Polyhedra[Cousot & Halbwachs, POPL’78]

IGTS

X

R2+, (−1, 1)

ρ0 = {X 7→ 1× [−1, 1]}

Application of widening

Coarser than the MFPSolution!

Iteration with Widening

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 12 / 25

Page 26: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Standard Widening on Polyhedra[Cousot & Halbwachs, POPL’78]

IGTS

X

R2+, (−1, 1)

ρ0 = {X 7→ 1× [−1, 1]}

Application of widening

Coarser than the MFPSolution!

Iteration with Widening

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 12 / 25

Page 27: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Standard Widening on Polyhedra[Cousot & Halbwachs, POPL’78]

IGTS

X

R2+, (−1, 1)

ρ0 = {X 7→ 1× [−1, 1]}

Application of widening

Coarser than the MFPSolution!

Iteration with Widening

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 12 / 25

Page 28: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Standard Widening on Polyhedra[Cousot & Halbwachs, POPL’78]

IGTS

X

R2+, (−1, 1)

ρ0 = {X 7→ 1× [−1, 1]}

Application of widening

Coarser than the MFPSolution!

Iteration with Widening

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 12 / 25

Page 29: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Standard Widening on Polyhedra[Cousot & Halbwachs, POPL’78]

IGTS

X

R2+, (−1, 1)

ρ0 = {X 7→ 1× [−1, 1]}

Application of widening

Coarser than the MFPSolution!

Iteration with Widening

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 12 / 25

Page 30: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Standard Widening on Polyhedra[Cousot & Halbwachs, POPL’78]

IGTS

X

R2+, (−1, 1)

ρ0 = {X 7→ 1× [−1, 1]}

Application of widening

Coarser than the MFPSolution!

Iteration with Widening

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 12 / 25

Page 31: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Polyhedral Abstract Acceleration[Gonnord & Halbwachs, SAS’06]

Consider an IGTS S =

({X}, {X G,~d−−→ X}, ρ0)

Abstract AccelerationAbAc(S) = ρ0(X ) ⊔MFP(S′)where S

′ is equal to S excepton its initial valuation:ρ′0(X ) = G ∩ ρ0(X ).

Iteration with Abs. Acc.

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 13 / 25

Page 32: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Polyhedral Abstract Acceleration[Gonnord & Halbwachs, SAS’06]

Consider an IGTS S =

({X}, {X G,~d−−→ X}, ρ0)

Abstract AccelerationAbAc(S) = ρ0(X ) ⊔MFP(S′)where S

′ is equal to S excepton its initial valuation:ρ′0(X ) = G ∩ ρ0(X ).

Iteration with Abs. Acc.

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 13 / 25

Page 33: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Polyhedral Abstract Acceleration[Gonnord & Halbwachs, SAS’06]

Consider an IGTS S =

({X}, {X G,~d−−→ X}, ρ0)

Abstract AccelerationAbAc(S) = ρ0(X ) ⊔MFP(S′)where S

′ is equal to S excepton its initial valuation:ρ′0(X ) = G ∩ ρ0(X ).

Iteration with Abs. Acc.

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 13 / 25

Page 34: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Comparison with Polyhedral Abstract Acceleration[Gonnord & Halbwachs, SAS’06]

Consider an IGTS S =

({X}, {X G,~d−−→ X}, ρ0)

Abstract AccelerationAbAc(S) = ρ0(X ) ⊔MFP(S′)where S

′ is equal to S excepton its initial valuation:ρ′0(X ) = G ∩ ρ0(X ).

RemarkIteration does not terminate!

Iteration with Abs. Acc.

-2 -1 0 1 2-1

0

1

2

3

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 13 / 25

Page 35: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Outline

1 Introduction

2 Convex Data Flow Analysis of Guarded Translation Systems

3 Acceleration for Self-Loops

4 Acceleration for Cycles

5 Conclusion

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 14 / 25

Page 36: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

2-dim Example

GTS

X1 X2

X3X4

G1, ~0

G2, ~0

G3, ~0

G4, ~0

G1 = ]−∞,−1]× [1,+∞[G2 = [1,+∞[× [1,+∞[G3 = [1,+∞[× ]−∞,−1]G4 = ]−∞,−1]× ]−∞,−1]

Initial Valuation

b

bb

b

X1 7→ {(−2, 2)}X2 7→ {(2, 2)}X3 7→ {(2,−2)}X4 7→ {(−2,−2)}

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 15 / 25

Page 37: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 2-dim Example

X1 X2

X3X4

b

bb

b

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 16 / 25

Page 38: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 2-dim Example

X1 X2

X3X4

b

bb

b

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 16 / 25

Page 39: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 2-dim Example

X1 X2

X3X4

b

bb

b

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 16 / 25

Page 40: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 2-dim Example

X1 X2

X3X4

4

1

h1 =14

b

bb

b

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 16 / 25

Page 41: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 2-dim Example

X1 X2

X3X4

4

1

h2 =415

b

bb

b

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 16 / 25

Page 42: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 2-dim Example

X1 X2

X3X4

4

1

h3 =1556

b

bb

b

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 16 / 25

Page 43: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

MFP Solution for 2-dim Example

hk+1 =1

4− hk

3

1

1

hkb

bb

b

(hk )k∈N is nondecreasing, and limk→∞

hk = 2−√

3

RemarkThe MFP solution of this 2-dim cyclic IGTS is not rational polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 17 / 25

Page 44: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

MFP Solution for 2-dim Example

hk+1 =1

4− hk

3

1

1

hkb

bb

b

(hk )k∈N is nondecreasing, and limk→∞

hk = 2−√

3

RemarkThe MFP solution of this 2-dim cyclic IGTS is not rational polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 17 / 25

Page 45: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

MFP Solution for 2-dim Example

hk+1 =1

4− hk

3

1

1

hkb

bb

b

(hk )k∈N is nondecreasing, and limk→∞

hk = 2−√

3

RemarkThe MFP solution of this 2-dim cyclic IGTS is not rational polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 17 / 25

Page 46: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

MFP Solution for 2-dim Example

hk+1 =1

4− hk

3

1

1

hkb

bb

b

(hk )k∈N is nondecreasing, and limk→∞

hk = 2−√

3

RemarkThe MFP solution of this 2-dim cyclic IGTS is not rational polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 17 / 25

Page 47: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

3-dim Example

GTS

X1 X2

X3X4

G1, ~e3

G2, ~e3

G3, ~e3

G4, ~e3

G1 = R− × R+ × RG2 = R+ × R+ × RG3 = R+ × R− × RG4 = R− × R− × R

Initial Valuation

b

bb

b

X1 7→ {(−1, 1)} × R+

X2 7→ {(1, 1)} × R+

X3 7→ {(1,−1)} × R+

X4 7→ {(−1,−1)} × R+

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 18 / 25

Page 48: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 49: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 50: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

e1

e3b

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 51: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

e1

e3b

b

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 52: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

e1

e3b

b

b

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 53: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

e1

e3b

b

b

b

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 54: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

e1

e3b

b

b

b

b

b

b

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 55: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Kleene iteration on 3-dim Example

e1

e3b

b

b

b

b

b

b

b

bb

b

RemarkThe MFP solution of this 3-dim cyclic IGTS is not polyhedral

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 19 / 25

Page 56: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Acceleration Results for Cycles

2-dim cyclic example with a real (non rational) polyhedral MFPsolution

3-dim cyclic example with a non-polyhedral MFP solution

QuestionIs the MFP polyhedral for all 2-dim cyclic IGTS?

TheoremThe MFP solution of any 2-dim IGTS is an algebraic polyhedron.

An algebraic number is any real number definable in 〈R,+, ·,≤〉Algebraic polyhedrality is required even for cyclic 2-dim IGTS

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 20 / 25

Page 57: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Acceleration Results for Cycles

2-dim cyclic example with a real (non rational) polyhedral MFPsolution

3-dim cyclic example with a non-polyhedral MFP solution

QuestionIs the MFP polyhedral for all 2-dim cyclic IGTS?

TheoremThe MFP solution of any 2-dim IGTS is an algebraic polyhedron.

An algebraic number is any real number definable in 〈R,+, ·,≤〉Algebraic polyhedrality is required even for cyclic 2-dim IGTS

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 20 / 25

Page 58: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Acceleration Results for Cycles

2-dim cyclic example with a real (non rational) polyhedral MFPsolution

3-dim cyclic example with a non-polyhedral MFP solution

QuestionIs the MFP polyhedral for all 2-dim cyclic IGTS?

TheoremThe MFP solution of any 2-dim IGTS is an algebraic polyhedron.

An algebraic number is any real number definable in 〈R,+, ·,≤〉Algebraic polyhedrality is required even for cyclic 2-dim IGTS

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 20 / 25

Page 59: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Proof (1)

MFP Solution Expression

MFP(X ) =⊔

X0∈X

t1···tk∈LX0,X

Jt1K ◦ · · · ◦ JtkK (∆(X0)) + 0+ MFP(X )

where:

∆(X ) = ρ0(X ) ⊔⊔

XG,~d−−→X ′

bd (G) ∩MFP(X )

bd (G) is the topological boundary of G

LX0,X is the set of simple paths from X0 to X

0+C = {~d | C + R+~d ⊆ C}

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 21 / 25

Page 60: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Proof (2)

Observe that 0+ MFP(X ) is a cone in dimension 2.

0+ MFP(X )

There exists ~d1, ~d2, ~d3 ∈ R2 such that:0+ MFP(X ) = R+

~d1 + R+~d1 + R+

~d1

Reduce to the case G is an half-space.=⇒ bd (G) is a line.

bd (G) ∩MFP(X )

There exists two half-spaces H1, H2 such that:bd (G) ∩MFP(X ) = bd (G) ∩ H1 ∩ H2

Therefore the MFP solution is definable by a formula in 〈R,+, ·,≤〉.

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 22 / 25

Page 61: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Outline

1 Introduction

2 Convex Data Flow Analysis of Guarded Translation Systems

3 Acceleration for Self-Loops

4 Acceleration for Cycles

5 Conclusion

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 23 / 25

Page 62: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Summary

Guarded Translation SystemsSelf-loops Cyclic General

MOP n ≥ 1 Rational Poly. Rational Poly. Not Polyhedral

1 Rational Poly. Rational Poly. Rational Poly.MFP 2 Rational Poly. Algebraic Poly. Algebraic Poly.

n ≥ 3 Rational Poly. Not Polyhedral Not Polyhedral

Polyhedra are computable for Rational Poly. and Algebraic Poly.

Results on self-loops carry over to singly initialized cycles

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 24 / 25

Page 63: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Related Work & Future Work

Related WorkInterval analysis [Su & Wagner, TACAS’04], [Seidl & Gawlitza,ESOP’07], [L. & S., SAS’07]Abstract acceleration for convex polyhedra [Gonnord &Halbwachs, SAS’06]

Acceleration technique for two self-loops, operations include resetIncomplete for single self-loops

Future WorkMultiple self-loopsOther abstract lattices

octogons [Miné, AST’01]templates [Sankaranarayanan et al., VMCAI’05]two variables per linear inequality [Simon et al., LOPSTR’02]

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 25 / 25

Page 64: Acceleration in Convex Data-Flow Analysis - LaBRI2007:... · Acceleration in Convex Data-Flow Analysis ... Computation of the exact solution to data-flow analysis problems ... Acceleration

Related Work & Future Work

Related WorkInterval analysis [Su & Wagner, TACAS’04], [Seidl & Gawlitza,ESOP’07], [L. & S., SAS’07]Abstract acceleration for convex polyhedra [Gonnord &Halbwachs, SAS’06]

Acceleration technique for two self-loops, operations include resetIncomplete for single self-loops

Future WorkMultiple self-loopsOther abstract lattices

octogons [Miné, AST’01]templates [Sankaranarayanan et al., VMCAI’05]two variables per linear inequality [Simon et al., LOPSTR’02]

Leroux, Sutre (LaBRI) Acceleration in Convex Data-Flow Analysis FST TCS 2007 25 / 25


Recommended