On the Monniaux Problem in Abstract Interpretation Nathana el - - PowerPoint PPT Presentation

on the monniaux problem in abstract interpretation
SMART_READER_LITE
LIVE PREVIEW

On the Monniaux Problem in Abstract Interpretation Nathana el - - PowerPoint PPT Presentation

On the Monniaux Problem in Abstract Interpretation Nathana el Fijalkow, Engel Lefaucheux, Pierre Ohlmann, Jo el Ouaknine, Amaury Pouly and James Worrell LaBRI, Max Planck Institute for Software Systems, IRIF, Oxford University IRISA,


slide-1
SLIDE 1

On the Monniaux Problem in Abstract Interpretation

Nathana¨ el Fijalkow, Engel Lefaucheux, Pierre Ohlmann, Jo¨ el Ouaknine, Amaury Pouly and James Worrell

LaBRI, Max Planck Institute for Software Systems, IRIF, Oxford University

IRISA, November 2019

slide-2
SLIDE 2

The concept of an invariant is one of the most important in mathematics. Encyclopedia of Mathematics, Kluwer, 2002

slide-3
SLIDE 3

The MU Puzzle

A string-rewriting system using letters M, I, and U

slide-4
SLIDE 4

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
slide-5
SLIDE 5

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU
slide-6
SLIDE 6

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I

slide-7
SLIDE 7

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

slide-8
SLIDE 8

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX
slide-9
SLIDE 9

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M

slide-10
SLIDE 10

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

slide-11
SLIDE 11

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

  • 3. XIIIY → XUY
slide-12
SLIDE 12

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

  • 3. XIIIY → XUY

You can replace any III with a U

slide-13
SLIDE 13

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

  • 3. XIIIY → XUY

You can replace any III with a U Example: MUIIIU becomes MUUU

slide-14
SLIDE 14

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

  • 3. XIIIY → XUY

You can replace any III with a U Example: MUIIIU becomes MUUU

  • 4. XUUY → XY
slide-15
SLIDE 15

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

  • 3. XIIIY → XUY

You can replace any III with a U Example: MUIIIU becomes MUUU

  • 4. XUUY → XY

You can remove any UU

slide-16
SLIDE 16

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

  • 3. XIIIY → XUY

You can replace any III with a U Example: MUIIIU becomes MUUU

  • 4. XUUY → XY

You can remove any UU Example: MUUU becomes MU

slide-17
SLIDE 17

The MU Puzzle

A string-rewriting system using letters M, I, and U

  • 0. We start with MI
  • 1. XI → XIU

You can add U at the end of any string ending in I Example: MI becomes MIU

  • 2. MX → MXX

You can double the string after the M Example: MIU becomes MIUIU

  • 3. XIIIY → XUY

You can replace any III with a U Example: MUIIIU becomes MUUU

  • 4. XUUY → XY

You can remove any UU Example: MUUU becomes MU

Starting from MI, the goal is to produce MU

slide-18
SLIDE 18

Can It Be Solved?

MIU MI MIU MIUIU MIUIUIUIU MII MIIII MIIIIU MIIU MIIUIIU MIIIIIIII MUI ? ? ? ? ? ? MU 2 2 2 3 2 1 2 1 1 2 3

slide-19
SLIDE 19

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

Y XIIIY? XX

slide-20
SLIDE 20

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

XY :=XUY XIU XI = ? s := MX = s ? = s XIIIY? = s UU X Y? s s :=MI s :=MXX s := s

slide-21
SLIDE 21

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

XX :=XUY XIU XI = ? s := MX = s ? = s XIIIY? = s UU X Y? s s :=MI the number of " " in I s introduce " " to count i s :=XY s :=M s

slide-22
SLIDE 22

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

XX :=XUY XIU := 1 i XI = ? s := MX = s ? = s XIIIY? = s UU X Y? s the number of " " in I s introduce " " to count i s :=XY s :=M s

slide-23
SLIDE 23

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

