Models for Probabilistic Programs with an Adversary Robert Rand, - - PowerPoint PPT Presentation

models for probabilistic programs with an adversary
SMART_READER_LITE
LIVE PREVIEW

Models for Probabilistic Programs with an Adversary Robert Rand, - - PowerPoint PPT Presentation

Models for Probabilistic Programs with an Adversary Robert Rand, Steve Zdancewic University of Pennsylvania Probabilistic Programming Semantics 2016 Interactive Proofs 2/47 Interactive Proofs 2/47 Interactive Proofs 2/47 Interactive


slide-1
SLIDE 1

Models for Probabilistic Programs with an Adversary

Robert Rand, Steve Zdancewic

University of Pennsylvania

Probabilistic Programming Semantics 2016

slide-2
SLIDE 2

Interactive Proofs

2/47

slide-3
SLIDE 3

Interactive Proofs

2/47

slide-4
SLIDE 4

Interactive Proofs

2/47

slide-5
SLIDE 5

Interactive Proofs

2/47

slide-6
SLIDE 6

Interactive Proofs

2/47

slide-7
SLIDE 7

Interactive Proofs

2/47

slide-8
SLIDE 8

Interactive Proofs

2/47

slide-9
SLIDE 9

Interactive Proofs

2/47

slide-10
SLIDE 10

Interactive Proofs

2/47

slide-11
SLIDE 11

Graph Non-Isomorphism

A B C D E 1 2 3 4 5

3/47

slide-12
SLIDE 12

Graph Non-Isomorphism

A B C D E 1 2 3 4 5

3/47

slide-13
SLIDE 13

Graph Non-Isomorphism

A B C D E 1 2 3 4 5 α β γ δ ǫ

3/47

slide-14
SLIDE 14

Graph Non-Isomorphism

A B C D E 1 2 3 4 5 α β γ δ ǫ

3/47

slide-15
SLIDE 15

Arthur Merlin Games

4/47

slide-16
SLIDE 16

Arthur Merlin Games

4/47

slide-17
SLIDE 17

Arthur Merlin Games

4/47

slide-18
SLIDE 18

Arthur Merlin Games

4/47

slide-19
SLIDE 19

Arthur Merlin Games

4/47

slide-20
SLIDE 20

Arthur Merlin Games

4/47

slide-21
SLIDE 21

Why Should We Care?

◮ Mixing probability and nondeterminism is

powerful.

◮ Private vs. public coins matter.

5/47

slide-22
SLIDE 22

Let’s Start with a Deterministic Semantics... skip / σ ⇓ σ σ(a) = n x := a / σ ⇓ σ[x → n] c1 / σ ⇓ σ′ c2 / σ′ ⇓ σ′′ c1; c2 / σ ⇓ σ′′ σ(b) = T c1 / σ ⇓ σ′ if b then c1 else c2 / σ ⇓ σ′

6/47

slide-23
SLIDE 23

For Point Distributions skip / [σ] ⇓ [σ] [σ](a) = n x := a / [σ] ⇓ [σ[x → n]] c1 / [σ] ⇓ Θ c2 / Θ ⇓ Θ′ c1; c2 / [σ] ⇓ Θ′ σ(b) = T c1 / [σ] ⇓ Θ if b then c1 else c2 / [σ] ⇓ Θ

7/47

Θ ::= [σ] | Θ ⊕p Θ

slide-24
SLIDE 24

Toss in Some Probability c1 / [σ] ⇓ Θ1 c2 / [σ] ⇓ Θ2 (c1 ⊕p c2) / [σ] ⇓ Θ1 ⊕p Θ2

8/47

Θ ::= [σ] | Θ ⊕p Θ

slide-25
SLIDE 25

Toss in Some Probability c1 / [σ] ⇓ Θ1 c2 / [σ] ⇓ Θ2 (c1 ⊕p c2) / [σ] ⇓ Θ1 ⊕p Θ2 [σ] (x := 0 ⊕ 1

3 x := 1)

8/47

⊕1/3 σ[x → 1] σ[x → 0] Θ ::= [σ] | Θ ⊕p Θ

slide-26
SLIDE 26

And Lift! c / Θ1 ⇓ Θ′

1

c / Θ2 ⇓ Θ′

2

c / Θ1 ⊕p Θ2 ⇓ Θ′

1 ⊕p Θ′ 2

9/47

slide-27
SLIDE 27

And Lift! c / Θ1 ⇓ Θ′

1

c / Θ2 ⇓ Θ′

2

c / Θ1 ⊕p Θ2 ⇓ Θ′

1 ⊕p Θ′ 2

