synthesizing probabilistic invariants via doob s
play

Synthesizing Probabilistic Invariants via Doobs decomposition G. - PowerPoint PPT Presentation

Synthesizing Probabilistic Invariants via Doobs decomposition G. Barthe, T. Espitau , L.M.F Fioriti, J. Hsu CAV, 2016 Introduction 1 Introduction Probabilistic 1 2 Computations Ubiquitous in many fields (ML, Crypto, Privacy,)


  1. Synthesizing Probabilistic Invariants via Doob’s decomposition G. Barthe, T. Espitau , L.M.F Fioriti, J. Hsu CAV, 2016

  2. Introduction 1

  3. Introduction Probabilistic 1 2 Computations Ubiquitous in many fields (ML, Crypto, Privacy,…) But… Difficult to prove Termination ? (Certainly, almost sure, non terminating)

  4. Introduction Probabilistic Doob’s 1 2 3 Martingales? Computations Decomposition Ubiquitous in many fields Difficulty to transfer local to (ML, Crypto, Privacy,…) end of program But… Difficult to prove Reason on average values Termination ? Martingales have the required (Certainly, almost sure, non transfer property terminating)

  5. Introduction Probabilistic Doob’s 1 2 3 Martingales? Computations Decomposition Ubiquitous in many fields Difficulty to transfer local to But ( again )… Difficult to find (ML, Crypto, Privacy,…) end of program good ones But… Difficult to prove Reason on average values Automated generation? Doob’s decomposition Termination ? Martingales have the required Formal method to generate (Certainly, almost sure, non transfer property martingales from a seed . terminating)

  6. Martingale theory 101 (I)

  7. Martingale theory 101 (I) Step 1: Some probabilities ● Ω set of outcomes. Sigma algebra: Probability space ● Set F of subsets of Ω Closed under complements, countable unions, countable intersections. ● Probability measure: Countably additive mapping P : F → [0, 1] P (Ω) = 1.

  8. Martingale theory 101 (II) Step 2: Stochastic process ● Random variable: X : Ω → R measurable ( X -1 ( (a,b] ) ∈ F ) Filtration: ( F i ) ⊂ F s.t: ● F i-1 ⊂ F i ● Process wrt filtration F i : Sequence (X i ) s.t: X i is F i measurable

  9. Martingale theory 101 (II) Interlude: PL setting i = 0 Ω: Element = Possible outcome of samples While b do z[i] ← $ Samplings... F i : Events sampled at iteration i or before x[i] ← f(x[i-1], ... , f[0], z[i], … ,z[0]) i++ end Process (X i ) is adapted to the filtration iff: X i is defined in term of elements sampled at step i or before

  10. Martingale theory 101 (III) Step 3: Expectations & Moments ● Expectation: E [X] = ∑ u ∈ Ω X(u) P (u) Conditional expectation wrt G ⊂ F: E [X|G] ● Y G-mesurable st E [X. 1 A ] = E [Y. 1 A ] for A ∈ G

  11. Martingale theory 101 (IV) Step 4 ( Final! ): Martingales Martingale: ● E [ X i | F i-1 ] = X i-1 Average value of the current step is equal to the value of the previous step

  12. Playing with martingales Doob’s decomposition (X i ) stochastic process → (M i ) martingale M 0 = X 0 M i = X 0 + ∑ i j=1 X j - E [X j | F j-1 ]

  13. Black Magic of martingales Optional Stopping theorem (M i ) martingale → Expectations are invariants E [M j ] = E [M 0 ]

  14. Black Magic of martingales Optional Stopping theorem E [M j ] = E [M 0 ]

  15. Black Magic of martingales Optional Stopping theorem E [M T ] = E [M 0 ] For T a stopping time : T : Ω → R { w ∈ Ω | T(w) ≤ i } ⊂ F i

  16. Black Magic of martingales Optional Stopping theorem E [M T ] = E [M 0 ] For T a stopping time : T : Ω → R { w ∈ Ω | T(w) ≤ i } ⊂ F i and... |M i - M i-1 | ≤ C E [T] < ∞

  17. Let’s play with a program...

  18. Geometric distribution x[0] ← 0; while (z ̸ = 0) do z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  19. Geometric distribution Stopping time? (on average) x[0] ← 0; while (z ̸ = 0) do z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  20. Geometric distribution Stopping time? (on average) x[0] ← 0; while (z ̸ = 0) do 1/(1-p) z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  21. Geometric distribution Equation for x ? X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  22. Geometric distribution Equation for x ? X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do z ← $ Bern(p, {1, 0}); Polynomial extraction x ← x[-1] + z; end

  23. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = X 0 M i = X 0 + ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - E [X j | F j-1 ] x ← x[-1] + z; end Doob

  24. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = X 0 + ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - E [X j | F j-1 ] x ← x[-1] + z; end

  25. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - E [X j | F j-1 ] x ← x[-1] + z; end

  26. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - E [X j-1 + Z i | F j-1 ] x ← x[-1] + z; end

  27. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - E [X j-1 | F j-1 ] + E [Z i | F j-1 ] x ← x[-1] + z; end

  28. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - E [X j-1 | F j-1 ] + E [Z i ] x ← x[-1] + z; end

  29. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - E [X j-1 | F j-1 ] + p x ← x[-1] + z; end

  30. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = ∑ i z ← $ Bern(p, {1, 0}); j=1 X j - X j-1 + p x ← x[-1] + z; end

  31. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = X i - X 0 + i p z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  32. Geometric distribution X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do M 0 = 0 M i = X i + i p z ← $ Bern(p, {1, 0}); Simplify... x ← x[-1] + z; end

  33. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  34. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do E [ M 0 ] = E [ M T ] z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end Optional Stopping

  35. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do 0 = E [ M T ] z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  36. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do 0 = E [ X T - Tp] z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  37. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do 0 = E [ X T ] - E [ Tp] z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  38. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do Simplify... 0 = E [ X T ] - p E [T] z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  39. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do Hint 0 = E [T-1] - p E [T] z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end X T = T-1

  40. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do 0 = E [T] - 1 - p E [T] z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  41. Geometric distribution M 0 = 0 M i = X i + i p X i = X i-1 + Z i x[0] ← 0; while (z ̸ = 0) do Simplify... E [T] = 1 /(1-p) z ← $ Bern(p, {1, 0}); x ← x[-1] + z; end

  42. Automatization Inputs

  43. Automatization Extract Poly. Inputs

  44. Automatization Doob decomp. Extract Poly. Inputs

  45. Automatization Doob decomp. Extract Simplify Poly. Inputs

  46. Automatization Doob decomp. Extract Simplify OST Poly. Inputs

  47. Automatization Doob decomp. Extract Simplify OST Poly. Inputs Verify Hints.

  48. Automatization Doob decomp. Extract Simplify OST Poly. Inputs Verify Simplify Hints.

  49. Gambler’s ruin

  50. Gambler’s ruin X x[0] ← a; while ( 0 < x < b ) do z ← $ Bern(1/2, {-1, 1}); x ← x + z; end

  51. Automatization Extract Poly. Inputs

  52. Gambler’s ruin X i = X i-1 + Z i x[0] ← a; while ( 0 < x < b ) do z ← $ Bern(1/2, {-1, 1}); x ← x + z; end

  53. Automatization Doob decomp. Extract Poly. Inputs

  54. Gambler’s ruin X i = X i-1 + Z i M 0 = X 0 M i = X i x[0] ← a; while ( 0 < x < b ) do z ← $ Bern(1/2, {-1, 1}); x ← x + z; end

  55. Automatization Doob decomp. Extract Simplify OST Poly. Inputs

  56. Gambler’s ruin X i = X i-1 + Z i M 0 = X 0 M i = X i x[0] ← a; while ( 0 < x < b ) do z ← $ Bern(1/2, {-1, 1}); a = E [X 0 ] = E [X T ] x ← x + z; end

  57. Automatization Doob decomp. Extract Simplify OST Poly. Inputs Verify Hints.

  58. Gambler’s ruin X i = X i-1 + Z i M 0 = X 0 M i = X i x[0] ← a; while ( 0 < x < b ) do z ← $ Bern(1/2, {-1, 1}); x=0 or x=b a = E [X 0 ] = E [X T ] x ← x + z; end

  59. Automatization Doob decomp. Extract Simplify OST Poly. Inputs Verify Simplify Hints.

  60. Gambler’s ruin X i = X i-1 + Z i M 0 = X 0 M i = X i x[0] ← a; while ( 0 < x < b ) do z ← $ Bern(1/2, {-1, 1}); x=0 or x=b a = E [X 0 ] = E [X T ] x ← x + z; end a = b P [x=b]

Recommend


More recommend