efficient analysis of probabilistic systems that ... · the cost problem 3 10: 15 7 10: 20 2 10: 5...
TRANSCRIPT
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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.
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.
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.
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.
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
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
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
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
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
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
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
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
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
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
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
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)?
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)?
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)?
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)?
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)?
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)?
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)?
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)?
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
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
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
QUANT: A Tool for the Cost Problem
Stefan Kiefer Probabilistic Systems That Accumulate Quantities 13
QUANT: A Tool for the Cost Problem
Stefan Kiefer Probabilistic Systems That Accumulate Quantities 13
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
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
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
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
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
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
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
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
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
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