:= :=XUY := 1 i MX = s ? = s XIIIY? = s UU X Y? the number of " " in I s introduce " " to count i s :=XY MXX s s

slide-24
SLIDE 24

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

XX :=XUY := 1 i := 2 i i = s XIIIY? = s UU X Y? the number of " " in I s introduce " " to count i s :=XY s

slide-25
SLIDE 25

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

:= i := 2 i i i := 1 = s UU X Y? the number of " " in I s introduce " " to count i s :=XY XX Y i −3

slide-26
SLIDE 26

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

:= i := 2 i i i := 1 the number of " " in I s introduce " " to count i XX Y i −3

slide-27
SLIDE 27

Can This (Nondeterministic) Program Halt?

s := MI; while s = MU do choose {s = XI} → s := XIU; {s = MX} → s := MXX; {s = XIIIY} → s := XUY; {s = XUUY} → s := XY;

:= 1 i := 2 i i i := i ≡ the number of " " in I s introduce " " to count i XX Y i −3 1 or 2 (mod 3)

slide-28
SLIDE 28

A Polynomial Program Invariant

:= 1 i := 2 i i i := i ≡ i −3 1 or 2 (mod 3)

slide-29
SLIDE 29

A Polynomial Program Invariant

:= 1 i := 2 i i i := i ≡ i −3 1 or 2 (mod 3) Define the polynomial p(x) = (x − 1)(x − 2)

slide-30
SLIDE 30

A Polynomial Program Invariant

:= 1 i := 2 i i i := i ≡ i −3 1 or 2 (mod 3) Define the polynomial p(x) = (x − 1)(x − 2) Then this program satisfies p(i) = 0 (over Z3)

slide-31
SLIDE 31

Automated Invariant Generation: A Challenge

The classical approach to the verification of temporal safety properties of programs requires the construction of inductive invariants at each program point, that is, assertions that are true on every program execution reaching that point, and moreover, that are closed under the strongest postcondition operator. Automation

  • f this construction is the main challenge in

program verification.

  • D. Beyer, T. Henzinger, R. Majumdar, and A. Rybelchenko

Invariant Synthesis for Combined Theories, 2007

slide-32
SLIDE 32

Inductive Invariants

invariant = overapproximation (of the reachable states)

slide-33
SLIDE 33

Inductive Invariants

invariant = overapproximation (of the reachable states) inductive invariant =

  • verapproximation

preserved by the transition relation

slide-34
SLIDE 34

Inductive Invariants

x, y, z range over Z (or Q)

2 1 3 f1 f4 f3 f2 f5

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-35
SLIDE 35

Inductive Invariants

x, y, z range over Z (or Q)

2 1 3 f1 f4 f3 f2 f5

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-36
SLIDE 36

Inductive Invariants

x, y, z range over Z (or Q)

3 f1 f4 f3 f2 f5 2 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-37
SLIDE 37

Inductive Invariants

x, y, z range over Z (or Q)

3 f1 f4 f3 f2 f5 2 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-38
SLIDE 38

Inductive Invariants

x, y, z range over Z (or Q)

3 f4 f3 f2 f5 2 f1 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-39
SLIDE 39

Inductive Invariants

x, y, z range over Z (or Q)

3 f4 f3 f2 f5 2 f1 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-40
SLIDE 40

Inductive Invariants

x, y, z range over Z (or Q)

3 f4 f3 f5 2 f1 f2 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-41
SLIDE 41

Inductive Invariants

x, y, z range over Z (or Q)

3 f4 f3 f5 2 f1 f2 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-42
SLIDE 42

Inductive Invariants

x, y, z range over Z (or Q)

3 f4 f3 f5 2 f1 f2 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-43
SLIDE 43

Inductive Invariants

x, y, z range over Z (or Q)

3 f5 2 f1 f2 f4 f3 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-44
SLIDE 44

Inductive Invariants

x, y, z range over Z (or Q)

3 2 f1 f2 f4

3

f5 f 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-45
SLIDE 45

