Numerical Invariants via Abstract Machines Compositional Recurrence - - PowerPoint PPT Presentation

numerical invariants via abstract machines compositional
SMART_READER_LITE
LIVE PREVIEW

Numerical Invariants via Abstract Machines Compositional Recurrence - - PowerPoint PPT Presentation

Princeton University Zachary Kincaid Static Analysis Symposium August 31, 2018 Numerical Invariants via Abstract Machines Compositional Recurrence Analysis (CRA) Azadeh Farzan, Thomas Reps. Todays agenda: A recipe for building abstract


slide-1
SLIDE 1

Numerical Invariants via Abstract Machines

Zachary Kincaid

Princeton University

Static Analysis Symposium August 31, 2018

slide-2
SLIDE 2

Compositional Recurrence Analysis (CRA)

  • Technique for generating numerical invariants
  • Joint work with Jason Breck, Ashkan Forouhi Boroujeni, John Cyphert,

Azadeh Farzan, Thomas Reps. Today’s agenda: A recipe for building abstract interpreters

slide-3
SLIDE 3

Compositional Recurrence Analysis

  • Generates numerical invariants is an expressive assertion language
  • Linear arithmetic, polynomials, exponentials, logarithms
  • Equations and inequations, congruences, disjunctions
  • Strongly compositional
  • Potential to scale, be parallelized, apply to incomplete programs,

incremental analysis, ..

  • No context

no forward propagation, no abstract refinement

slide-4
SLIDE 4

Compositional Recurrence Analysis

  • Generates numerical invariants is an expressive assertion language
  • Linear arithmetic, polynomials, exponentials, logarithms
  • Equations and inequations, congruences, disjunctions
  • Strongly compositional
  • Potential to scale, be parallelized, apply to incomplete programs,

incremental analysis, ..

  • No context

no forward propagation, no abstract refinement

slide-5
SLIDE 5

Compositional Recurrence Analysis

  • Generates numerical invariants is an expressive assertion language
  • Linear arithmetic, polynomials, exponentials, logarithms
  • Equations and inequations, congruences, disjunctions
  • Strongly compositional
  • Potential to scale, be parallelized, apply to incomplete programs,

incremental analysis, ..

  • No context

no forward propagation, no abstract refinement

slide-6
SLIDE 6

Compositional Recurrence Analysis

  • Generates numerical invariants is an expressive assertion language
  • Linear arithmetic, polynomials, exponentials, logarithms
  • Equations and inequations, congruences, disjunctions
  • Strongly compositional
  • Potential to scale, be parallelized, apply to incomplete programs,

incremental analysis, ..

  • No context ⇒ no forward propagation, no abstract refinement
slide-7
SLIDE 7

HOLA/C4B/SVComp benchmarks (linear)

# safe Time(s) 10k

7.5k 2.5k 00

150

37 113 114

CRA UAutomizer SeaHorn Poly Oct Box

slide-8
SLIDE 8

How can we answer questions about the behavior of soware?

  • Abstract domains
  • Constraint-based analysis
  • Interpolation
  • Property-directed reachability
  • ...

Practice

  • Boolean programs
  • Linear dynamical systems
  • Solvable polynomial systems
  • Vector addition systems
  • ...

Theory

slide-9
SLIDE 9

How can we answer questions about the behavior of soware?

  • Abstract domains
  • Constraint-based analysis
  • Interpolation
  • Property-directed reachability
  • ...

Practice

  • Boolean programs
  • Linear dynamical systems
  • Solvable polynomial systems
  • Vector addition systems
  • ...

Theory

slide-10
SLIDE 10

How can we answer questions about the behavior of soware?

  • Abstract domains
  • Constraint-based analysis
  • Interpolation
  • Property-directed reachability
  • ...

Practice

  • Boolean programs
  • Linear dynamical systems
  • Solvable polynomial systems
  • Vector addition systems
  • ...

Theory

slide-11
SLIDE 11

How can we answer questions about the behavior of soware?

  • Abstract domains
  • Constraint-based analysis
  • Interpolation
  • Property-directed reachability
  • ...

Practice

  • Boolean programs
  • Linear dynamical systems
  • Solvable polynomial systems
  • Vector addition systems
  • ...

Theory

slide-12
SLIDE 12

Outline

Background The recipe Examples

slide-13
SLIDE 13

Goal

