On the Memory Consumption of Probabilistic Pushdown Automata Tom - - PowerPoint PPT Presentation

on the memory consumption of probabilistic pushdown
SMART_READER_LITE
LIVE PREVIEW

On the Memory Consumption of Probabilistic Pushdown Automata Tom - - PowerPoint PPT Presentation

On the Memory Consumption of Probabilistic Pushdown Automata Tom Brzdil 1 Javier Esparza 2 Stefan Kiefer 3 1 Masaryk University, Brno (Czech Republic) 2 TU Mnchen (Germany) 3 University of Oxford (UK) FSTTCS (Kanpur, India), 15 December,


slide-1
SLIDE 1

On the Memory Consumption of Probabilistic Pushdown Automata

Tomáš Brázdil1 Javier Esparza2 Stefan Kiefer3

1Masaryk University, Brno (Czech Republic) 2TU München (Germany) 3University of Oxford (UK)

FSTTCS (Kanpur, India), 15 December, 2009

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-2
SLIDE 2

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-3
SLIDE 3

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-4
SLIDE 4

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-5
SLIDE 5

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

2/3

= = ≻XX

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-6
SLIDE 6

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

2/3

= = ≻XX

1/2

= = ≻YXX

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-7
SLIDE 7

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

2/3

= = ≻XX

1/2

= = ≻YXX

1/3

= = ≻XX

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-8
SLIDE 8

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

2/3

= = ≻XX

1/2

= = ≻YXX

1/3

= = ≻XX

1/2

= = ≻X

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-9
SLIDE 9

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

2/3

= = ≻XX

1/2

= = ≻YXX

1/3

= = ≻XX

1/2

= = ≻X

1/2

= = ≻ε

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-10
SLIDE 10

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

2/3

= = ≻XX

1/2

= = ≻YXX

1/3

= = ≻XX

1/2

= = ≻X

1/2

= = ≻ε (no control states in this talk)

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-11
SLIDE 11

Probabilistic Pushdown Systems

Probabilistic pushdown systems are a model for probabilistic procedural programs. X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε A run: X

1/2

= = ≻YX

2/3

= = ≻XX

1/2

= = ≻YXX

1/3

= = ≻XX

1/2

= = ≻X

1/2

= = ≻ε (no control states in this talk) Quantitative Properties of a run: its probability (product of the probabilities on the arrows) its time (number of steps till ε) its memory (longest configuration, “maximal stack height”)

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-12
SLIDE 12

Motivation

Probabilistic Pushdown Systems are a model for probabilistic programs with unrestricted recursion. Well-studied: model-checking for temporal logics [Etessami, Yannakakis, Esparza, Kuˇ cera, Mayr] long-run behaviour [Brázdil, Esparza, Kuˇ cera] games [Etessami, Yannakakis] The basic quantities time and memory are random variables. This talk is about the memory.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-13
SLIDE 13

Motivation

Probabilistic Pushdown Systems are a model for probabilistic programs with unrestricted recursion. Well-studied: model-checking for temporal logics [Etessami, Yannakakis, Esparza, Kuˇ cera, Mayr] long-run behaviour [Brázdil, Esparza, Kuˇ cera] games [Etessami, Yannakakis] The basic quantities time and memory are random variables. This talk is about the memory.

What is the distribution of the memory?

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-14
SLIDE 14

Computing the Distribution of the Memory

What is the probability of reaching height ≥ 3? X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε Idea: Construct the Markov chain with all stacks of height ≤ 2.

X YX XX ε ≥3 1/2 1/3 2/3 1/2 1/2 1/2 1 1

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-15
SLIDE 15

Computing the Distribution of the Memory

What is the probability of reaching height ≥ 3? X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε Idea: Construct the Markov chain with all stacks of height ≤ 2.

X YX XX ε ≥3 1/2 1/3 2/3 1/2 1/2 1/2 1 1

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

Problem: There may be 2k states with height ≤ k.

slide-16
SLIDE 16

Computing the Distribution of the Memory

What is the probability of reaching height ≥ 3? X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε Idea: Construct the Markov chain with all stacks of height ≤ 2.

X YX XX ε ≥3 1/2 1/3 2/3 1/2 1/2 1/2 1 1

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

Idea: The Markov chain has a regular structure. Exploit that. Problem: There may be 2k states with height ≤ k.

slide-17
SLIDE 17

Linear Equation Systems for the Distribution

X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε Let p[k]X := probability of reaching height ≥ k if starting with X. Compute p[k]X by solving linear equations. For instance: p[10]X = 1/2 · (p[9]Y + p[10]X) + 1/2 · 0 p[10]Y = 2/3 · p[10]X + 1/3 · 0

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-18
SLIDE 18