Inductive Invariants

x, y, z range over Z (or Q)

3 2 f1 f2 f4

3

f5 f 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-46
SLIDE 46

Inductive Invariants

x, y, z range over Z (or Q)

3 2 f1 f2 f4

3

f5 f 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-47
SLIDE 47

Inductive Invariants

x, y, z range over Z (or Q)

3 2 f1 f2 f4 f3 f5 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-48
SLIDE 48

Inductive Invariants

x, y, z range over Z (or Q)

2 f1 f2 f4 f3 f5 1 3

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-49
SLIDE 49

Inductive Invariants

x, y, z range over Z (or Q)

2 f1 f2 f4 f3 f5 1 3

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-50
SLIDE 50

Inductive Invariants

x, y, z range over Z (or Q)

2 f1 f2 f4 f3 f5 1 3

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-51
SLIDE 51

Inductive Invariants

x, y, z range over Z (or Q)

2 f1 f2 f4 f3 f5 1 3

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-52
SLIDE 52

Inductive Invariants

x, y, z range over Z (or Q)

1

S 2 S S3 2

1

f2 f4 f3 f5 f 3 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-53
SLIDE 53

Inductive Invariants

x, y, z range over Z (or Q)

S

3

S 2

1

S 2

1

f2 f4 f3 f5 f 3 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-54
SLIDE 54

Inductive Invariants

x, y, z range over Z (or Q)

I S1

1

S3 I 2 I 3 S 2 2

1

f2 f4 f3 f5 f 3 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-55
SLIDE 55

Inductive Invariants

x, y, z range over Z (or Q)

I I 3 I

1 2

2

1

f2 f4 f3

5

f 3 f 1

I1, I2, I3 is an invariant (I1, I2, I3 ⊆ R3)

slide-56
SLIDE 56

Inductive Invariants

x, y, z range over Z (or Q)

2

I1 I I 3 f 1

3 5

f 3 2

1

f2 f4 f

I1, I2, I3 is an inductive invariant (I1, I2, I3 ⊆ R3)

slide-57
SLIDE 57

Inductive Invariants

x, y, z range over Z (or Q)

I

3 2 1

I I 2

1

f2 f4 f3

5

f 3 f 1

I1, I2, I3 is an inductive invariant (I1, I2, I3 ⊆ R3)

slide-58
SLIDE 58

Inductive Invariants

x, y, z range over Z (or Q)

I S1

1

S3 I 2 I 3 S 2 2

1

f2 f4 f3 f5 f 3 1

I1, I2, I3 is an inductive invariant (I1, I2, I3 ⊆ R3)

slide-59
SLIDE 59

Inductive Invariants

x, y, z range over Z (or Q)

1

S 2 S S3 2

1

f2 f4 f3 f5 f 3 1

S1, S2, S3 is always an inductive invariant I1, I2, I3 ⊆ R3

slide-60
SLIDE 60

Inductive Invariants

x, y, z range over Z (or Q)

2

1

f2 f4 f3 f5 f 3 1

R3, R3, R3 is also always an inductive invariant I1, I2, I3 ⊆ R3

slide-61
SLIDE 61

Inductive Invariants

x, y, z range over Z (or Q)

I

3 1 1

S3 I 2 I S 2 S 2

1

f2 f4 f3 f5 f 3

BAD!

1

B A D !

B A D !

A good invariant is worth a thousand reachability queries!R3

slide-62
SLIDE 62

Generating Inductive Invariants

Choose the right abstract domain

Some domains always have ‘best’ (strongest, smallest) invariants, others not

slide-63
SLIDE 63

Generating Inductive Invariants

Choose the right abstract domain

Some domains always have ‘best’ (strongest, smallest) invariants, others not

Compute an invariant!

Many eclectic methods: fixed-point computations, constraint solving, interpolation, abduction, machine learning, . . . Some approaches require ‘widening’ to ensure termination Other techniques invoke e.g. dimension or algebraic arguments Often trade-off between precision and complexity . . .