⊕1/3 σ2 σ1 ⊕1/3 σ2[y → 5] σ1[y → 5]

y := 5

9/47

slide-28
SLIDE 28

The Toss Command ⊕1/3 ⊕1/2 ⊕1/5 c2σ3 c1σ3 ⊕1/5 c2σ2 c1σ2 ⊕1/5 c2σ1 c1σ1

10/47

c1 ⊕ 1

5 c2

slide-29
SLIDE 29

The Skip Command ⊕1/3 ⊕1/2 σ3 σ2 σ1 ⊕1/3 ⊕1/2 σ3 σ2 σ1 skip skip skip

11/47

slide-30
SLIDE 30

More Direct ⊕1/3 ⊕1/2 σ3 σ2 σ1 ⊕1/3 ⊕1/2 σ3 σ2 σ1 skip

12/47

slide-31
SLIDE 31

Direct Semantics skip / Θ ⇓ Θ σ(a) = n x := a / Θ ⇓ Θ[σi(x) → n] c1 / Θ ⇓ Θ′ c2 / Θ′ ⇓ Θ′′ c1; c2 / Θ ⇓ Θ′′

Prb(Θ1) = 1 c1 / Θ1 ⇓ Θ′

1

c2 / Θ0 ⇓ Θ′ Prb(Θ0) = 0

if b then c1 else c2 / Θ1 ⊕p Θ0 ⇓ Θ′

1 ⊕p Θ′

c1 / Θ ⇓ Θ1 c2 / Θ ⇓ Θ2 (c1 ⊕p c2) / Θ ⇓ Θ1 ⊕p Θ2

13/47

slide-32
SLIDE 32

Direct Toss ⊕1/5 c2⊕1/3 ⊕1/2 σ3 σ2 σ1 c1⊕1/3 ⊕1/2 σ3 σ2 σ1

14/47

c1 ⊕ 1

5 c2

slide-33
SLIDE 33

The Distinction Recursive c1 / [σ] ⇓ Θ1 (c1 ⊔ c2) / [σ] ⇓ Θ1 c2 / [σ] ⇓ Θ2 (c1 ⊔ c2) / [σ] ⇓ Θ2 vs. c1 / Θ ⇓ Θ1 (c1 ⊔ c2) / Θ ⇓ Θ1 c2 / Θ ⇓ Θ2 (c1 ⊔ c2) / Θ ⇓ Θ2 Direct

15/47

slide-34
SLIDE 34

Let’s Play a Game!

16/47

slide-35
SLIDE 35

Let’s Play a Game!

P:= ⊕1

3 (

⊕1

2

) O:= ⊔ ⊔

17/47

slide-36
SLIDE 36

Let’s Play a Game!

c1 P:= ⊕1

3 (

⊕1

2

) c2 O:= ⊔ ⊔

17/47

slide-37
SLIDE 37

Direct Play

18/47

c1 : P:= ⊕1

3(

⊕1

2

)

slide-38
SLIDE 38

Direct Play

⊕1/3 ⊕1/2

18/47

c1 : P:= ⊕1

3(

⊕1

2

)

slide-39
SLIDE 39

Direct Play

c2 ⊕1/3 ⊕1/2

18/47

c2 : O:= ⊔ ⊔

slide-40
SLIDE 40

Direct Play

  • ⊕1/3

⊕1/2

18/47

c2 : O:= ⊔ ⊔

slide-41
SLIDE 41

Direct Play

⊕1/3 ⊕1/2

18/47

c2 : O:= ⊔ ⊔

slide-42
SLIDE 42

Direct Play

⊕1/3 ⊕1/2 W T L

18/47

c2 : O:= ⊔ ⊔

slide-43
SLIDE 43

Recursive Play

19/47

c1 : P:= ⊕1

3(

⊕1

2

)

slide-44
SLIDE 44

Recursive Play

⊕1/3 ⊕1/2

19/47

c1 : P:= ⊕1

3(

⊕1

2

)

slide-45
SLIDE 45

Recursive Play

c2⊕1/3 ⊕1/2

19/47

c2 : O:= ⊔ ⊔

slide-46
SLIDE 46

Recursive Play

⊕1/3 ⊕1/2 c2 c2 c2

19/47

c2 : O:= ⊔ ⊔

slide-47
SLIDE 47

Recursive Play

⊕1/3 ⊕1/2

19/47

c2 : O:= ⊔ ⊔

slide-48
SLIDE 48

Recursive Play

⊕1/3 ⊕1/2 L L L

19/47

c2 : O:= ⊔ ⊔

slide-49
SLIDE 49

Knowledge The two levels of operational semantics reflect whether the adversary knows the outcome of coin flips.

20/47