Linear Equation Systems for the Distribution

X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε Let p[k]X := probability of reaching height ≥ k if starting with X. Compute p[k]X by solving linear equations. For instance: p[10]X = 1/2 · (p[9]Y + t[9]Y · p[10]X) + 1/2 · 0 p[10]Y = 2/3 · p[10]X + 1/3 · 0 where t[k]Y is the probability of terminating and having height < k.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-19
SLIDE 19

Linear Equation Systems for the Distribution

X

1/2

֒ − − → YX Y

2/3

֒ − − → X X

1/2

֒ − − → ε Y

1/3

֒ − − → ε Let p[k]X := probability of reaching height ≥ k if starting with X. Compute p[k]X by solving linear equations. For instance: p[10]X = 1/2 · (p[9]Y + t[9]Y · p[10]X) + 1/2 · 0 p[10]Y = 2/3 · p[10]X + 1/3 · 0 where t[k]Y is the probability of terminating and having height < k. t[10]X = 1/2 · t[9]Y · t[10]X + 1/2 · 1 t[10]Y = 2/3 · t[10]X + 1/3 · 1

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-20
SLIDE 20

Linear Equation Systems for the Distribution

Proposition The vector p[k] can be computed by setting up and solving linear equation systems. It can be done in O(k · |Γ|3) arithmetic operations.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-21
SLIDE 21

Linear Equation Systems for the Distribution

Proposition The vector p[k] can be computed by setting up and solving linear equation systems. It can be done in O(k · |Γ|3) arithmetic operations. Is this fast enough?

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-22
SLIDE 22

Linear Equation Systems for the Distribution

Proposition The vector p[k] can be computed by setting up and solving linear equation systems. It can be done in O(k · |Γ|3) arithmetic operations. Is this fast enough? Depends.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-23
SLIDE 23

Linear Equation Systems for the Distribution

Proposition The vector p[k] can be computed by setting up and solving linear equation systems. It can be done in O(k · |Γ|3) arithmetic operations. Is this fast enough? Depends. What about the asymptotics for large k?

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-24
SLIDE 24

Linear Equation Systems for the Distribution

Proposition The vector p[k] can be computed by setting up and solving linear equation systems. It can be done in O(k · |Γ|3) arithmetic operations. Is this fast enough? Depends. What about the asymptotics for large k? What about the expectation of the memory consumption?

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-25
SLIDE 25

Linear Equation Systems for the Distribution

Proposition The vector p[k] can be computed by setting up and solving linear equation systems. It can be done in O(k · |Γ|3) arithmetic operations. Is this fast enough? Depends. What about the asymptotics for large k? What about the expectation of the memory consumption? In the following we assume finite expectation of the memory (which is the most important case).

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-26
SLIDE 26

Putting the Equations in Matrix Form

After some (non-trivial but non-interesting) normalizations: There is a (nonnegative) matrix A(x) ∈ RΓ×Γ that depends on a (nonnegative) vector x ∈ RΓ such that: A(x) increases monotonically with x, p[k + 1] = A(t[k]) · p[k]

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-27
SLIDE 27

Putting the Equations in Matrix Form

After some (non-trivial but non-interesting) normalizations: There is a (nonnegative) matrix A(x) ∈ RΓ×Γ that depends on a (nonnegative) vector x ∈ RΓ such that: A(x) increases monotonically with x, p[k + 1] = A(t[k]) · p[k] The sequence t[1] ≤ t[2] ≤ . . . converges to a limit t, where t is the vector of termination probabilities. By monotonicity and continuity, the sequence A(t[1]) ≤ A(t[2]) ≤ . . . also converges to a limit A(t) = A.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-28
SLIDE 28

Putting the Equations in Matrix Form

After some (non-trivial but non-interesting) normalizations: There is a (nonnegative) matrix A(x) ∈ RΓ×Γ that depends on a (nonnegative) vector x ∈ RΓ such that: A(x) increases monotonically with x, p[k + 1] = A(t[k]) · p[k] The sequence t[1] ≤ t[2] ≤ . . . converges to a limit t, where t is the vector of termination probabilities. By monotonicity and continuity, the sequence A(t[1]) ≤ A(t[2]) ≤ . . . also converges to a limit A(t) = A. It follows: p[k + 1] = A(t[k]) · p[k] ≤ A · p[k] ≤ Ak · p[1] = Ak · 1

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-29
SLIDE 29

Approximating the Distribution

On the previous slide: p[k] ≤ Ak−1 · 1, so Ak−1 · 1 is an upper bound on p[k]. Advantage: compute Ak−1 by repeated squaring: A, A2, A4, . . .

  • nly O(log k · |Γ|3) operations