slide-64
SLIDE 64

A Menagerie of Abstract Domains

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞)

slide-65
SLIDE 65

A Menagerie of Abstract Domains

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞) Octagons [Min´ e 06] x + y − 2 ≤ 2 ∧ x ≤ 3 ∧ y − x ≤ 1

slide-66
SLIDE 66

A Menagerie of Abstract Domains

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞) Octagons [Min´ e 06] x + y − 2 ≤ 2 ∧ x ≤ 3 ∧ y − x ≤ 1 Linear / Algebraic sets [M¨ uller-Olm, Seidl 04] x3 − y2 = 0 ∧ x2yz5 − 3yz = 0

slide-67
SLIDE 67

A Menagerie of Abstract Domains

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞) Octagons [Min´ e 06] x + y − 2 ≤ 2 ∧ x ≤ 3 ∧ y − x ≤ 1 Linear / Algebraic sets [M¨ uller-Olm, Seidl 04] x3 − y2 = 0 ∧ x2yz5 − 3yz = 0 Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2y − 3z + 4 ≤ 0 ∨ 2x + 7y + 2z ≥ 0

slide-68
SLIDE 68

A Menagerie of Abstract Domains

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞) Octagons [Min´ e 06] x + y − 2 ≤ 2 ∧ x ≤ 3 ∧ y − x ≤ 1 Linear / Algebraic sets [M¨ uller-Olm, Seidl 04] x3 − y2 = 0 ∧ x2yz5 − 3yz = 0 Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2y − 3z + 4 ≤ 0 ∨ 2x + 7y + 2z ≥ 0 Semialgebraic sets [Bagnara et al. 05] x2 + y2 + z2 ≤ 0 ∨ x2yz5 − 3yz + 6 ≥ 0

slide-69
SLIDE 69

Comparing Abstractions

Original set:

slide-70
SLIDE 70

Comparing Abstractions

Interval abstraction: g

slide-71
SLIDE 71

Comparing Abstractions

Octagonal abstraction:

slide-72
SLIDE 72

Comparing Abstractions

Polyhedral abstraction:

slide-73
SLIDE 73

Comparing Abstractions

Algebraic/semialgebraic/semilinear abstraction :

slide-74
SLIDE 74

Comparing Abstractions

Interval ≤ Octagonal ≤ Semilinear ≤ Semialgebraic ≤ ≤ Linear ≤ Algebraic

  • linear

polynomial

slide-75
SLIDE 75

Why Linear Invariants Are Not Enough

s := 0; x := 0; while . . . do x := x + 1; s := s + x;

slide-76
SLIDE 76

Why Linear Invariants Are Not Enough

s := 0; x := 0; while . . . do x := x + 1; s := s + x; The loop invariant is: s = x(x + 1) 2

slide-77
SLIDE 77

Why Linear Invariants Are Not Enough

s := 0; x := 0; while . . . do x := x + 1; s := s + x; The loop invariant is: s = x(x + 1) 2 Or equivalently: p(s, x) = 2s − x2 − x = 0

slide-78
SLIDE 78

Does This Program Halt?

x := 3; y := 2; while 2y − x ≥ −2 do x y

  • :=

10 −8 6 −4 x y

  • ;

Polynomial invariant: 9x2 − 24xy − x + 16y2 + y = 0

slide-79
SLIDE 79

Does This Program Halt?

x := 3; y := 2; while 2y − x ≥ −2 do x y

  • :=

10 −8 6 −4 x y

  • ;

Polynomial invariant: 9x2 − 24xy − x + 16y2 + y = 0

slide-80
SLIDE 80

Does This Program Halt?

x := 3; y := 2; while 2y − x ≥ −2 do x y

  • :=

10 −8 6 −4 x y

  • ;

Polynomial invariant: 9x2 − 24xy − x + 16y2 + y = 0

slide-81
SLIDE 81

Does This Program Halt?

x := 3; y := 2; while 2y − x ≥ −2 do x y

  • :=

