efficient analysis of probabilistic systems that ... · the cost problem 3 10: 15 7 10: 20 2 10: 5...

54
Efficient Analysis of Probabilistic Systems That Accumulate Quantities Christoph Haase Stefan Kiefer Markus Lohrey Highlights 2018, Berlin 20 September 2018 Stefan Kiefer Probabilistic Systems That Accumulate Quantities 1

Upload: others

Post on 02-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Efficient Analysis of Probabilistic SystemsThat Accumulate Quantities

Christoph Haase Stefan Kiefer Markus Lohrey

Highlights 2018, Berlin20 September 2018

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 1

Page 2: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

The Cost Problem

310 : 15

710 : 20

210 : 5

810 : 10

What is the probability to reach the gate in 25–45min?After what time are half of the customers done?

Cost Problem :=

Input: Cost Markov chaincost formula ϕ

Output: Pr(ϕ)

25 ≤ cost ≤ 45

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 2

Page 3: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

The Cost Problem

310 : 15

710 : 20

210 : 5

810 : 10

What is the probability to reach the gate in 25–45min?After what time are half of the customers done?

Cost Problem :=

Input: Cost Markov chaincost formula ϕthreshold τ ∈ [0,1]

Output: Is Pr(ϕ) ≥ τ ?

25 ≤ cost ≤ 45

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 2

Page 4: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Dynamic Programming

12 : 1

12 : 2

13 : 3

13 : 1

13 : 1

0 1 2 3 4

1

0

0

12

0

0

14

12

0

18+

16

12

12

12

12

12

12

12

Iterative Linear Programming [Baier, Daum, Dubslaff, Klein,Klüppelholz, NFM’14]

Computing expectations is much easier.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 3

Page 5: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Dynamic Programming

12 : 1

12 : 2

13 : 3

13 : 1

13 : 1

0 1 2 3 4

1

0

0

12

0

0

14

12

0

18+

16

12

12

12

12

12

12

12

Iterative Linear Programming [Baier, Daum, Dubslaff, Klein,Klüppelholz, NFM’14]

Computing expectations is much easier.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 3

Page 6: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Dynamic Programming

12 : 1

12 : 2

13 : 3

13 : 1

13 : 1

0 1 2 3 4

1

0

0

12

0

0

14

12

0

18+

16

12

12

12

12

12

12

12

Iterative Linear Programming [Baier, Daum, Dubslaff, Klein,Klüppelholz, NFM’14]

Computing expectations is much easier.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 3

Page 7: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Dynamic Programming

12 : 1

12 : 2

13 : 3

13 : 1

13 : 1

0 1 2 3 4

1

0

0

12

0

0

14

12

0

18+

16

12

12

12

12

12

12

12

Iterative Linear Programming [Baier, Daum, Dubslaff, Klein,Klüppelholz, NFM’14]

Computing expectations is much easier.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 3

Page 8: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Dynamic Programming

12 : 1

12 : 2

13 : 3

13 : 1

13 : 1

0 1 2 3 4

1

0

0

12

0

0

14

12

0

18+

16

12

12

12

12

12

12

12

Iterative Linear Programming [Baier, Daum, Dubslaff, Klein,Klüppelholz, NFM’14]

Computing expectations is much easier.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 3

Page 9: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Dynamic Programming

12 : 1

12 : 2

13 : 3

13 : 1

13 : 1

0 1 2 3 4

1

0

0

12

0

0

14

12

0

18+

16

12

12

12

12

12

12

12

Iterative Linear Programming [Baier, Daum, Dubslaff, Klein,Klüppelholz, NFM’14]

Computing expectations is much easier.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 3

Page 10: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Dynamic Programming

12 : 1

12 : 2

13 : 3

13 : 1

13 : 1

0 1 2 3 4

1

0

0

12

0

0

14

12

0

18+

16

12

12

12

12

12

12

12

Iterative Linear Programming [Baier, Daum, Dubslaff, Klein,Klüppelholz, NFM’14]

Computing expectations is much easier.Stefan Kiefer Probabilistic Systems That Accumulate Quantities 3

Page 11: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