safe overapproximation for large k How tight is the overapproximation?

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-30
SLIDE 30

Approximating the Distribution

On the previous slide: p[k] ≤ Ak−1 · 1, so Ak−1 · 1 is an upper bound on p[k]. Advantage: compute Ak−1 by repeated squaring: A, A2, A4, . . .

  • nly O(log k · |Γ|3) operations

safe overapproximation for large k How tight is the overapproximation? Proposition There is a real number d with 0 < d ≤ 1 such that for all k: d · Ak−1 · 1 ≤ p[k] ≤ Ak−1 · 1 .

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-31
SLIDE 31

Approximating the Distribution

On the previous slide: Proposition There is a real number d with 0 < d ≤ 1 such that for all k: d · Ak−1 · 1 ≤ p[k] ≤ Ak−1 · 1 . So, p[k] essentially depends on the spectral radius ρ of A.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-32
SLIDE 32

Approximating the Distribution

On the previous slide: Proposition There is a real number d with 0 < d ≤ 1 such that for all k: d · Ak−1 · 1 ≤ p[k] ≤ Ak−1 · 1 . So, p[k] essentially depends on the spectral radius ρ of A. Theorem We have ρ < 1. The proposition above implies: p[k] ∈ Θ(ρk)

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-33
SLIDE 33

Expected Memory

What is the expectation of the memory?

This expectation EM equals ∞

k=1 p[k]X.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-34
SLIDE 34

Expected Memory

What is the expectation of the memory?

This expectation EM equals ∞

k=1 p[k]X.

EM can be (under-)approximated by UM[ℓ] := ℓ

k=1 p[k]X.

Theorem The sequence (UM[ℓ])ℓ converges to EM. More precisely, one can compute a > 0 and 0 < b < 1 with EM − UM[ℓ] ≤ a · bℓ , so the error decays exponentially.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-35
SLIDE 35

Finiteness of the Expectation

Most presented results hold if the expectation is finite. How to decide whether the expectation is finite? X

2/3

֒ − − → XX, X

1/3

֒ − − → ε: P(M = ∞) = 1/2 > 0, so EM = ∞ X

1/2

֒ − − → XX, X

1/2

֒ − − → ε:

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-36
SLIDE 36

Finiteness of the Expectation

Most presented results hold if the expectation is finite. How to decide whether the expectation is finite? X

2/3

֒ − − → XX, X

1/3

֒ − − → ε: P(M = ∞) = 1/2 > 0, so EM = ∞ X

1/2

֒ − − → XX, X

1/2

֒ − − → ε: P(M = ∞) = 0, but still EM = ∞

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-37
SLIDE 37

Finiteness of the Expectation

Most presented results hold if the expectation is finite. How to decide whether the expectation is finite? X

2/3

֒ − − → XX, X

1/3

֒ − − → ε: P(M = ∞) = 1/2 > 0, so EM = ∞ X

1/2

֒ − − → XX, X

1/2

֒ − − → ε: P(M = ∞) = 0, but still EM = ∞ X

1/3

֒ − − → XX, X

2/3

֒ − − → ε: P(M = ∞) = 0, and EM ≈ 1.61

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-38
SLIDE 38

Finiteness of the Expectation

Most presented results hold if the expectation is finite. How to decide whether the expectation is finite? X

2/3

֒ − − → XX, X

1/3

֒ − − → ε: P(M = ∞) = 1/2 > 0, so EM = ∞ X

1/2

֒ − − → XX, X

1/2

֒ − − → ε: P(M = ∞) = 0, but still EM = ∞ X

1/3

֒ − − → XX, X

2/3

֒ − − → ε: P(M = ∞) = 0, and EM ≈ 1.61 Theorem Whether EM is finite can be decided in polynomial time for pushdown systems without states in polynomial space for general pushdown systems. The problem is PosSLP-hard (therefore unlikely in P) for general pushdown systems.

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-39
SLIDE 39

Conclusions

Probabilistic pushdown systems model recursive probabilistic programs. We studied one basic random variable, the memory. Its distribution can be computed

naively (using an exponential-sized Markov chain), by solving linear equation systems, by efficiently computing overapproximations of the memory.

The expectation can be approximated, and the error decays exponentially. Whether the expectation is finite can be decided in polynomial time for pushdown systems without states. Open question: How to decide whether the expectation exceeds a given bound?

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata

slide-40
SLIDE 40

End of Talk

Thank you!

Tomáš Brázdil, Javier Esparza, Stefan Kiefer Memory Consumption of Probabilistic Pushdown Automata