10 −8 6 −4 x y

  • ;

Polynomial invariant: 9x2 − 24xy − x + 16y2 + y = 0

slide-82
SLIDE 82

Does This Program Halt?

x := 3; y := 2; while 2y − x ≥ −2 do x y

  • :=

10 −8 6 −4 x y

  • ;

Polynomial invariant: 9x2 − 24xy − x + 16y2 + y = 0

slide-83
SLIDE 83

Does This Program Halt?

x := 3; y := 2; while 2y − x ≥ −2 do x y

  • :=

10 −8 6 −4 x y

  • ;

Polynomial invariant: 9x2 − 24xy − x + 16y2 + y = 0

slide-84
SLIDE 84

Does This Program Halt?

x := 3; y := 2; while 2y − x ≥ −2 do x y

  • :=

10 −8 6 −4 x y

  • ;

Deciding termination of simple linear loops is open! “It is faintly outrageous that this problem is still open; it is saying that we do not know how to decide the Halting Problem even for ‘linear’ automata!” Terence Tao

slide-85
SLIDE 85

A Class of Decision Problems

The Monniaux Problem Given a program, a safety specification and an abstract domain does there exist an adequate inductive invariant?

slide-86
SLIDE 86

A Class of Decision Problems

The Monniaux Problem Given a program, a safety specification and an abstract domain does there exist an adequate inductive invariant? “We started this work hoping to vindicate forty years of research on heuristics by showing that the existence of polyhedral inductive separating invariants in a system with transitions in linear arithmetic (integer or rational) is undecidable.” David Monniaux

slide-87
SLIDE 87

What Are Affine Programs? 2 1 3 f1 f4 f3 f2 f5

slide-88
SLIDE 88

What Are Affine Programs? 2 1 3 f1 f4 f3 f2 f5

slide-89
SLIDE 89

What Are Affine Programs? 2 1 3 f1 f4 f3 f2 f5

Only ‘nondeterministic’ branching (no conditionals)

slide-90
SLIDE 90

What Are Affine Programs? 2 1 3 f1 f4 f3 f2 f5

Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear)

slide-91
SLIDE 91

What Are Affine Programs? 1 3 f4 f3 f2 f5 2 − 3 :=7 x + 2 z y

Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear)

slide-92
SLIDE 92

What Are Affine Programs? 1 3 f4 f3 f2 f5 2 − 3 :=7 x + 2 z y

Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear) Also allow nondeterministic assignments x := ?

slide-93
SLIDE 93

What Are Affine Programs? 1 3 f3 f2 f5 2 := x :=7 − 3 + 2 z y y ?

Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear) Also allow nondeterministic assignments x := ?

slide-94
SLIDE 94

What Are Affine Programs? 1 3 f3 f2 f5 2 := x :=7 − 3 + 2 z y y ?

Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear) Also allow nondeterministic assignments x := ? Affine programs: can overapproximate more complex programs

slide-95
SLIDE 95

What Are Affine Programs? 1 3 f3 f2 f5 2 := x :=7 − 3 + 2 z y y ?

Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear) Also allow nondeterministic assignments x := ? Affine programs: can overapproximate more complex programs already cover a range of existing formalisms, e.g. probabilistic / quantum / quantitative automata, . . .

slide-96
SLIDE 96

From Affine Programs to Linear Semigroups

2 1 3 f1 f4 f3 f2 f5

1

M

4

M

5

M

2

M

3

M

each Mi ∈ Qd2

slide-97
SLIDE 97

Some Hard Problems for Linear Semigroups

Theorem (Markov 1947) There is a fixed set of 6 × 6 integer matrices M1, . . . , Mk such that the membership problem “M ∈ M1, . . . , Mk?” is undecidable.

slide-98
SLIDE 98

Some Hard Problems for Linear Semigroups

