TreeKs: a Functor to Make Abstract Numerical Domains Scalable - - PowerPoint PPT Presentation

treeks a functor to make abstract numerical domains
SMART_READER_LITE
LIVE PREVIEW

TreeKs: a Functor to Make Abstract Numerical Domains Scalable - - PowerPoint PPT Presentation

TreeKs: a Functor to Make Abstract Numerical Domains Scalable Research Internship, advised by Antoine Min e Ecole normale sup erieure, Paris, team Abstraction Mehdi Bouaziz Motivation and context Abstract interpretation is a formal


slide-1
SLIDE 1

TreeKs: a Functor to Make Abstract Numerical Domains Scalable

Research Internship, advised by Antoine Min´ e ´ Ecole normale sup´ erieure, Paris, team Abstraction Mehdi Bouaziz

slide-2
SLIDE 2

Motivation and context

Abstract interpretation is a formal theory of sound approximation

  • f semantics, mainly used in static analyzer, such as:

◮ Clousot: static verification of Code Contracts ◮ Astr´

ee: proof of absence of runtime errors on embedded softwares Abstract numerical domains:

◮ a set DV of computer-representable abstract values ◮ effective algorithms to compute sound abstractions of the

  • perations: intersection ⊓DV, union ⊔DV, projection ∃DV, . . .

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 2/11

slide-3
SLIDE 3

Numerical abstract domains: examples

Intervals [Cousot Cousot 76]

  • i ai ≤ Xi ≤ bi

Non-relational Linear cost Polyhedra [Cousot Halbwachs 78]

  • j
  • i aijXi ≤ bj

Relational and very precise Worst-case exponential cost

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 3/11

slide-4
SLIDE 4

Weakly relational numerical abstract domains

Zones [Min´ e 01]

  • ij Xi − Xj ≤ cij

Weakly relational Cubic cost Octagons [Min´ e 01]

  • ij ±Xi ± Xj ≤ cij

Cubic cost Logahedra [Howe King 09]

  • ij ±2aiXi ± 2bjXj ≤ cij

Cubic cost TVPI [Simon King Howe 02]

  • ij aiXi + bjXj ≤ cij

Quasi-cubic cost Octahedra [Claris´

  • Cortadella 07]

i ±Xi ≤ c

Worst-case exponential cost

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 4/11

slide-5
SLIDE 5

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-6
SLIDE 6

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

−x ≤ −1

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-7
SLIDE 7

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

−x ≤ −1 x − y ≤ 0

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-8
SLIDE 8

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

−x ≤ −1 x − y ≤ 0 y − z ≤ −2

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-9
SLIDE 9

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

−x ≤ −1 x − y ≤ 0 y − z ≤ −2 −y ≤ −1

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-10
SLIDE 10

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

−x ≤ −1 x − y ≤ 0 y − z ≤ −2 −y ≤ −1 −z ≤ −3

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-11
SLIDE 11

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

−x ≤ −1 x − y ≤ 0 y − z ≤ −2 −y ≤ −1 −z ≤ −3 x − z ≤ −2

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-12
SLIDE 12

Closure operation: example

Domain of zones (

ij Xi − Xj ≤ bij)

V = {x, y, z}

y x z y x z

−x ≤ −1 x − y ≤ 0 y − z ≤ −2 −y ≤ −1 −z ≤ −3 x − z ≤ −2 Done!

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 5/11

slide-13
SLIDE 13

Domain of zones: representation

We represent a set of difference constraints between two variables (Xi − Xj ≤ mji) by a potential graph

  • r by a DBM (Difference Bound Matrix).

x y z

  • 1
  • 2

x y z +∞ +∞ +∞ x −1 +∞ +∞ y +∞ +∞ z +∞ +∞ −2 0 − x ≤ −1 x − y ≤ y − z ≤ −2

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 6/11

slide-14
SLIDE 14

Domain of zones: representation

We represent a set of difference constraints between two variables (Xi − Xj ≤ mji) by a potential graph

  • r by a DBM (Difference Bound Matrix).

x y z

  • 1
  • 2
  • 1
  • 2
  • 3

x y z +∞ +∞ +∞ x −1 +∞ +∞ y −1 +∞ z −3 −2 −2 0 − x ≤ −1 x − y ≤ y − z ≤ −2 0 − y ≤ −1 0 − z ≤ −3 x − z ≤ −2

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 6/11

slide-15
SLIDE 15

Domain of zones: closure and other operators

The closure is a shortest-path closure. After closure, operators are point-wise. Join (best approximation of union): (m ⊔ n)ij = max(mij, nij) Forget operator (projection): (∃Xkm)ij =      mij if i = k and j = k if i = j = k +∞

  • therwise

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 7/11

slide-16
SLIDE 16

How to scale: packing

Principle:

◮ split variables into packs ◮ use a DBM per pack

Cost: linear for bounded-size packs Information loss: no communication between packs!

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 8/11

slide-17
SLIDE 17

How to scale: packing

Principle:

◮ split variables into packs ◮ use a DBM per pack

Cost: linear for bounded-size packs Information loss: no communication between packs! Solution: intervals constraints sharing Not good enough!

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 8/11

slide-18
SLIDE 18

TreeKs: a certain subgraph

Shape:

◮ a tree of complete graphs (packs) ◮ sharing borders

K

7

K

8

K

8

K

8

K

6

K

5

packs tree

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 9/11

slide-19
SLIDE 19

TreeKs: a certain subgraph

Shape:

◮ a tree of complete graphs (packs) ◮ sharing borders

Abstract value: tuple of DBMs

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 9/11

slide-20
SLIDE 20

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-21
SLIDE 21

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-22
SLIDE 22

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-23
SLIDE 23

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-24
SLIDE 24

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-25
SLIDE 25

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-26
SLIDE 26

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-27
SLIDE 27

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-28
SLIDE 28

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-29
SLIDE 29

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-30
SLIDE 30

Closure algorithm

Closure algorithm in TreeKs O(mp3)

for each pack from the leaves to the root Apply closure on this pack in the domain of zones Pass the new constraints to his father for each pack from the root to the leaves Apply closure on this pack in the domain of zones Pass the new constraints to his children

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 10/11

slide-31
SLIDE 31

Conclusion

◮ can be applied to many numerical abstract domains (zones,

  • ctagons, logahedra, TVPI, octahedra, polyhedra, ...)

◮ linear cost when pack size is bounded

Future work:

◮ implementation ◮ development of packs generation strategies ◮ application to other domains

Mehdi Bouaziz, ´ Ecole normale sup´ erieure TreeKs: a Functor to Make Abstract Numerical Domains Scalable 11/11