Given a program: x ∈ Var n ∈ Z e ∈ Expr ::= x | n | e1 + e2 | n · e c ∈ Cond ::= e1 < e2 | e1 = e2 | c1 ∧ c2 | c1 ∨ c2 P1 ∈ Program ::= x := e | if c then P else P | while c do P Compute a transition formula t Term x x’ n t t t t v F TF s s F F F F v F Pre-state Post-state

slide-14
SLIDE 14

Goal

Given a program: x ∈ Var n ∈ Z e ∈ Expr ::= x | n | e1 + e2 | n · e c ∈ Cond ::= e1 < e2 | e1 = e2 | c1 ∧ c2 | c1 ∨ c2 P1 ∈ Program ::= x := e | if c then P else P | while c do P Compute a transition formula t ∈ Term ::= x | x’ | n | t1 + t2 | t1t2 | v F ∈ TF ::= s < 0 | s = 0 | F1 ∨ F2 | F1 ∧ F2 | ∃v.F Pre-state Post-state

slide-15
SLIDE 15

Goal

Given a program: x ∈ Var n ∈ Z e ∈ Expr ::= x | n | e1 + e2 | n · e c ∈ Cond ::= e1 < e2 | e1 = e2 | c1 ∧ c2 | c1 ∨ c2 P1 ∈ Program ::= x := e | if c then P else P | while c do P Compute a transition formula t ∈ Term ::= x | x’ | n | t1 + t2 | t1t2 | v F ∈ TF ::= s < 0 | s = 0 | F1 ∨ F2 | F1 ∧ F2 | ∃v.F Pre-state Post-state

slide-16
SLIDE 16

Running example

x := 0; while (x < N) do x := x + 1; if (*) then y := y + x else z := z + x x N y y z z y z y z N N

slide-17
SLIDE 17

Running example

x := 0; while (x < N) do x := x + 1; if (*) then y := y + x else z := z + x x′ = N y y z z y z y z N N

slide-18
SLIDE 18

Running example

x := 0; while (x < N) do x := x + 1; if (*) then y := y + x else z := z + x x′ = N ∧y′ ≥ y ∧z′ ≥ z y z y z N N

slide-19
SLIDE 19

Running example

x := 0; while (x < N) do x := x + 1; if (*) then y := y + x else z := z + x x′ = N ∧y′ ≥ y ∧z′ ≥ z ∧y′ + z′ = y + z + N(N + 1)/2

slide-20
SLIDE 20

Effective denotational semantics

TF· : Program → TransitionFormula TF x := e x e

y x Var

y y TF if c then P else P c TF P c TF P TF P ;P Var TF P Var Var TF P Var Var TF while c do P

  • Arbitrary control flow [Tarjan ’81]
  • Recursive procedures [PLDI’17]

Aside

slide-21
SLIDE 21

Effective denotational semantics

TF· : Program → TransitionFormula TFx := e ≜ x′ = e ∧ ∧

y̸=x∈Var

y′ = y TF if c then P else P c TF P c TF P TF P ;P Var TF P Var Var TF P Var Var TF while c do P

  • Arbitrary control flow [Tarjan ’81]
  • Recursive procedures [PLDI’17]

Aside

slide-22
SLIDE 22

Effective denotational semantics

TF· : Program → TransitionFormula TFx := e ≜ x′ = e ∧ ∧

y̸=x∈Var

y′ = y TFif c then P1 else P2 ≜ (c ∧ TFP1) ∨ (¬c ∧ TFP2) TF P ;P Var TF P Var Var TF P Var Var TF while c do P

  • Arbitrary control flow [Tarjan ’81]
  • Recursive procedures [PLDI’17]

Aside

slide-23
SLIDE 23

Effective denotational semantics

TF· : Program → TransitionFormula TFx := e ≜ x′ = e ∧ ∧

y̸=x∈Var

y′ = y TFif c then P1 else P2 ≜ (c ∧ TFP1) ∨ (¬c ∧ TFP2) TFP1;P2 ≜ ∃Var′′.TFP1[Var′ → Var′′] ∧ TFP2[Var → Var′′] TF while c do P

  • Arbitrary control flow [Tarjan ’81]
  • Recursive procedures [PLDI’17]

Aside

slide-24
SLIDE 24

Effective denotational semantics

TF· : Program → TransitionFormula TFx := e ≜ x′ = e ∧ ∧

y̸=x∈Var

y′ = y TFif c then P1 else P2 ≜ (c ∧ TFP1) ∨ (¬c ∧ TFP2) TFP1;P2 ≜ ∃Var′′.TFP1[Var′ → Var′′] ∧ TFP2[Var → Var′′] TFwhile c do P ≜ ...

  • Arbitrary control flow [Tarjan ’81]
  • Recursive procedures [PLDI’17]

