The Complexity of Counting Models of Linear-time Temporal Logic Joint work with Hazem Torfah

Martin Zimmermann

Saarland University

September 4th, 2014

Highlights 2014, Paris, France

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 1/7 For C: ∗ f : Σ → N is in #C if there is an NP machine M with oracle in C such that f (w) is equal to the number of accepting runs of M on w. Remark: f ∈ #C implies f (w) ∈ O(2p(|w|)) for some polynomial p. We need larger counting classes. ∗ f :Σ → N is in #d Pspace, if there is a nondeterministic polynomial-space M such that f (w) is equal to the number of accepting runs of M on w.

Analogously: #d Exptime,#d Expspace, and #d 2Exptime.

Counting Complexity

∗ f :Σ → N is in #P if there is an NP machine M such that f (w) is equal to the number of accepting runs of M on w.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 2/7 Remark: f ∈ #C implies f (w) ∈ O(2p(|w|)) for some polynomial p. We need larger counting classes. ∗ f :Σ → N is in #d Pspace, if there is a nondeterministic polynomial-space Turing machine M such that f (w) is equal to the number of accepting runs of M on w.

Analogously: #d Exptime,#d Expspace, and #d 2Exptime.

Counting Complexity

∗ f :Σ → N is in #P if there is an NP machine M such that f (w) is equal to the number of accepting runs of M on w. For complexity class C: ∗ f : Σ → N is in #C if there is an NP machine M with oracle in C such that f (w) is equal to the number of accepting runs of M on w.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 2/7 We need larger counting classes. ∗ f :Σ → N is in #d Pspace, if there is a nondeterministic polynomial-space Turing machine M such that f (w) is equal to the number of accepting runs of M on w.

Analogously: #d Exptime,#d Expspace, and #d 2Exptime.

Counting Complexity

∗ f :Σ → N is in #P if there is an NP machine M such that f (w) is equal to the number of accepting runs of M on w. For complexity class C: ∗ f : Σ → N is in #C if there is an NP machine M with oracle in C such that f (w) is equal to the number of accepting runs of M on w. Remark: f ∈ #C implies f (w) ∈ O(2p(|w|)) for some polynomial p.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 2/7 Analogously: #d Exptime,#d Expspace, and #d 2Exptime.

Counting Complexity

∗ f :Σ → N is in #P if there is an NP machine M such that f (w) is equal to the number of accepting runs of M on w. For complexity class C: ∗ f : Σ → N is in #C if there is an NP machine M with oracle in C such that f (w) is equal to the number of accepting runs of M on w. Remark: f ∈ #C implies f (w) ∈ O(2p(|w|)) for some polynomial p. We need larger counting classes. ∗ f :Σ → N is in #d Pspace, if there is a nondeterministic polynomial-space Turing machine M such that f (w) is equal to the number of accepting runs of M on w.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 2/7 Counting Complexity

∗ f :Σ → N is in #P if there is an NP machine M such that f (w) is equal to the number of accepting runs of M on w. For complexity class C: ∗ f : Σ → N is in #C if there is an NP machine M with oracle in C such that f (w) is equal to the number of accepting runs of M on w. Remark: f ∈ #C implies f (w) ∈ O(2p(|w|)) for some polynomial p. We need larger counting classes. ∗ f :Σ → N is in #d Pspace, if there is a nondeterministic polynomial-space Turing machine M such that f (w) is equal to the number of accepting runs of M on w.