Theorem (Markov 1947) There is a fixed set of 6 × 6 integer matrices M1, . . . , Mk such that the membership problem “M ∈ M1, . . . , Mk?” is undecidable. Mortality: Is the zero matrix contained in the semigroup generated by a given set of n × n matrices with integer entries?

slide-99
SLIDE 99

Some Hard Problems for Linear Semigroups

Theorem (Markov 1947) There is a fixed set of 6 × 6 integer matrices M1, . . . , Mk such that the membership problem “M ∈ M1, . . . , Mk?” is undecidable. Mortality: Is the zero matrix contained in the semigroup generated by a given set of n × n matrices with integer entries? Theorem (Paterson 1970) The mortality problem is undecidable for 3 × 3 matrices.

slide-100
SLIDE 100

State of the Menagerie

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞) Octagons [Min´ e 06] x + y − 2 ≤ 2 ∧ x ≤ 3 ∧ y − x ≤ 1 Linear / Algebraic sets [M¨ uller-Olm, Seidl 04] x3 − y2 = 0 ∧ x2yz5 − 3yz = 0 Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2y − 3z + 4 ≤ 0 ∨ 2x + 7y + 2z ≥ 0 Semialgebraic sets [Bagnara et al. 05] x2 + y2 + z2 ≤ 0 ∨ x2yz5 − 3yz + 6 ≥ 0

slide-101
SLIDE 101

State of the Menagerie

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞) Octagons [Min´ e 06] x + y − 2 ≤ 2 ∧ x ≤ 3 ∧ y − x ≤ 1 Linear / Algebraic sets [M¨ uller-Olm, Seidl 04] x3 − y2 = 0 ∧ x2yz5 − 3yz = 0 Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2y − 3z + 4 ≤ 0 ∨ 2x + 7y + 2z ≥ 0 Semialgebraic sets [Bagnara et al. 05] x2 + y2 + z2 ≤ 0 ∨ x2yz5 − 3yz + 6 ≥ 0

slide-102
SLIDE 102

Karr’s Algorithm, Acta Informatica 76

Theorem (Karr 76) There is an algorithm which computes, for any given affine program over Q, its strongest linear inductive invariant.

slide-103
SLIDE 103

Smallest Algebraic Invariants

Theorem (Hrushovski, Ouaknine, Pouly, Worrell 18) The problem of the existence of algebraic inductive safety invariants for affine program is decidable.

slide-104
SLIDE 104

Smallest Algebraic Invariants

Theorem (Hrushovski, Ouaknine, Pouly, Worrell 18) The problem of the existence of algebraic inductive safety invariants for affine program is decidable. Smallest algebraic set containing all reachable configurations ⇐ ⇒ Zariski closure of the set of reachable configurations

slide-105
SLIDE 105

Smallest Algebraic Invariants

Theorem (Hrushovski, Ouaknine, Pouly, Worrell 18) The problem of the existence of algebraic inductive safety invariants for affine program is decidable. Smallest algebraic set containing all reachable configurations ⇐ ⇒ Zariski closure of the set of reachable configurations Theorem (Hrushovski, Ouaknine, Pouly, Worrell 18) The presence of guards or polynomial transitions makes the problem undecidable.

slide-106
SLIDE 106

State of the Menagerie

Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0, 4] ∧ y ∈ [2, ∞) Octagons [Min´ e 06] x + y − 2 ≤ 2 ∧ x ≤ 3 ∧ y − x ≤ 1 Linear / Algebraic sets [M¨ uller-Olm, Seidl 04] x3 − y2 = 0 ∧ x2yz5 − 3yz = 0 Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2y − 3z + 4 ≤ 0 ∨ 2x + 7y + 2z ≥ 0 Semialgebraic sets [Bagnara et al. 05] x2 + y2 + z2 ≤ 0 ∨ x2yz5 − 3yz + 6 ≥ 0

slide-107
SLIDE 107

Undecidability for Semilinear invariants

Theorem The problem of the existence of semilinear safety invariants is undecidable.

slide-108
SLIDE 108

Undecidability for Semilinear invariants