Aside

slide-25
SLIDE 25

Effective denotational semantics

TF· : Program → TransitionFormula TFx := e ≜ x′ = e ∧ ∧

y̸=x∈Var

y′ = y TFif c then P1 else P2 ≜ (c ∧ TFP1) ∨ (¬c ∧ TFP2) TFP1;P2 ≜ ∃Var′′.TFP1[Var′ → Var′′] ∧ TFP2[Var → Var′′] TFwhile c do P ≜ ...

  • Arbitrary control flow [Tarjan ’81]
  • Recursive procedures [PLDI’17]

Aside

slide-26
SLIDE 26

Compositionality ⇒ TF for a loop is a function of the TF of its body x := 0; while (x < N) do x := x + 1; if (*) then y := y + x else z := z + x x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

slide-27
SLIDE 27

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

vx vy

z

x y z

vx vy

z

f vx vy

z

vx vy

z

fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-28
SLIDE 28

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

vx vy

z

x y z

vx vy

z

f vx vy

z

vx vy

z

fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-29
SLIDE 29

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy+z

f vx vy

z

vx vy

z

fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-30
SLIDE 30

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy+z

f vx vy

z

vx vy

z

fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-31
SLIDE 31

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy+z

f vx vy

z

vx vy

z

fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-32
SLIDE 32

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy+z

f vx vy

z

vx vy

z

fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-33
SLIDE 33

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy+z

f ([ vx vy+z ]) = [1 1 1 ] [ vx vy+z ] + [1 1 ] fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-34
SLIDE 34

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy

z

f ([ vx vy+z ]) = [1 1 1 ] [ vx vy+z ] + [1 1 ] fk ([ vx vy+z ]) = [1 k 1 ] [ vx vy+z ] + [ k k(k + 1)/2 ] k k x x k y z y z kx k k

slide-35
SLIDE 35

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy

z

f ([ vx vy+z ]) = [1 1 1 ] [ vx vy+z ] + [1 1 ] fk ([ vx vy+z ]) = [1 k 1 ] [ vx vy+z ] + [ k k(k + 1)/2 ] ∃k.   k ≥ 0 ∧x′ = x + k ∧(y′ + z′) = (y + z) + kx + k(k + 1)/2  

slide-36
SLIDE 36

TransitionFormula AbstractMachine cℓ α Approximate w/ abstract machine Compute reachability relation TF while c do P c c TF P c

slide-37
SLIDE 37

TransitionFormula AbstractMachine cℓ α Approximate w/ abstract machine Compute reachability relation TFwhile c do P = cℓ(α(c ∧ TFP)) ∧ ¬c′

slide-38
SLIDE 38

Simulation

Let (A, A − →) and (B, B − →) be transition systems. A relation S ⊆ A × B is a (total) simulation if

1 For all a ∈ A, there is some b ∈ B with (a, b) ∈ S 2 For all a b a such that a b

S and a

A a , there is some b such

that b

B b and a b

S. a a A b S b S B

slide-39
SLIDE 39

Simulation

Let (A, A − →) and (B, B − →) be transition systems. A relation S ⊆ A × B is a (total) simulation if

1 For all a ∈ A, there is some b ∈ B with (a, b) ∈ S 2 For all a, b, a′ such that (a, b) ∈ S and a →A a′, there is some b′ such

that b →B b′ and (a′, b′) ∈ S. a a′ A b S b S B

slide-40
SLIDE 40

Simulation

Let (A, A − →) and (B, B − →) be transition systems. A relation S ⊆ A × B is a (total) simulation if

1 For all a ∈ A, there is some b ∈ B with (a, b) ∈ S 2 For all a, b, a′ such that (a, b) ∈ S and a →A a′, there is some b′ such

that b →B b′ and (a′, b′) ∈ S. a a′ A b S b′ S B

slide-41
SLIDE 41

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy+z

f ([ vx vy+z ]) = [1 1 1 ] [ vx vy+z ] + [1 1 ] fk vx vy

z

k vx vy

z

k k k k k x x k y z y z kx k k

slide-42
SLIDE 42

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) ) g         vx vy+z ℓy ℓz         =     1 1 1 1 1         vx vy+z ℓy ℓz     +     1 1     vx=x ∧ vy+z=y + z ∧ ℓy≤y ∧ ℓz≤z