Analogously: #d Exptime,#d Expspace, and #d 2Exptime.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 2/7 #d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Reductions: f is #P-hard, if there is a polynomial time s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#P

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 #d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#P ⊆ #Pspace

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 #d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#P ⊆ #Pspace ⊆ #Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 #d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( ⊆ #Expspace ⊆ #2Exptime

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 #d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( ⊆ #2Exptime

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 #d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( (

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( (

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#d Pspace

#P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 ( #d Expspace ⊆ #d 2Exptime ( ( ( (

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#d Pspace ⊆#d Exptime

#P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 ⊆ #d 2Exptime ( ( ( (

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#d Pspace ⊆#d Exptime ( #d Expspace

#P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 ( ( ( (

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime

#P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( #P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 Hardness for other classes analogously. Completeness as usual.

Counting Complexity

Lemma

#d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( #P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 Counting Complexity

Lemma

#d Pspace ⊆#d Exptime ( #d Expspace ⊆ #d 2Exptime ( ( ( ( #P ⊆ #Pspace ⊆ #Exptime ⊆ #NExptime ⊆ #Expspace ⊆ #2Exptime

Reductions: f is #P-hard, if there is a polynomial time computable function r s. t. f (r(M, w)) is equal to the number of accepting runs of M on w. Hardness for other classes analogously. Completeness as usual.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 3/7 The following problem is #d Pspace-complete: Given an LTL formula ϕ and a bound k (in binary), how many k-word-models does ϕ have?

Lower bound: Pspace-hardness of LTL satisfiability [SC85] made one-to-one Upper bound: Guess word of length k and model-check it

Counting Word-Models

Theorem The following problem is #P-complete: Given an LTL formula ϕ and a bound k (in unary), how many k-word-models does ϕ have?

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 4/7 Lower bound: Pspace-hardness of LTL satisfiability [SC85] made one-to-one Upper bound: Guess word of length k and model-check it

Counting Word-Models

Theorem The following problem is #P-complete: Given an LTL formula ϕ and a bound k (in unary), how many k-word-models does ϕ have?

The following problem is #d Pspace-complete: Given an LTL formula ϕ and a bound k (in binary), how many k-word-models does ϕ have?

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 4/7 Upper bound: Guess word of length k and model-check it

Counting Word-Models

Theorem The following problem is #P-complete: Given an LTL formula ϕ and a bound k (in unary), how many k-word-models does ϕ have?

The following problem is #d Pspace-complete: Given an LTL formula ϕ and a bound k (in binary), how many k-word-models does ϕ have?

Lower bound: Pspace-hardness of LTL satisfiability [SC85] made one-to-one

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 4/7 Counting Word-Models

Theorem The following problem is #P-complete: Given an LTL formula ϕ and a bound k (in unary), how many k-word-models does ϕ have?

The following problem is #d Pspace-complete: Given an LTL formula ϕ and a bound k (in binary), how many k-word-models does ϕ have?

Lower bound: Pspace-hardness of LTL satisfiability [SC85] made one-to-one Upper bound: Guess word of length k and model-check it

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 4/7 2p(n) Lower bound:

p(n) left

right p(n)

c1 c2 c2p(n)−1 c2p(n) 2p(n) Upper bound: Guess tree of height k and model-check it.

Counting Tree-Models with Unary Bounds

Theorem The following problem is #d Exptime-complete: Given an LTL formula ϕ and a bound k (in unary), how many k-tree-models does ϕ have?

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 5/7 Upper bound: Guess tree of height k and model-check it.

Counting Tree-Models with Unary Bounds

Theorem The following problem is #d Exptime-complete: Given an LTL formula ϕ and a bound k (in unary), how many k-tree-models does ϕ have? 2p(n) Lower bound:

p(n) left

right p(n)

c1 c2 c2p(n)−1 c2p(n) 2p(n)

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 5/7 Counting Tree-Models with Unary Bounds

Theorem The following problem is #d Exptime-complete: Given an LTL formula ϕ and a bound k (in unary), how many k-tree-models does ϕ have? 2p(n) Lower bound:

p(n) left

right p(n)

c1 c2 c2p(n)−1 c2p(n) 2p(n) Upper bound: Guess tree of height k and model-check it.

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 5/7 Lower bound: right C1

C2 C9

left C3 C6 C10 C13

C4 C5 C7 C8 C11 C12 C14 C15

each inner tree has exponentially many leaves tree has exponential height (thus, doubly-exponentially many inner trees) Upper bound: Guess tree of height k and model-check it

Counting Tree-Models with Binary Bounds

Theorem The following problem is #d Expspace-hard and in #d 2Exptime: Given an LTL formula ϕ and a bound k (in binary), how many k-tree-models does ϕ have?

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 6/7 Upper bound: Guess tree of height k and model-check it

Counting Tree-Models with Binary Bounds

Theorem The following problem is #d Expspace-hard and in #d 2Exptime: Given an LTL formula ϕ and a bound k (in binary), how many k-tree-models does ϕ have? Lower bound: right C1

C2 C9

left C3 C6 C10 C13

C4 C5 C7 C8 C11 C12 C14 C15

each inner tree has exponentially many leaves tree has exponential height (thus, doubly-exponentially many inner trees)

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 6/7 Counting Tree-Models with Binary Bounds

Theorem The following problem is #d Expspace-hard and in #d 2Exptime: Given an LTL formula ϕ and a bound k (in binary), how many k-tree-models does ϕ have? Lower bound: right C1

C2 C9

left C3 C6 C10 C13

C4 C5 C7 C8 C11 C12 C14 C15

each inner tree has exponentially many leaves tree has exponential height (thus, doubly-exponentially many inner trees) Upper bound: Guess tree of height k and model-check it

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 6/7 Lower bounds: safety LTL, upper bounds: full LTL

Open problems: Close the gap! Lowering the upper bound: how to guess and model-check doubly-exponentially sized trees in exponential space? Raising the lower bound: how to encode doubly-exponentially sized configurations using polynomially sized formulas? Do games help?

Conclusion

Overview of results: unary binary

words #P-compl. #d Pspace-compl. trees #d Exptime-compl. #d Expspace-hard/#d 2Exptime

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 7/7 Open problems: Close the gap! Lowering the upper bound: how to guess and model-check doubly-exponentially sized trees in exponential space? Raising the lower bound: how to encode doubly-exponentially sized configurations using polynomially sized formulas? Do games help?

Conclusion

Overview of results: unary binary

words #P-compl. #d Pspace-compl. trees #d Exptime-compl. #d Expspace-hard/#d 2Exptime

Lower bounds: safety LTL, upper bounds: full LTL

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 7/7 Lowering the upper bound: how to guess and model-check doubly-exponentially sized trees in exponential space? Raising the lower bound: how to encode doubly-exponentially sized configurations using polynomially sized formulas? Do games help?

Conclusion

Overview of results: unary binary

words #P-compl. #d Pspace-compl. trees #d Exptime-compl. #d Expspace-hard/#d 2Exptime

Lower bounds: safety LTL, upper bounds: full LTL

Open problems: Close the gap!

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 7/7 Raising the lower bound: how to encode doubly-exponentially sized configurations using polynomially sized formulas? Do games help?

Conclusion

Overview of results: unary binary

words #P-compl. #d Pspace-compl. trees #d Exptime-compl. #d Expspace-hard/#d 2Exptime

Lower bounds: safety LTL, upper bounds: full LTL

Open problems: Close the gap! Lowering the upper bound: how to guess and model-check doubly-exponentially sized trees in exponential space?

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 7/7 Conclusion

Overview of results: unary binary

words #P-compl. #d Pspace-compl. trees #d Exptime-compl. #d Expspace-hard/#d 2Exptime

Lower bounds: safety LTL, upper bounds: full LTL

Open problems: Close the gap! Lowering the upper bound: how to guess and model-check doubly-exponentially sized trees in exponential space? Raising the lower bound: how to encode doubly-exponentially sized configurations using polynomially sized formulas? Do games help?

Martin Zimmermann Saarland University The Complexity of Counting LTL Models 7/7