• Aucun résultat trouvé

On Higher-Order Probabilistic Subrecursion

N/A
N/A
Protected

Academic year: 2022

Partager "On Higher-Order Probabilistic Subrecursion"

Copied!
20
0
0

Texte intégral

(1)

On Higher-Order Probabilistic Subrecursion

Flavien BREUVART, Ugo Dal Lago

Focus, Inria team, Bologna

LC&A: 2016 September 6

(2)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive

BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

(3)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive

BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

(4)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

(5)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive

BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

(6)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive

BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

(7)

Gödel’s System T :

A Language for HO Primitive Recursion

Gödel’s System

T

(Call-by-Value)

M,N,L ::= x | λx.M | M N | rec | 0 | S

recM N 0 M recM N (Sn)N n (recM N n)

Γ,x:A`x:A

Γ,x:A`M:B Γ`λx.M:AB

Γ`M:AB Γ`N:A Γ`M N:B

Γ`0:N Γ`S:NN Γ`rec:A(NAA)NA

A Powerful System

Corresponds to provably recursive functions in Peano arithmetic

Encodes any monad (states, exceptions, continuations...)

(8)

Probabilistic Systems T

Different Probabilistic Extensions for System

T M,N,L ::= x | λx.M | M N | rec | 0 | S | MN | X | R

(34)2

34 2

3 4

1

2 1

2

1

2 1

2

Finite

tree X S 0

0 S(X S 0) 1 SS(X S 0)

2 . ..

1 2

1 2

1 2

1 2

1

2 1

2

Finitely branching

Finite paths

R

0 1 2 3 4

1

2 1

4 1

8 1

24

TL ⊂ TR = TX

(9)

Almost Sure Convergence

TL,R,X

is Almost Surely Converging

∀MTL,R,X, Prob(M)=1

Idea of Reducibility

1)By induction onA, we define RedA{M| `M:A}, 2)By induction on:

MNRedA MRedA, 20)RedA is inhabited (ind. onA)

3)By induction onA:

RedAASC, 4)By induction onM:

`M:A MRedA,

Specificities for Probabilities

Item 3)becomes:

3)RedA are exactly the ASC terms that are evaluated into

[[M]]RedA.

We also need a technical lemma 0)The application is continuous:

[[M N]] = hh[[M]] [[N]]ii.

(10)

Finite Representation of T

L

’s Distributions

∀MTL(N),∃NT(NQ), Prob(Mk) :=NF(N k)

Using a Finite Random Tape Using a Single Memory Cell s :

N

(N1N2):=if(even!s) (s:=!s/2;N1) (s:=!s/2;N2)

State Passing Transformation

M λs.M

Counting Occurrences

P(Mk) :=

#ns2m|Mko 2m

formsufficiently large.

T-Computable (simple recursion on s)

Exists since the execution of MTL is bounded

Parametrization: How do we calculate the bound 2

m

?

Feasible but more technical: we use a more complex monad.

(11)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive

BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

(12)

Functional Representation of Probabilistic recursive functions

What is a functional representation?

LetM a probabilistic program that output an integer with probability 1.

We look for a recursive functionf:NR

N→N

such that:

prob(Mk)=f(k)

X n

f(k)(n) 2n

let f M k n :=

let tab : Rational[] in let rec simul M p:=

eval M with

"return k" -> tab[k] += 1/(2^p);

"if coin then L else N" -> { newThread{simul L (p+1)}; newThread{simul N (p+1)}; };

in newthread{simul M 0}; newThread{

while ( sum tab < 1-1/n ) do skip; return tab[k];

}

tab: dynamical approximation Updating tabon terminating

branches

Run probabilistic choicesin parallel Waitingfor a reasonable

approximation

(13)

Functional Representation of Probabilistic recursive functions

What is a functional representation?

LetM a probabilistic program that output an integer with probability 1.

We look for a recursive functionf:NNN such that:

prob(Mk)=X

n

f(k)(n) 2n

let f M k n :=

let tab : Rational[] in let rec simul M p:=

eval M with

"return k" -> tab[k] += 1/(2^p);

"if coin then L else N" -> { newThread{simul L (p+1)}; newThread{simul N (p+1)}; };

in newthread{simul M 0}; newThread{

while ( sum tab < 1-1/n ) do skip; return tab[k];

}

tab: dynamical approximation Updating tabon terminating

branches

Run probabilistic choicesin parallel Waitingfor a reasonable

approximation

(14)

Functional Representation of Probabilistic recursive functions

What is a functional representation?

LetM a probabilistic program that output an integer with probability 1.

We look for a recursive functionf:NNQ such that:

prob(Mk)=lim

n f(k)(n) ³1X

k

f(k)(n)´1 n

let f M k n :=

let tab : Rational[] in let rec simul M p:=

eval M with

"return k" -> tab[k] += 1/(2^p);

"if coin then L else N" -> { newThread{simul L (p+1)};

newThread{simul N (p+1)};

};

in newthread{simul M 0};

newThread{

while ( sum tab < 1-1/n ) do skip;

return tab[k];

}

tab: dynamical approximation Updating tabon terminating

branches

Run probabilistic choicesin parallel Waitingfor a reasonable

approximation

(15)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive

BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

(16)

Functional representation of T

X

Remark: Finite representation does not hold

Prob[X(rec 0(λxy.0SSx))1 0] is not rational

Objective: Functional representation of

TX

in

TL ForMTX(N), findMTL(NN),[[M n]]'1

2n [[M]]

Naive idea: Counter

StopM afterf(n)steps

〈M, f(n)M−→ 〈M0 M0,f(n)1

· · ·

→ 〈M00,0

→0

f(1)

...

f(2)

...

f(3)

...

f has to beT-definable! May not be possible...

(17)

Functional representation of T

X

Remark: Finite representation does not hold

Prob[X(rec 0(λxy.0SSx))1 0] is not rational

Objective: Functional representation of

TX

in

TL ForMTX(N), findMTL(NN),[[M n]]'1

2n [[M]]

Naive idea: Counter

StopM afterf(n)steps

〈M, f(n)M−→ 〈M0 M0,f(n)1

· · ·

→ 〈M00,0

→0

f(1)

...

f(2)

...

f(3)

...

f has to beT-definable!

May not be possible...

(18)

Functional representation of T

R

Better Idea:

Truncating R

Limiting

themth

each apparition of the operatorRto[0, ...,n

∗m

]

R:=









0 7→ 12

· · · n 7→ 2n1+1

− 7→ Err









Bounded Probability of error

Prob(M[R/R]Err) 1Y

n0

(1 1

2mn) 1 n

(19)

Functional representation of T

R

The Real Idea:

Increasing Truncature

Limitingthemthapparition of the operatorRto[0, ...,nm]

R:=(m:=m+1);









0 7→ 12

· · · nm 7→ 2n1m+1

− 7→ Err









Bounded Probability of error

Prob(M[R/R]Err) 1Y

n0

(1 1

2mn) 1 n

(20)

When are the Probabilities Computationally Necessary?

Are all distributions deterministically representable?

Finite Representation prob

³

Mk´= fg(k)(k) Q Functional Representation prob

³

Mk´=Pnf(n2n,k) ∈R

Parametrization ForM:NN

When is (infinite) randomization useful?

Monte Carlo

f(n)reached with prob>12+² Las Vegas

f(n)reached and ascertained with prob>²

Dynamic/Strict bounds Make²dynamic/null

Different classes

Complexity Primitive Rec. HO Prim. Rec. Recursive

BPP

ZPP

NP,PP Exponential

Blow Up

future work Depending on

Prob. Operators

Références

Documents relatifs

We conjecture that the resulting relation would coincide with coupled logical bisimilarity and context equivalence, but going through Howe’s technique seems more difficult than for Λ

absorption and scattering by carbon soot aerosol internally mixed with sulfuric acid. Evidence that the

More specifically, we show that endowing a very expressive deterministic calculus like G¨ odel’s T with various forms of probabilistic choice operators may result in calculi which

The objectives of the study were to compare the ovarian activity of Holstein-Friesian (CH HF), Fleckvieh (CH FV) and Brown Swiss (CH BS) dairy cows of Swiss origin with that

Just the fact of including this new LECZ com- ponent changed the relative position of coun- tries (as is shown below for LDCs), compared to the position that would have resulted

Land surface models that placed the largest GPP in the Up- per Midwest of the United States produced OCS plant fluxes that matched aircraft observations well for all estimates of

Bayesian model comparison allows us to emphasize on artificial datasets first that inhomogeneous gamma-Gaussian mixture models outperform Gaussian mixtures in terms

Our method allows one to build models from a set of basic functors among which the Giry probabilistic functor, spaces of cadlag trajectories (in continuous and discrete time),