on the monniaux problem in abstract interpretation
play

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,


  1. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  2. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  3. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  4. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  5. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  6. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  7. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  8. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  9. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  10. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  11. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  12. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  13. Inductive Invariants x , y , z range over Z (or Q ) S 2 S 1 f 1 f 2 2 1 f 3 f 5 f 4 3 S 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  14. Inductive Invariants x , y , z range over Z (or Q ) S 2 S 1 f 1 f 2 2 1 f 3 f 5 f 4 3 S 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  15. Inductive Invariants x , y , z range over Z (or Q ) I 2 S 2 I S 1 1 f 1 f 2 2 1 f 3 f 5 f 4 3 S 3 I 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  16. Inductive Invariants x , y , z range over Z (or Q ) I 2 I 1 f 1 f 2 2 1 f 3 f f 4 5 3 I 3 � I 1 , I 2 , I 3 � is an invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  17. Inductive Invariants x , y , z range over Z (or Q ) I 2 I 1 f 1 f 2 2 1 f 3 f f 4 5 3 I 3 � I 1 , I 2 , I 3 � is an inductive invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  18. Inductive Invariants x , y , z range over Z (or Q ) I 2 I 1 f 1 f 2 2 1 f 3 f f 4 5 3 I 3 � I 1 , I 2 , I 3 � is an inductive invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  19. Inductive Invariants x , y , z range over Z (or Q ) I 2 S 2 I S 1 1 f 1 f 2 2 1 f 3 f 5 f 4 3 S 3 I 3 � I 1 , I 2 , I 3 � is an inductive invariant ( I 1 , I 2 , I 3 ⊆ R 3 )

  20. Inductive Invariants x , y , z range over Z (or Q ) S 2 S 1 f 1 f 2 2 1 f 3 f 5 f 4 3 S 3 � S 1 , S 2 , S 3 � is always an inductive invariant I 1 , I 2 , I 3 ⊆ R 3

  21. Inductive Invariants x , y , z range over Z (or Q ) f 1 f 2 2 1 f 3 f 5 f 4 3 � R 3 , R 3 , R 3 � is also always an inductive invariant I 1 , I 2 , I 3 ⊆ R 3

  22. Inductive Invariants x , y , z range over Z (or Q ) I 2 S 2 I S 1 1 BAD! f 1 f 2 2 1 f 3 f 5 f 4 3 ! D B A A B D S 3 ! I 3 A good invariant is worth a thousand reachability queries! R 3 �

  23. Generating Inductive Invariants Choose the right abstract domain Some domains always have ‘best’ (strongest, smallest) invariants, others not

  24. 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 . . .

  25. A Menagerie of Abstract Domains Intervals [Cousot, Cousot 76], [Harrison 77] x ∈ [0 , 4] ∧ y ∈ [2 , ∞ )

  26. 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

  27. 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] x 3 − y 2 = 0 x 2 yz 5 − 3 yz = 0 ∧

  28. 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] x 3 − y 2 = 0 x 2 yz 5 − 3 yz = 0 ∧ Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2 y − 3 z + 4 ≤ 0 ∨ 2 x + 7 y + 2 z ≥ 0

  29. 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] x 3 − y 2 = 0 x 2 yz 5 − 3 yz = 0 ∧ Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2 y − 3 z + 4 ≤ 0 ∨ 2 x + 7 y + 2 z ≥ 0 Semialgebraic sets [Bagnara et al. 05] x 2 + y 2 + z 2 ≤ 0 x 2 yz 5 − 3 yz + 6 ≥ 0 ∨

  30. Comparing Abstractions Original set:

  31. Comparing Abstractions Interval abstraction: g

  32. Comparing Abstractions Octagonal abstraction:

  33. Comparing Abstractions Polyhedral abstraction:

  34. Comparing Abstractions Algebraic/semialgebraic/semilinear abstraction :

  35. Comparing Abstractions Interval ≤ Octagonal ≤ Semilinear ≤ Semialgebraic ≤ ≤ Linear ≤ Algebraic � � linear polynomial

  36. Why Linear Invariants Are Not Enough s := 0; x := 0; while � . . . � do x := x + 1; s := s + x ;

  37. 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

  38. 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 ) = 2 s − x 2 − x = 0

  39. Does This Program Halt? x := 3; y := 2; while 2 y − x ≥ − 2 do � x � � 10 � � x � − 8 := ; y 6 − 4 y Polynomial invariant: 9 x 2 − 24 xy − x + 16 y 2 + y = 0

  40. Does This Program Halt? x := 3; y := 2; while 2 y − x ≥ − 2 do � x � � 10 � � x � − 8 := ; y 6 − 4 y Polynomial invariant: 9 x 2 − 24 xy − x + 16 y 2 + y = 0

  41. Does This Program Halt? x := 3; y := 2; while 2 y − x ≥ − 2 do � x � � 10 � � x � − 8 := ; y 6 − 4 y Polynomial invariant: 9 x 2 − 24 xy − x + 16 y 2 + y = 0

  42. Does This Program Halt? x := 3; y := 2; while 2 y − x ≥ − 2 do � x � � 10 � � x � − 8 := ; y 6 − 4 y Polynomial invariant: 9 x 2 − 24 xy − x + 16 y 2 + y = 0

  43. Does This Program Halt? x := 3; y := 2; while 2 y − x ≥ − 2 do � x � � 10 � � x � − 8 := ; y 6 − 4 y Polynomial invariant: 9 x 2 − 24 xy − x + 16 y 2 + y = 0

  44. Does This Program Halt? x := 3; y := 2; while 2 y − x ≥ − 2 do � x � � 10 � � x � − 8 := ; y 6 − 4 y Polynomial invariant: 9 x 2 − 24 xy − x + 16 y 2 + y = 0

  45. Does This Program Halt? x := 3; y := 2; while 2 y − x ≥ − 2 do � x � � 10 � � x � − 8 := ; y 6 − 4 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

  46. 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?

  47. 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

  48. What Are Affine Programs? f 1 f 2 2 1 f 3 f 5 f 4 3

  49. What Are Affine Programs? f 1 f 2 2 1 f 3 f 5 f 4 3

  50. What Are Affine Programs? f 1 f 2 2 1 f 3 f 5 f 4 3 Only ‘nondeterministic’ branching (no conditionals)

  51. What Are Affine Programs? f 1 f 2 2 1 f 3 f 5 f 4 3 Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear)

  52. What Are Affine Programs? x :=7 y − 3 z + 2 f 2 2 1 f 3 f 5 f 4 3 Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear)

  53. What Are Affine Programs? x :=7 y − 3 z + 2 f 2 2 1 f 3 f 5 f 4 3 Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear) Also allow nondeterministic assignments x := ?

  54. What Are Affine Programs? x :=7 − 3 + 2 y z f 2 1 2 f 3 f 5 y := ? 3 Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear) Also allow nondeterministic assignments x := ?

  55. What Are Affine Programs? x :=7 − 3 + 2 y z f 2 1 2 f 3 f 5 y := ? 3 Only ‘nondeterministic’ branching (no conditionals) All assignments are affine (or linear) Also allow nondeterministic assignments x := ? Affine programs: can overapproximate more complex programs

  56. What Are Affine Programs? x :=7 − 3 + 2 y z f 2 1 2 f 3 f 5 y := ? 3 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 , . . .

  57. From Affine Programs to Linear Semigroups M 2 M f 1 1 f 2 1 2 f 3 M 3 f 5 f 4 3 M 5 M 4 each M i ∈ Q d 2

  58. Some Hard Problems for Linear Semigroups Theorem (Markov 1947) There is a fixed set of 6 × 6 integer matrices M 1 , . . . , M k such that the membership problem “M ∈ � M 1 , . . . , M k � ?” is undecidable .

  59. Some Hard Problems for Linear Semigroups Theorem (Markov 1947) There is a fixed set of 6 × 6 integer matrices M 1 , . . . , M k such that the membership problem “M ∈ � M 1 , . . . , M k � ?” is undecidable . Mortality: Is the zero matrix contained in the semigroup generated by a given set of n × n matrices with integer entries?

  60. Some Hard Problems for Linear Semigroups Theorem (Markov 1947) There is a fixed set of 6 × 6 integer matrices M 1 , . . . , M k such that the membership problem “M ∈ � M 1 , . . . , M k � ?” 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.

  61. 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] x 3 − y 2 = 0 x 2 yz 5 − 3 yz = 0 ∧ Polyhedral / Semilinear sets [Cousot, Halbwachs 78] x + 2 y − 3 z + 4 ≤ 0 ∨ 2 x + 7 y + 2 z ≥ 0 Semialgebraic sets [Bagnara et al. 05] x 2 + y 2 + z 2 ≤ 0 x 2 yz 5 − 3 yz + 6 ≥ 0 ∨

Recommend


More recommend