Theorem (Laroussinie, Sproston, FoSSaCS’05)The cost problem is in EXPTIME.The cost problem is NP-hard

NP-hard

.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 4

by reduction from theK th largest subset problem

Theorem (HK, IPL’16)The K th largest subset problem is

PP

-complete.

CorollaryThe cost problem is PP-hard.

a superset of NP

Page 12: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

Theorem (Laroussinie, Sproston, FoSSaCS’05)The cost problem is in EXPTIME.The cost problem is NP-hardNP-hard.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 4

by reduction from theK th largest subset problem

Theorem (HK, IPL’16)The K th largest subset problem is

PP

-complete.

CorollaryThe cost problem is PP-hard.

a superset of NP

Page 13: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

Theorem (Laroussinie, Sproston, FoSSaCS’05)The cost problem is in EXPTIME.The cost problem is NP-hardNP-hard.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 4

by reduction from theK th largest subset problem

Theorem (HK, IPL’16)The K th largest subset problem is

PP

-complete.

CorollaryThe cost problem is PP-hard.

a superset of NP

Page 14: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

Theorem (Laroussinie, Sproston, FoSSaCS’05)The cost problem is in EXPTIME.The cost problem is NP-hardNP-hard.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 4

by reduction from theK th largest subset problem

Theorem (HK, IPL’16)The K th largest subset problem is PP-complete.

CorollaryThe cost problem is PP-hard.

a superset of NP

Page 15: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

The K th Largest Subset Problem is PP-Complete

K th Largest Subset Problem

Instance: A finite set X ⊆ N and K ,B ∈ N.Question: Are there at least K subsets of X whose elementssum up to at most B?

K th Largest-Area ConvexPolygon Problem

Instance: A finite setP ⊆ N× N and K ,B ∈ N.Question: Are there at least Kconvex polygons made from Pwhose area is at least B?

Vertex countingInstance: A matrix A, a vector b, and K ∈ N.Question: Does the polyhedron Ax ≤ b have ≤ K vertices?

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 5

Page 16: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

EXPTIME

PSPACE

Cost

PP

NP

1 0

+ +

∗ −

circuit value

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 6

Theorem (HK, ICALP’15)The cost problem is PosSLP-hard.

The cost problem is in PSPACE.

Theorem (HKL, LICS’17)The cost problem is in CH.

Page 17: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

EXPTIME

PSPACE

Cost

PP PosSLP

NP

1 0

+ +

∗ −

circuit value

:=Input: arithmetic circuitOutput: Is the value > 0 ?

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 6

Theorem (HK, ICALP’15)The cost problem is PosSLP-hard.

The cost problem is in PSPACE.

Theorem (HKL, LICS’17)The cost problem is in CH.

Page 18: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

EXPTIME

PSPACE

Cost

PP PosSLP

NP

1 0

+ +

∗ −

circuit value

:=Input: arithmetic circuitOutput: Is the value > 0 ?

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 6

Theorem (HK, ICALP’15)The cost problem is PosSLP-hard.

The cost problem is in PSPACE.

Theorem (HKL, LICS’17)The cost problem is in CH.

Page 19: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

EXPTIME

PSPACE

Cost

PP PosSLP

NP

1 0

+ +

∗ −

circuit value

:=Input: arithmetic circuitOutput: Is the value > 0 ?

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 6

Theorem (HK, ICALP’15)The cost problem is PosSLP-hard.The cost problem is in PSPACE.

Theorem (HKL, LICS’17)The cost problem is in CH.

Page 20: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of the Cost Problem

EXPTIME

PSPACE

CH

Cost

PP PosSLP

NP

1 0

+ +

∗ −

circuit value

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 6

Theorem (HK, ICALP’15)The cost problem is PosSLP-hard.The cost problem is in PSPACE.

Theorem (HKL, LICS’17)The cost problem is in CH.

Page 21: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

Cost Problem :=

Input: Cost Markov chaincost formula ϕ

Output: Pr(ϕ)

310 : 20

12 : 15

12 : 25

1 : 10

1 : 10

710 : 5

Enumerate the Parikh images.Problem: there might be multiple paths per Parikh image.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 7

Page 22: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

Cost Problem :=