slide-43
SLIDE 43

Approximating transitive closure

(B, B − →) simulates (A, A − →) ⇒ (B, B − →∗) simulates (A, A − →∗) a0 a1 A a2 A · · · an−1 an A b0 S b b bn bn S S S S B B B a A a b S a b b b B b S a b

slide-44
SLIDE 44

Approximating transitive closure

(B, B − →) simulates (A, A − →) ⇒ (B, B − →∗) simulates (A, A − →∗) a0 a1 A a2 A · · · an−1 an A b0 S b1 b2 bn−1 bn · · · S S S S B B B a A a b S a b b b B b S a b

slide-45
SLIDE 45

Approximating transitive closure

(B, B − →) simulates (A, A − →) ⇒ (B, B − →∗) simulates (A, A − →∗) a0 a1 A a2 A · · · an−1 an A b0 S b1 b2 bn−1 bn · · · S S S S B B B a A − →∗a′ ⇒ ∀b.S(a, b) ⇒ ∃b′.b B − →∗b′ ∧ S(a′, b′)

slide-46
SLIDE 46

x′ = x + 1 ∧ ( (y′ = y + x′ ∧ z′ = z) ∨(y′ = y ∧ z′ = z + x′) )

x y z

[ vx vy+z ] = [1 1 1 ]   x y z  

vx vy

z

f ([ vx vy+z ]) = [1 1 1 ] [ vx vy+z ] + [1 1 ] fk ([ vx vy+z ]) = [1 k 1 ] [ vx vy+z ] + [ k k(k + 1)/2 ] ∃k.   k ≥ 0 ∧x′ = x + k ∧(y′ + z′) = (y + z) + kx + k(k + 1)/2  

slide-47
SLIDE 47

The recipe

Parameters

1 Class of abstract machines M

  • Affine maps
  • Solvable polynomials maps [Rodríguez-Carbonell & Kapur ’04]
  • Difference bound relations [Comon & Jurski ’98]
  • Octagonal relations [Bozga et al ’09]
  • Integer vector addition systems [Haase & Halfon ’14]
  • ...

2 Class of simulations S

slide-48
SLIDE 48

The recipe

Parameters

1 Class of abstract machines M 2 Class of simulations S

  • Identity relation
  • Linear relations
  • Polyhedral relations
  • ...
slide-49
SLIDE 49

The recipe

Parameters

1 Class of abstract machines M 2 Class of simulations S

Recipe:

1 Define closure operator cℓ : M → TF 2 Define abstraction function α : TF → M

  • For any F, identify a simulation sF ∈ S between TF and α(F)

3 Take F⍟ ≜ ∀⃗

y.sF(⃗ x,⃗ y) ⇒ ∃⃗ y′.cℓ(α(F))(⃗ y,⃗ y′) ∧ sF(⃗ x′,⃗ y′).

slide-50
SLIDE 50

A view from category theory

Fixing a class of simulations S and a class of abstract machines M, form two categories

  • TF: transition formulas
  • Objects are transition formulas, arrows are simulations in S
  • M: abstract machines
  • Objects are machines in M, arrows are simulations in S

Order theory Category theory Poset Category x y S x y monotone function functor Galois connection adjoint functors

slide-51
SLIDE 51

A view from category theory

Fixing a class of simulations S and a class of abstract machines M, form two categories

  • TF: transition formulas
  • Objects are transition formulas, arrows are simulations in S
  • M: abstract machines
  • Objects are machines in M, arrows are simulations in S

Order theory Category theory Poset Category x y S x y monotone function functor Galois connection adjoint functors

slide-52
SLIDE 52

A view from category theory

Fixing a class of simulations S and a class of abstract machines M, form two categories

  • TF: transition formulas
  • Objects are transition formulas, arrows are simulations in S
  • M: abstract machines
  • Objects are machines in M, arrows are simulations in S

Order theory Category theory Poset Category x ≤ y S : x → y monotone function functor Galois connection adjoint functors

slide-53
SLIDE 53

A view from category theory

Fixing a class of simulations S and a class of abstract machines M, form two categories

  • TF: transition formulas
  • Objects are transition formulas, arrows are simulations in S
  • M: abstract machines
  • Objects are machines in M, arrows are simulations in S

Order theory Category theory Poset Category x ≤ y S : x → y monotone function functor Galois connection adjoint functors

slide-54
SLIDE 54

Best abstractions

TF M γ α Best M-abstraction Single step transition formula F F F SF M M R R Best abstractions monotone analysis