slide-50
SLIDE 50

Levels of Knowledge

  • 1. Adversary is blind to probabilistic outcomes.

◮ Single choice in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) ◮ Distinct choices in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) (Direct)

  • 2. Adversary can see current program state
  • 3. Adversary recalls program history

(Recursive)

  • 4. Adversary can foresee all outcomes.

◮ Single coin flip in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) ◮ Distinct coin flips in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) 21/47

slide-51
SLIDE 51

Levels of Knowledge

  • 1. Adversary is blind to probabilistic outcomes.

◮ Single choice in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) ◮ Distinct choices in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) (Direct)

  • 2. Adversary can see current program state
  • 3. Adversary recalls program history

(Recursive)

  • 4. Adversary can foresee all outcomes.

◮ Single coin flip in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) ◮ Distinct coin flips in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) 21/47

slide-52
SLIDE 52

Levels of Knowledge

  • 1. Adversary is blind to probabilistic outcomes.

◮ Single choice in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) ◮ Distinct choices in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) (Direct)

  • 2. Adversary can see current program state
  • 3. Adversary recalls program history

(Recursive)

  • 4. Adversary can foresee all outcomes.

◮ Single coin flip in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) ◮ Distinct coin flips in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) 21/47

slide-53
SLIDE 53

Levels of Knowledge

  • 1. Adversary is blind to probabilistic outcomes.

◮ Single choice in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) ◮ Distinct choices in ((c1 ⊔ c2) ⊕ (c1 ⊔ c2)) (Direct)

  • 2. Adversary can see current program state
  • 3. Adversary recalls program history

(Recursive)

  • 4. Adversary can foresee all outcomes.

◮ Single coin flip in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) ◮ Distinct coin flips in ((c1 ⊕ c2) ⊔ (c1 ⊕ c2)) 21/47

slide-54
SLIDE 54

So...

What can we verify?

22/47

slide-55
SLIDE 55

Verification: Direct

{P} c1 {Q} {P} c2 {Q} {P} (c1 ⊔ c2) {Q}

23/47

slide-56
SLIDE 56

Verification: Recursive {True} b := T {Pr(b) = 1} {True} b := F {Pr(b) = 0} {True} (b := T ⊔ b := F) {Pr(b) = 1 ∨ Pr(b) = 0}

24/47

slide-57
SLIDE 57

Verification: Recursive {True} b := T {Pr(b) = 1} {True} b := F {Pr(b) = 0} {True} (b := T ⊔ b := F) {Pr(b) = 1 ∨ Pr(b) = 0}

24/47

⊕1/2 b = ⊥ b = ⊥

slide-58
SLIDE 58

Verification: Recursive {True} b := T {Pr(b) = 1} {True} b := F {Pr(b) = 0} {True} (b := T ⊔ b := F) {Pr(b) = 1 ∨ Pr(b) = 0}

24/47

⊕1/2 b = F b = T

slide-59
SLIDE 59

Verification: Recursive {True} b := T {Pr(b) = 1} {True} b := F {Pr(b) = 0} {True} (b := T ⊔ b := F) {Pr(b) = 1 ∨ Pr(b) = 0}

24/47

⊕1/2 b = F b = T

slide-60
SLIDE 60

Verification: Recursive {True} b := T {Pr(b) = 1} {True} b := F {Pr(b) = 0} {True} (b := T ⊔ b := F) {Pr(b) = 1 ∨ Pr(b) = 0} Q cannot include disjunctions

24/47

⊕1/2 b = F b = T

slide-61
SLIDE 61

Verification: Recursive {Pr(b) = 1

2} skip {Pr(b) = 1 2}

{Pr(b) = 1

2} b := ¬b {Pr(b) = 1 2}

{Pr(b) = 1

2} (skip ⊔ b := ¬b) {Pr(b) = 1 2}

25/47

slide-62
SLIDE 62

Verification: Recursive {Pr(b) = 1

2} skip {Pr(b) = 1 2}

{Pr(b) = 1

2} b := ¬b {Pr(b) = 1 2}

{Pr(b) = 1

2} (skip ⊔ b := ¬b) {Pr(b) = 1 2}

25/47

⊕1/2 b = F b = T

slide-63
SLIDE 63

Verification: Recursive {Pr(b) = 1

2} skip {Pr(b) = 1 2}

{Pr(b) = 1

2} b := ¬b {Pr(b) = 1 2}

{Pr(b) = 1

2} (skip ⊔ b := ¬b) {Pr(b) = 1 2}

25/47

⊕1/2 b = F b = F

slide-64
SLIDE 64

Verification: Recursive {Pr(b) = 1

2} skip {Pr(b) = 1 2}

