coupling proofs are probabilistic product programs
play

Coupling Proofs Are Probabilistic Product Programs Gilles Barthe, - PowerPoint PPT Presentation

Coupling Proofs Are Probabilistic Product Programs Gilles Barthe, Benjmain Grgoire, Justin Hsu*, Pierre-Yves Strub IMDEA Software, Inria, University of Pennsylvania*, cole Polytechnique January 18, 2017 1 A simple card-flipping process


  1. Coupling Proofs Are Probabilistic Product Programs Gilles Barthe, Benjmain Grégoire, Justin Hsu*, Pierre-Yves Strub IMDEA Software, Inria, University of Pennsylvania*, École Polytechnique January 18, 2017 1

  2. A simple card-flipping process Setup ◮ Input: position in { 1 , . . . , 9 } ◮ Repeat: – Draw uniformly random card ∈ { 1 , . . . , 9 } – Go forward that many steps ◮ Output last position before crossing 100 2

  3. In pictures 3 3

  4. In pictures 3 1 3

  5. In pictures 3 1 5 3

  6. In pictures 3 1 5 4 3

  7. In pictures 3 1 5 4 Output last position: 99 3

  8. Starting at a different position 1 4

  9. Starting at a different position 1 2 4

  10. Starting at a different position 1 2 9 4

  11. Starting at a different position 1 2 9 8 4

  12. Starting at a different position 1 2 9 8 How close are the two output distributions? 4

  13. Combine first process and second process 5

  14. Combine first process and second process 3 5

  15. Combine first process and second process 3 5

  16. Combine first process and second process 3 1 5

  17. Combine first process and second process 3 1 5

  18. Combine first process and second process 3 1 2 5

  19. Combine first process and second process 3 1 2 5

  20. Combine first process and second process 3 1 2 1 5

  21. Combine first process and second process 3 1 2 1 5

  22. Combine first process and second process 3 1 2 1 1 5

  23. Combine first process and second process 3 1 2 1 1 5

  24. Combine first process and second process 3 1 2 1 1 7 5

  25. Combine first process and second process 3 1 2 1 1 7 4 5

  26. Combine first process and second process 3 1 2 1 1 7 4 Product program: One program simulating two programs 5

  27. Why is this interesting? 6

  28. In general Property P of product program ⇓ Property P ′ of two programs 7

  29. Our construction Two simulated programs can share randomness 8

  30. 3 1 5 4 1 2 9 8 Distance between output distributions 9

  31. 3 1 5 4 = ⇒ 3 1 2 1 1 7 4 1 2 9 8 Distance between output distributions 9

  32. 3 1 5 4 = ⇒ 3 1 2 1 1 7 4 1 2 9 8 Distance between Probability that ≤ output distributions outputs differ 9

  33. 3 1 5 4 Today: = ⇒ 3 1 2 1 1 7 4 1 2 9 8 Distance between Probability that ≤ output distributions outputs differ 9

  34. Our technical contributions A probabilistic product construction with shared randomness A probabilistic program logic × pRHL: a proof-relevant version of pRHL 10

  35. A crash course: Probabilistic Relational Hoare Logic [BGZ-B] 11

  36. Imperative language c ::= x ← e | c ; c | if e then c else c | while e do c 12

  37. Imperative language c ::= x ← e | c ; c | if e then c else c | while e do c | x ← [ S ] $ Uniform sampling from finite set [ S ] ◮ coin flip: [ heads, tails ] ◮ random card: [ 1, ..., 9 ] 12

  38. Imperative language c ::= x ← e | c ; c | if e then c else c | while e do c | x ← [ S ] $ Uniform sampling from finite set [ S ] ◮ coin flip: [ heads, tails ] ◮ random card: [ 1, ..., 9 ] Command semantics [ [ c ] ] ◮ Input: memory ◮ Output: distribution over memories 12

  39. Judgments: similar to Hoare logic { P } c { Q } 13

  40. Judgments: similar to Hoare logic { P } c { Q } Assertions: binary relation on memories ◮ Can refer to tagged program variables: x � 1 � and x � 2 � ◮ First order formulas, non-probabilistic 13

  41. Judgments: similar to Hoare logic { P } c { Q } Assertions: binary relation on memories ◮ Can refer to tagged program variables: x � 1 � and x � 2 � ◮ First order formulas, non-probabilistic If the two inputs satisfy P , we can share the randomness on two runs of c so that the two outputs satisfy Q . 13

  42. Proof rules in pRHL: mostly similar to Hoare logic 14

  43. Proof rules in pRHL: mostly similar to Hoare logic 14

  44. Proof rules in pRHL: Random sampling f : S → S bijection {⊤} x ← [ S ] { x � 2 � = f ( x � 1 � ) } $ 15

  45. Proof rules in pRHL: Random sampling f : S → S bijection {⊤} x ← [ S ] { x � 2 � = f ( x � 1 � ) } $ Select how to share randomness 15

  46. Introducing × pRHL Product pRHL 16

  47. Idea: Product program c × simulates two processes { P } c { Q } 17

  48. Idea: Product program c × simulates two processes { P } c { Q } � c × 17

  49. Idea: Product program c × simulates two processes { P } c { Q } � c × Runs in combined memory ◮ Two separate copies of single memory ◮ Duplicate program variables: x � 1 � and x � 2 � 17

  50. Idea: Product program c × simulates two processes { P } c { Q } � c × Runs in combined memory ◮ Two separate copies of single memory ◮ Duplicate program variables: x � 1 � and x � 2 � Property of c × = ⇒ property of two runs of c 17

  51. A tour of × pRHL rules: [Seq] In pRHL: { Q } c ′ { R } { P } c { Q } { P } c ; c ′ { R } 18

  52. A tour of × pRHL rules: [Seq] In × pRHL: { Q } c ′ { R } � c ×′ { P } c { Q } � c × { P } c ; c ′ { R } � c × ; c ×′ 18

  53. A tour of × pRHL rules: [Seq] In × pRHL: { Q } c ′ { R } � c ×′ { P } c { Q } � c × { P } c ; c ′ { R } � c × ; c ×′ Sequence product programs 18

  54. A tour of × pRHL proof rules: [Rand] In pRHL: f : S → S bijection {⊤} x ← [ S ] { x � 2 � = f ( x � 1 � ) } $ 19

  55. A tour of × pRHL proof rules: [Rand] In × pRHL: f : S → S bijection {⊤} x ← [ S ] { x � 2 � = f ( x � 1 � ) } � x � 1 � ← [ S ] ; x � 2 � ← f ( x � 1 � ) $ $ 19

  56. A tour of × pRHL proof rules: [Rand] In × pRHL: f : S → S bijection {⊤} x ← [ S ] { x � 2 � = f ( x � 1 � ) } � x � 1 � ← [ S ] ; x � 2 � ← f ( x � 1 � ) $ $ Sample x � 2 � depends on x � 1 � 19

  57. A tour of × pRHL rules: [Case] In pRHL: { P ∧ Q } c { R } { P ∧ ¬ Q } c { R } { P } c { R } 20

  58. A tour of × pRHL rules: [Case] In × pRHL: { P ∧ Q } c { R } � c × { P ∧ ¬ Q } c { R } � c × ¬ { P } c { R } � if Q then c × else c × ¬ 20

  59. A tour of × pRHL rules: [Case] In × pRHL: { P ∧ Q } c { R } � c × { P ∧ ¬ Q } c { R } � c × ¬ { P } c { R } � if Q then c × else c × ¬ Case in proof � conditional in product 20

  60. See the paper for ... Verifying rapid mixing for Markov chains ◮ Examples from statistical physics ◮ A cool card trick Advanced proof rules ◮ Asynchronous loop rule Soundness 21

  61. Our technical contributions A probabilistic product construction with shared randomness A probabilistic program logic × pRHL: a proof-relevant version of pRHL 22

  62. 23

  63. Proof by coupling A proof technique from probability theory ◮ Given: two processes ◮ Specify: how to coordinate random samplings ◮ Analyze: properties of linked/coupled processes Attractive features ◮ Compositional ◮ Reason about relation between samples, not probabilities ◮ Reduce properties of two programs to properties of one program 24

  64. Coupling proofs ≈ pRHL proofs 25

  65. Coupling proofs ≈ pRHL proofs describe Two coupled processes 25

  66. Coupling proofs ≈ pRHL proofs describe encode Two coupled Probabilistic ≈ processes product programs 25

  67. Coupling proofs ≈ pRHL proofs describe encode Two coupled Probabilistic ≈ processes product programs Probabilistic product programs are the computational content of coupling proofs 25

Recommend


More recommend