slide-55
SLIDE 55

Best abstractions

TF M Best M-abstraction Single step transition formula F α(F) γ(α(F)) SF α γ M M R R Best abstractions monotone analysis

slide-56
SLIDE 56

Best abstractions

TF M Best M-abstraction Single step transition formula F α(F) γ(α(F)) SF α γ M γ(M) R γ R Best abstractions monotone analysis

slide-57
SLIDE 57

Best abstractions

TF M Best M-abstraction Single step transition formula F α(F) γ(α(F)) SF α γ M γ(M) R γ R Best abstractions monotone analysis

slide-58
SLIDE 58

Best abstractions

TF M Best M-abstraction Single step transition formula F α(F) γ(α(F)) SF α γ M γ(M) R γ R Best abstractions ⇒ monotone analysis

slide-59
SLIDE 59

Example: Cartesian relations

  • Abstract machines: transition relations of the form P × Q
  • Closure: c

P Q y y P y Q y

  • Simulations: identity relations
  • Best abstraction:

F x F x F

slide-60
SLIDE 60

Example: Cartesian relations

  • Abstract machines: transition relations of the form P × Q
  • Closure: cℓ(P, Q) ≜ ⃗

y = ⃗ y ′ ∨ ( P(⃗ y) ∧ Q(⃗ y ′) )

  • Simulations: identity relations
  • Best abstraction:

F x F x F

slide-61
SLIDE 61

Example: Cartesian relations

  • Abstract machines: transition relations of the form P × Q
  • Closure: cℓ(P, Q) ≜ ⃗

y = ⃗ y ′ ∨ ( P(⃗ y) ∧ Q(⃗ y ′) )

  • Simulations: identity relations
  • Best abstraction:

F x F x F

slide-62
SLIDE 62

Example: Cartesian relations

  • Abstract machines: transition relations of the form P × Q
  • Closure: cℓ(P, Q) ≜ ⃗

y = ⃗ y ′ ∨ ( P(⃗ y) ∧ Q(⃗ y ′) )

  • Simulations: identity relations
  • Best abstraction: α(F) ≜ (∃⃗

x′.F, ∃⃗ x.F)

slide-63
SLIDE 63

Example: lossy sums

  • Abstract machines: f(⃗

y) = ⃗ y +⃗ b

  • Closure: c

f k k y y kb

  • Simulations: y

Ax

  • Best abstraction

F :

  • Compute convex hull A

b of x x F x x .

  • y

Ax is a simulation between F and f y y b.

slide-64
SLIDE 64

Example: lossy sums

  • Abstract machines: f(⃗

y) = ⃗ y +⃗ b

  • Closure: cℓ(f) ≜ ∃k.k ≥ 0 ∧⃗

y′ = ⃗ y + k⃗ b

  • Simulations: y

Ax

  • Best abstraction

F :

  • Compute convex hull A

b of x x F x x .

  • y

Ax is a simulation between F and f y y b.

slide-65
SLIDE 65

Example: lossy sums

  • Abstract machines: f(⃗

y) = ⃗ y +⃗ b

  • Closure: cℓ(f) ≜ ∃k.k ≥ 0 ∧⃗

y′ = ⃗ y + k⃗ b

  • Simulations: ⃗

y ≤ A⃗ x

  • Best abstraction

F :

  • Compute convex hull A

b of x x F x x .

  • y

Ax is a simulation between F and f y y b.

slide-66
SLIDE 66

Example: lossy sums

  • Abstract machines: f(⃗

y) = ⃗ y +⃗ b

  • Closure: cℓ(f) ≜ ∃k.k ≥ 0 ∧⃗

y′ = ⃗ y + k⃗ b

  • Simulations: ⃗

y ≤ A⃗ x

  • Best abstraction α(F):
  • Compute convex hull A⃗

δ ≤ ⃗ b of ∃⃗ x,⃗ x′.F ∧ (⃗ δ = ⃗ x′ −⃗ x).

y ≤ A⃗ x is a simulation between F and f(⃗ y) = ⃗ y +⃗ b.

slide-67
SLIDE 67

Example: unit spectrum affine maps

  • Abstract machines: f(⃗

y) = A⃗ y +⃗ b, only eigenvalue of A is 1

  • Closure: via Jordan Normal Form, expressed in polynomial arithmetic
  • Simulations: y

Ax

  • Best abstraction:

1 Extract affine hull of F using an SMT solver 2 Linear algebra tricks to put equations in the correct form

slide-68
SLIDE 68