Input: Cost Markov chaincost formula ϕ

Output: Pr(ϕ)

310 : 20

12 : 15

12 : 25

1 : 10

1 : 10

710 : 5

2

1

2

1

2

1

Enumerate the Parikh images.Problem: there might be multiple paths per Parikh image.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 7

Page 23: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

Cost Problem :=

Input: Cost Markov chaincost formula ϕ

Output: Pr(ϕ)

310 : 20

12 : 15

12 : 25

1 : 10

1 : 10

710 : 5

2

1

2

1

2

1

Enumerate the Parikh images.

Problem: there might be multiple paths per Parikh image.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 7

Page 24: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

Cost Problem :=

Input: Cost Markov chaincost formula ϕ

Output: Pr(ϕ)

310 : 20

12 : 15

12 : 25

1 : 10

1 : 10

710 : 5

2

1

2

1

2

1

Enumerate the Parikh images.Problem: there might be multiple paths per Parikh image.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 7

Page 25: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

Cost Problem :=

Input: Cost Markov chaincost formula ϕ

Output: Pr(ϕ)

Enumerate the Parikh images.Problem: there might be multiple paths per Parikh image.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 7

Page 26: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

Cost Problem :=

Input: Cost Markov chaincost formula ϕ

Output: Pr(ϕ)

Enumerate the Parikh images.Problem: there might be multiple paths per Parikh image.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 7

Page 27: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

The BEST Theorem

Theorem (de Bruijn, van Aardenne-Ehrenfest, Smith, Tutte)The number of Eulerian cycles in an Eulerian graph G equals

t(G) ·∏v∈V

(d(v)− 1

)!

Theorem (Tutte’s matrix-tree theorem)

t(G) = det(L(G)1,1)

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 8

number of directedspanning trees in G

Laplacian of G

Page 28: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

310 : 20

12 : 15

12 : 25

1 : 10

1 : 10

710 : 5

2

1

2

1

2

1

Enumerate the Parikh images. How?

There is a linear-sized existential Presburger formula thatencodes “valid” Parikh images (Euler-Hierholzer theorem)

Use an SMT solver to compute all valid Parikh images.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 9

Page 29: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

310 : 20

12 : 15

12 : 25

1 : 10

1 : 10

710 : 5

2

1

2

1

2

1

Enumerate the Parikh images. How?

There is a linear-sized existential Presburger formula thatencodes “valid” Parikh images (Euler-Hierholzer theorem)

Use an SMT solver to compute all valid Parikh images.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 9

Page 30: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Solving the Cost Problem

310 : 20

12 : 15

12 : 25

1 : 10

1 : 10

710 : 5

2

1

2

1

2

1

Enumerate the Parikh images. How?

There is a linear-sized existential Presburger formula thatencodes “valid” Parikh images (Euler-Hierholzer theorem)

Use an SMT solver to compute all valid Parikh images.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 9

Page 31: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Theorem ([HK, ICALP’15], [HK, IPL’16], [HKL, LICS’17])The cost problem is hard for PP and PosSLP.The cost problem is in CH.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 10

Page 32: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 33: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 34: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 35: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 36: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 37: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 38: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 39: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 11

0.45 : (1,0)

0.45 : (0,1)

0.1 : (0,0)

What is Pr(cost ∈ [4,6]2)?

Page 40: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

dimension d

time in sec

3 4 5 6 7 80

50

100

150

200

QUANT [8,10]dQUANT [13,15]dQUANT [18,20]d

PRISM [8,10]d

PRISM [13,15]d

PRISM [18,20]d

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 12

Page 41: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

dimension d

time in sec

3 4 5 6 7 80

50

100

150

200

QUANT [8,10]dQUANT [13,15]dQUANT [18,20]d

PRISM [8,10]d

PRISM [13,15]d

PRISM [18,20]d

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 12

Page 42: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

dimension d

time in sec

3 4 5 6 7 80

50

100

150

200

QUANT [8,10]dQUANT [13,15]dQUANT [18,20]d

PRISM [8,10]d

PRISM [13,15]d

PRISM [18,20]d

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 12

Page 43: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 13

Page 44: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