{Pr(b) = 1

2} b := ¬b {Pr(b) = 1 2}

{Pr(b) = 1

2} (skip ⊔ b := ¬b) {Pr(b) = 1 2}

25/47

⊕1/2 b = F b = F

slide-65
SLIDE 65

Verification: Recursive {Pr(b) = 1

2} skip {Pr(b) = 1 2}

{Pr(b) = 1

2} b := ¬b {Pr(b) = 1 2}

{Pr(b) = 1

2} (skip ⊔ b := ¬b) {Pr(b) = 1 2}

P cannot include probabilities in (0, 1)

25/47

⊕1/2 b = F b = F

slide-66
SLIDE 66

Verification: Recursive {P} c1 {Q} non-probabilistic P non-disjunctive Q {P} c2 {Q} {P} (c1 ⊔ c2) {Q}

26/47

slide-67
SLIDE 67

Compositionality (c1 ⊔ c2); (c3 ⊔ c4)

27/47

slide-68
SLIDE 68

Compositionality {P} (c1 ⊔ c2); (c3 ⊔ c4) {R}

27/47

slide-69
SLIDE 69

Compositionality {P} (c1 ⊔ c2) {Q} (c3 ⊔ c4) {R}

27/47

slide-70
SLIDE 70

Compositionality {P} (c1 ⊔ c2) {Q} (c3 ⊔ c4) {R}

27/47

slide-71
SLIDE 71

Compositionality non-probabilistic P non-disjunctive Q {P} (c1 ⊔ c2) {Q} (c3 ⊔ c4) {R}

27/47

slide-72
SLIDE 72

Compositionality non-probabilistic P non-disjunctive Q {P} (c1 ⊔ c2) {Q} (c3 ⊔ c4) {R}

27/47

slide-73
SLIDE 73

Compositionality non-probabilistic P non-probabilistic Q non-disjunctive Q non-disjunctive R {P} (c1 ⊔ c2) {Q} (c3 ⊔ c4) {R}

27/47

slide-74
SLIDE 74

Compositionality non-probabilistic P non-probabilistic Q non-disjunctive Q non-disjunctive R {P} (c1 ⊔ c2) {Q} (c3 ⊔ c4) {R}

27/47

slide-75
SLIDE 75

Applications

Are private coins applicable?

28/47

slide-76
SLIDE 76

Game Theory

Theorem (Minimax Theorem) For every two-person, zero-sum game with finitely many strategies, there exists a value V and a mixed strategy for each player, such that

  • 1. Given player 2’s strategy, the best payoff possible for player 1

is V, and

  • 2. Given player 1’s strategy, the best payoff possible for player 2

is −V.

29/47

slide-77
SLIDE 77

Game Theory

◮ game ⇐

⇒ program with nondeterminism

30/47

slide-78
SLIDE 78

Game Theory

◮ game ⇐

⇒ program with nondeterminism

◮ zero sum ⇐

⇒ returns a single value

30/47

slide-79
SLIDE 79

Game Theory

◮ game ⇐

⇒ program with nondeterminism

◮ zero sum ⇐

⇒ returns a single value

◮ finitely many strategies ⇐

⇒ no unbounded loops

30/47

slide-80
SLIDE 80

Game Theory

◮ game ⇐

⇒ program with nondeterminism

◮ zero sum ⇐

⇒ returns a single value

◮ finitely many strategies ⇐

⇒ no unbounded loops

◮ mixed strategy ⇐

⇒ choice of p, q, r annotating the ⊕s

30/47

slide-81
SLIDE 81

Game Theory

Theorem (Minimax Theorem Restated) Any finite program combining probability and nondeterminism with a single output value has a dual program with the probabilistic and nondeterministic choices inverted, that returns the same value in the worst case.

31/47

slide-82
SLIDE 82

Game Theory Questions

◮ Can we use this to find and prove Nash Equilibria in

games?

◮ Does this yield useful generalizations of Nash

Equilibrium?

◮ Can we discover useful compositionality results from

this formulation?

32/47

slide-83
SLIDE 83

More Open Questions

◮ How does a semantics using infinite bit streams

compare to our distribution semantics?

◮ Can we enumerate the possible interactions between

probability and nondeterminism via algebraic equivalences?

◮ Can we extend KAT to

probabilistic-nondeterministic programs?

◮ Can we translate between Direct and Recursive

Semantics?

33/47

slide-84
SLIDE 84

Thank You

Questions?

34/47

slide-85
SLIDE 85

Thank You

Questions? Answers?

34/47

slide-86
SLIDE 86

Thank You

Questions? Answers? Rebuttals?

34/47