Theorem The problem of the existence of semilinear safety invariants is undecidable. M1 M2 Only two transitions required (matrices of size 336). A single ”bad” point.

slide-109
SLIDE 109

Undecidability for Semilinear invariants

Theorem The problem of the existence of semilinear safety invariants is undecidable. M1 M2 Only two transitions required (matrices of size 336). A single ”bad” point. Reachability of the ”bad” point is not possible.

slide-110
SLIDE 110

Undecidability for Semilinear invariants

Theorem The problem of the existence of semilinear safety invariants is undecidable. M1 M2 Only two transitions required (matrices of size 336). A single ”bad” point. Reachability of the ”bad” point is not possible. Invariant of the form: I = S ∪ F S is a simple safe set. F is a finite number of points.

slide-111
SLIDE 111

Decidability for Single Loop

While x / ∈ Bad do x := Mx

slide-112
SLIDE 112

Decidability for Single Loop

While x / ∈ Bad do x := Mx Theorem The problem of the existence of semilinear safety invariants for while loop is decidable.

slide-113
SLIDE 113

Decidability for Single Loop

While x / ∈ Bad do x := Mx Theorem The problem of the existence of semilinear safety invariants for while loop is decidable. Build the Jordan normal form;

slide-114
SLIDE 114

Decidability for Single Loop

While x / ∈ Bad do x := Mx Theorem The problem of the existence of semilinear safety invariants for while loop is decidable. Build the Jordan normal form; Build invariant if there exist ”simple” eigenvalues;

slide-115
SLIDE 115

Decidability for Single Loop

While x / ∈ Bad do x := Mx Theorem The problem of the existence of semilinear safety invariants for while loop is decidable. Build the Jordan normal form; Build invariant if there exist ”simple” eigenvalues; Prove the absence of non-trivial semilinear invariant otherwise.

slide-116
SLIDE 116

Case |λ| > 1

Starting in x Bad =y Sequence in the eigenspace is a diverging spiral

slide-117
SLIDE 117

Case |λ| > 1

Starting in x Bad =y Sequence in the eigenspace is a diverging spiral Most difficult case: modulus 1 and not root of unity.

slide-118
SLIDE 118

Case |λ| > 1

Starting in x Bad =y Sequence in the eigenspace is a diverging spiral Most difficult case: modulus 1 and not root of unity. → Only semilinear invariant given by relations between eigenvalues

slide-119
SLIDE 119

What about Convex Invariant?

simplicity of representation and implementation algorithmic tractability and scalability good termination heuristics

slide-120
SLIDE 120

What about Convex Invariant?

simplicity of representation and implementation algorithmic tractability and scalability good termination heuristics ✗ lack of expressivity

slide-121
SLIDE 121

What about Convex Invariant?

simplicity of representation and implementation algorithmic tractability and scalability good termination heuristics ✗ lack of expressivity Theorem (Monniaux 19) The problem of the existence of convex semilinear safety invariants for affine programs with polynomial guards is undecidable.

slide-122
SLIDE 122

What about Convex Invariant?

simplicity of representation and implementation algorithmic tractability and scalability good termination heuristics ✗ lack of expressivity Theorem (Monniaux 19) The problem of the existence of convex semilinear safety invariants for affine programs with polynomial guards is undecidable. The general case remains open and challenging.

slide-123
SLIDE 123

Ongoing Research Programme

The Monniaux Problem for convex invariants Orbit-finiteness for polynomial programs Algebraic and semialgebraic invariants for continuous dynamical systems & hybrid automata

slide-124
SLIDE 124

A Bouncing Ball

slide-125
SLIDE 125

A Linear Hybrid Automaton (LHA)

slide-126
SLIDE 126

Strongest Algebraic Invariants for LHA

vx = c

slide-127
SLIDE 127

Strongest Algebraic Invariants for LHA

vx = c x = tc

slide-128
SLIDE 128

Strongest Algebraic Invariants for LHA

vx = c x = tc vy 2 + 2g(y − h) = 0