Example: unit spectrum affine maps

  • Abstract machines: f(⃗

y) = A⃗ y +⃗ b, only eigenvalue of A is 1

  • Closure: via Jordan Normal Form, expressed in polynomial arithmetic
  • Simulations: y

Ax

  • Best abstraction:

1 Extract affine hull of F using an SMT solver 2 Linear algebra tricks to put equations in the correct form

slide-69
SLIDE 69

Example: unit spectrum affine maps

  • Abstract machines: f(⃗

y) = A⃗ y +⃗ b, only eigenvalue of A is 1

  • Closure: via Jordan Normal Form, expressed in polynomial arithmetic
  • Simulations: ⃗

y = A⃗ x

  • Best abstraction:

1 Extract affine hull of F using an SMT solver 2 Linear algebra tricks to put equations in the correct form

slide-70
SLIDE 70

Example: unit spectrum affine maps

  • Abstract machines: f(⃗

y) = A⃗ y +⃗ b, only eigenvalue of A is 1

  • Closure: via Jordan Normal Form, expressed in polynomial arithmetic
  • Simulations: ⃗

y = A⃗ x

  • Best abstraction:

1 Extract affine hull of F using an SMT solver 2 Linear algebra tricks to put equations in the correct form

slide-71
SLIDE 71

Example: solvable polynomial maps

  • Abstract machines: polynomial maps without non-linear circular

dependencies

  • f(x, y) = (x + y, x − y): ✓
  • g(x, y) = (x + y2, y + x2): ✗
  • Closure: via Berg’s operational calculus
  • Polynomials + exponentials + operators
  • Simulations: y

Ax

  • Best abstractions not computable – non-linear arithmetic
  • Heuristics based on Gröbner bases, congruence closure, polyhedra
slide-72
SLIDE 72

Example: solvable polynomial maps

  • Abstract machines: polynomial maps without non-linear circular

dependencies

  • f(x, y) = (x + y, x − y): ✓
  • g(x, y) = (x + y2, y + x2): ✗
  • Closure: via Berg’s operational calculus
  • Polynomials + exponentials + operators
  • Simulations: y

Ax

  • Best abstractions not computable – non-linear arithmetic
  • Heuristics based on Gröbner bases, congruence closure, polyhedra
slide-73
SLIDE 73

Example: solvable polynomial maps

  • Abstract machines: polynomial maps without non-linear circular

dependencies

  • f(x, y) = (x + y, x − y): ✓
  • g(x, y) = (x + y2, y + x2): ✗
  • Closure: via Berg’s operational calculus
  • Polynomials + exponentials + operators
  • Simulations: ⃗

y = A⃗ x

  • Best abstractions not computable – non-linear arithmetic
  • Heuristics based on Gröbner bases, congruence closure, polyhedra
slide-74
SLIDE 74

Example: solvable polynomial maps

  • Abstract machines: polynomial maps without non-linear circular

dependencies

  • f(x, y) = (x + y, x − y): ✓
  • g(x, y) = (x + y2, y + x2): ✗
  • Closure: via Berg’s operational calculus
  • Polynomials + exponentials + operators
  • Simulations: ⃗

y = A⃗ x

  • Best abstractions not computable – non-linear arithmetic
  • Heuristics based on Gröbner bases, congruence closure, polyhedra
slide-75
SLIDE 75

Compositional recurrence analysis

  • [FMCAD’15]: reduced product of
  • cartesian relations
  • unit spectrum affine maps
  • lossy sums
  • [POPL’18]: reduced product of
  • cartesian relations
  • solvable polynomial maps
  • lossy sums
slide-76
SLIDE 76

Summary

Recipe for putting abstract machines to work in abstract interpreters

  • Compositional
  • Precise
  • Predictable

Lots of room to work in this space

  • Invent new abstract machines
  • Develop abstraction procedures
slide-77
SLIDE 77

Summary

Recipe for putting abstract machines to work in abstract interpreters

  • Compositional
  • Precise
  • Predictable

Lots of room to work in this space

  • Invent new abstract machines
  • Develop abstraction procedures
slide-78
SLIDE 78

Thanks!

  • Farzan, Kincaid: Compositional Recurrence Analysis. FMCAD’15
  • Kincaid, Breck, Boroujeni, Reps. Compositional Recurrence Analysis
  • Revisited. PLDI’17
  • Kincaid, Breck, Cyphert, Reps. Non-linear Reasoning for Invariant
  • Synthesis. POPL’18