QUANT: A Tool for the Cost Problem

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 13

Page 45: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Counting Parikh ImagesΣ: finite alphabet

p ∈ NΣ: vector

A: language generator (DFA, NFA, CFG)

N(A,p): number of words accepted by A with Parikh image p

Example: for A = a∗ba∗ and p = (2,1): N(A,p) = 3

PosParikh :=

Input: Language generators A,Bvector p ∈ NΣ

Output: Is N(A,p) > N(B,p) ?

Different variants:language generator: DFA, NFA, CFGunary or binary encoding of pfixed or variable alphabet Σ

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 14

Page 46: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of PosParikh [HKL’17]

vector p size of Σ DFA NFA CFG

unaryencoding

unary in L NL-c. P-c.fixed PL-c.

variable PP-c.

binaryencoding

unary in L NL-c. DP-c.

fixedPosMatPow-hard,

in CHPSPACE-c. PEXP-c.

variable PosSLP-hard,in CH

BitParikh :=

Input: Language generator Avector p ∈ NΣ

number i ∈ N in binary

Output: Is the i-th bit of N(A,p) equal to 1 ?

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 15

Page 47: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of PosParikh [HKL’17]

vector p size of Σ DFA NFA CFG

unaryencoding

unary in L NL-c. P-c.fixed PL-c.

variable PP-c.

binaryencoding

unary in L NL-c. DP-c.

fixedPosMatPow-hard,

in CHPSPACE-c. PEXP-c.

variable PosSLP-hard,in CH

BitParikh :=

Input: Language generator Avector p ∈ NΣ

number i ∈ N in binary

Output: Is the i-th bit of N(A,p) equal to 1 ?

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 15

Page 48: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

PosMatPow

PosMatPow :=

Input: m×m integer matrix M (in binary)number n ∈ N (in binary)

Output: Is (Mn)1,m ≥ 0 ?

The entries of Mn are of exponential size.

Theorem (Galby, Ouaknine, Worrell, 2015)PosMatPow is in P for m = 2.PosMatPow is in P for m = 3 and M given in unary.

PosMatPow reduces to PosSLP.

Theorem (HKL, 2017)PosMatPow reduces toPosParikh with DFAs, binary encoding of p, even for |Σ| = 2.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 16

Page 49: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

From Matrix Powers to Graphs

G: multi-graph with edges labelled by multiplicities

u v w2 3

N(G,u, v ,n) : number of paths from u to v of length n

N(G,u,w ,2) = 6

LemmaGiven an integer matrix M and indices i , j , one can compute inlogspace a multi-graph G with vertices u, v+, v− such that

(Mn)i,j = N(G,u, v+,n)− N(G,u, v−,n) for all n ∈ N.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 17

Page 50: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Getting Rid of Edge Weights

Replace u v21

by

10101 1010 101 10 1

u v

The edge weights are removed at the expense of longer paths.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 18

Page 51: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

From Graphs to DFAs

Replace v

v1

v2

v3

v4

by

v

v1

v2

v3

v4

a

b

b b b

ab b

ba

b

b

a

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 19

Page 52: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Complexity of PosParikh [HKL’17]

vector p size of Σ DFA NFA CFG

unaryencoding

unary in L NL-c. P-c.fixed PL-c.

variable PP-c.

binaryencoding

unary in L NL-c. DP-c.

fixedPosMatPow-hard,

in CHPSPACE-c. PEXP-c.

variable PosSLP-hard,in CH

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 20

Page 53: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Cost Markov Decision Processes

Theorem (HK, ICALP’15)The cost problem for MDPs is EXP-complete.

Theorem (HK, ICALP’15)The cost problem for acyclic MDPs is PSPACE-complete, evenfor atomic cost formulas.

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 21

Page 54: Efficient Analysis of Probabilistic Systems That ... · The Cost Problem 3 10: 15 7 10: 20 2 10: 5 8 10: 10 What is the probability to reach the gate in 25–45min? After what time

Main Message

Study complexity!

The exponential-time complexity can be improved by:formal language theoryPresburger arithmeticthe BEST theoremSMT-solvers

Stefan Kiefer Probabilistic Systems That Accumulate Quantities 22