Efficient Algorithms for Asymptotic Bounds on Termination Time in - - PowerPoint PPT Presentation

efficient algorithms for asymptotic bounds on termination
SMART_READER_LITE
LIVE PREVIEW

Efficient Algorithms for Asymptotic Bounds on Termination Time in - - PowerPoint PPT Presentation

Efficient Algorithms for Asymptotic Bounds on Termination Time in VASS Tom Brzdil 1 Krishnendu Chatterjee 2 Antonn Kuera 1 Petr Novotn 3 Dominik Velan 1 Florian Zuleger 3 1 Masaryk University 2 IST Austria 3 Forsyte, TU Wien July 2018


slide-1
SLIDE 1

Efficient Algorithms for Asymptotic Bounds

  • n Termination Time in VASS

Tomáš Brázdil 1 Krishnendu Chatterjee 2 Antonín Kučera 1 Petr Novotný 3 Dominik Velan 1 Florian Zuleger 3

1Masaryk University 2IST Austria 3Forsyte, TU Wien

July 2018

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-2
SLIDE 2

2/30

Motivation

Vector addition systems with states as a model of

concurrent processes, parametrized systems, programs in resource-bound analysis.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-3
SLIDE 3

2/30

Motivation

Vector addition systems with states as a model of

concurrent processes, parametrized systems, programs in resource-bound analysis.

Termination of VASS is in P-time.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-4
SLIDE 4

2/30

Motivation

Vector addition systems with states as a model of

concurrent processes, parametrized systems, programs in resource-bound analysis.

Termination of VASS is in P-time. Efficient programs terminate quickly.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-5
SLIDE 5

3/30

VASS

q1 q2 (0,0) (-1,1) (-1,0) (1,-1)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-6
SLIDE 6

3/30

VASS

q1 q2 (0,0) (-1,1) (-1,0) (1,-1) Definition Let d ∈ N. A d-dimensional vector addition system with states (VASS) is a pair A = (Q,T), where Q = ∅ is a finite set of states and T ⊆ Q ×Zd ×Q is a set of transitions such that for every q ∈ Q there exists p ∈ Q and u ∈ Zd such that (q,u,p) ∈ T.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-7
SLIDE 7

4/30

VASS - example

q1 q2 q3 q4 (0,0,0) (-1,1,0) (-1,0,1) (1,-1,0) (0,0,0) (0,0,0) (-1,1,0) (-1,0,0) (1,0,-1) (1,-1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-8
SLIDE 8

5/30

Overview

1

The problem

2

Linear termination

3

Polynomial termination

4

The algorithm

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-9
SLIDE 9

5/30

Overview

1

The problem

2

Linear termination

3

Polynomial termination

4

The algorithm

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-10
SLIDE 10

6/30

Definitions and notation

Definition A finite path π of length n: p0,u1,p1,u2,p2,...,un,pn where (pi,ui+1,pi+1) ∈ T for all 0 ≤ i < n. If p0 = pn, then π is a cycle. A cycle is simple if all p1,...,pn−1 are pairwise different.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-11
SLIDE 11

6/30

Definitions and notation

Definition A finite path π of length n: p0,u1,p1,u2,p2,...,un,pn where (pi,ui+1,pi+1) ∈ T for all 0 ≤ i < n. If p0 = pn, then π is a cycle. A cycle is simple if all p1,...,pn−1 are pairwise different. A configuration of A is a pair pv, where p ∈ Q and v ∈ Nd. The size of a configuration pv is defined as ||pv|| = ||v|| = max{v(i) | 1 ≤ i ≤ d}.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-12
SLIDE 12

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-13
SLIDE 13

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-14
SLIDE 14

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-15
SLIDE 15

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2), q(2,2)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-16
SLIDE 16

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2), q(2,2)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-17
SLIDE 17

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2), q(2,2), q(3,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-18
SLIDE 18

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2), q(2,2), q(3,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-19
SLIDE 19

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2), q(2,2), q(3,0), p(1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-20
SLIDE 20

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2), q(2,2), q(3,0), p(1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-21
SLIDE 21

7/30

Intuition

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) p(2,2), q(2,2), q(3,0), p(1,0), q(1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-22
SLIDE 22

8/30

Definitions and notation

Definition Let L(pv) be the least ℓ ∈ N∞ such that the length of every finite computation initiated in pv is bounded by ℓ. The termination complexity of A is a function L: N → N∞ defined by L(n) = sup

  • L(pv) | pv ∈ Q ×Nd where ||pv|| = n
  • .

If L(n) = ∞ for some n ∈ N, we say that A is non-terminating, otherwise it is terminating.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-23
SLIDE 23

9/30

The problem

Decide the asymptotic complexity of L.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-24
SLIDE 24

9/30

The problem

Decide the asymptotic complexity of L.

Is L ∈ Θ(n)? Is L polynomial? What is the degree of the polynomial?

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-25
SLIDE 25

10/30

Overview

1

The problem

2

Linear termination

3

Polynomial termination

4

The algorithm

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-26
SLIDE 26

11/30

Ranking functions

Definition Let A = (Q,T) be a VASS. A linear map f is a function f : Q ×Nd → Q f (pv) = cf ·v+wf (p) where c ∈ Qd and wf : Q → Q is some function. A transition (p,u,q) is called f -ranked if cf ·u+wf (q) ≤ wf (p)−1 and f -neutral if cf ·u+wf (q) = wf (p).

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-27
SLIDE 27

12/30

Ranking functions

Definition A linear map f is called a quasi-ranking function (QRF) if cf ≥ 0 and all transitions are either f -ranked or f -neutral. A QRF f is called ranking function (RF) if all transitions are f -ranked. A QRF f is called positive if cf > 0.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-28
SLIDE 28

13/30

Example

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) f (pv) = (3,2)·v+1 f (qv) = (3,2)·v

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-29
SLIDE 29

13/30

Example

p q t1 = (0,0) t2 = (−1,1) t3 = (−2,0) t4 = (1,−2) f (pv) = (3,2)·v+1 f (qv) = (3,2)·v configuration p(2,2) q(2,2) q(3,0) p(1,0) q(1,0) rank 11 10 9 4 3

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-30
SLIDE 30

14/30

Increments

Definition The effect of π = p0,u1,p1,u2,p2,...,un,pn: eff (π) = u1 +···+un. Let Inc = {eff (π) | π is a simple cycle of A}. The elements of Inc are called increments.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-31
SLIDE 31

15/30

Linear termination - RF

q1 q2 (0,0) (-1,1) (-1,0) (1,-2)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-32
SLIDE 32

15/30

Linear termination - RF

q1 q2 (0,0) (-1,1) (-1,0) (1,-2) x y

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-33
SLIDE 33

15/30

Example - RF

q1 q2 (0,0) (-1,1) (-1,0) (1,-2) x y

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-34
SLIDE 34

16/30

Example - positive QRF

q1 q2 (0,0) (-1,1) (-1,0) (1,-1)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-35
SLIDE 35

16/30

Example - positive QRF

q1 q2 (0,0) (-1,1) (-1,0) (1,-1) This is quadratic VASS.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-36
SLIDE 36

16/30

Example - positive QRF

q1 q2 (0,0) (-1,1) (-1,0) (1,-1) This is quadratic VASS. x y

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-37
SLIDE 37

17/30

Example - no QRF

q1 q2 (0,-1) (-1,2) (1,0) This is non-terminating VASS. x y

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-38
SLIDE 38

18/30

Example - no QRF

q1 q2 (0,-1) (-1,2) (-1,0) (1,-1) This is non-terminating VASS. x y

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-39
SLIDE 39

18/30

Linear termination - the characterization

Let n ∈ Rd, n = 0, then we define the sets Hn = {u ∈ Rd | u·n < 0}, ˆ Hn = {u ∈ Rd | u·n ≤ 0}. Theorem Let A = (Q,T) be a d-dimensional VASS. If there is an open half-space Hn of Rd such that n > and Inc ⊆ Hn, then L(n) ∈ O(n). If there is no open half-space Hn of Rd such that n > and Inc ⊆ Hn, then L(n) ∈ Ω(n2). VASS A is linear if and only if there exists a RF f with cf = k ·n for some k > 0.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-40
SLIDE 40

19/30

Linear termination - idea of the proof

Lemma If there is no open half-space Hn of Rd such that n > 0 and Inc ⊆ Hn, then there exist v1,...,vk ∈ Inc and b1,...,bk ∈ N+ such that k ≥ 1 and k

i=1 bivi ≥

0. Proof. We distinguish two possibilities. There exists a closed half-space ˆ Hn of Rd such that n > 0 and Inc ⊆ ˆ Hn. There is no closed half-space ˆ Hn of Rd such that n > and Inc ⊆ ˆ Hn.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-41
SLIDE 41

20/30

Linear termination - idea of the proof

Proof. There exists a closed half-space ˆ Hn of Rd such that n > 0 and Inc ⊆ ˆ Hn. In this case for some u ∈ Inc we have −u ∈ cone(Inc),

  • therwise we could tilt the normal n.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-42
SLIDE 42

20/30

Linear termination - idea of the proof

Proof. There exists a closed half-space ˆ Hn of Rd such that n > 0 and Inc ⊆ ˆ Hn. In this case for some u ∈ Inc we have −u ∈ cone(Inc),

  • therwise we could tilt the normal n.

There is no closed half-space ˆ Hn of Rd such that n > and Inc ⊆ ˆ Hn. In this case the intersection of cone(Inc) with the first

  • rthant is non-trivial.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-43
SLIDE 43

21/30

Overview

1

The problem

2

Linear termination

3

Polynomial termination

4

The algorithm

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-44
SLIDE 44

22/30

Classification

There is no n ≥ 0, n = 0 such that Inc ⊆ ˆ Hn i.e., there is no QRF. ⇒ Non-terminating VASS.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-45
SLIDE 45

22/30

Classification

There is no n ≥ 0, n = 0 such that Inc ⊆ ˆ Hn i.e., there is no QRF. ⇒ Non-terminating VASS. There exists n > 0 such that Inc ⊆ ˆ Hn i.e., there exists positive QRF. ⇒ Polynomial or non-terminating VASS. In this case, we have complete classification.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-46
SLIDE 46

22/30

Classification

There is no n ≥ 0, n = 0 such that Inc ⊆ ˆ Hn i.e., there is no QRF. ⇒ Non-terminating VASS. There exists n > 0 such that Inc ⊆ ˆ Hn i.e., there exists positive QRF. ⇒ Polynomial or non-terminating VASS. In this case, we have complete classification. There exists n ≥ 0 but not > 0 such that Inc ⊆ ˆ Hn i.e., there exists QRF but not necessarily positive one. ⇒ We do not know.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-47
SLIDE 47

23/30

Polynomial termination - example

q1 q2 (0,0) (-1,1) (-1,0) (1,-1) This is quadratic VASS. q1 q2 (0,0) (-1,1) (1,-1) (-1,0) This is non-terminating VASS.

x y

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-48
SLIDE 48

24/30

Polynomial termination - good normal

Observation: Let n > 0 be such that Inc ⊆ ˆ

  • Hn. We can do at most O(n)

transitions from the set {u ∈ Inc | u·n < 0}. We are looking for such n that maximizes this set.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-49
SLIDE 49

24/30

Polynomial termination - good normal

Observation: Let n > 0 be such that Inc ⊆ ˆ

  • Hn. We can do at most O(n)

transitions from the set {u ∈ Inc | u·n < 0}. We are looking for such n that maximizes this set. Definition Let n > 0 such that Inc ⊆ ˆ

  • Hn. We say that n is a good normal

if ∀u ∈ Inc we have u·n = 0 ⇔ −u ∈ cone(Inc). A good normal corresponds to the vector cf of a QRF f maximizing the set of f -ranked transitions.

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-50
SLIDE 50

25/30

Polynomial termination

The idea now is to take a VASS A = (Q,T) and do the following: compute a QRF maximizing the set of f -ranked transitions, find a set T ′ = {t ∈ T | t is f -neutral}, compute all SCCs of (Q,T ′), repeat the same steps for every SCC of (Q,T ′). Let k ∈ N be the depth of the recursion tree (with linear component in the leaves). Then L ∈ Θ(nk+1).

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-51
SLIDE 51

26/30

Polynomial termination - example

q1 q2 q3 q4 (0,0,0) (-1,1,0) (-1,0,1) (1,-1,0) (0,0,0) (0,0,0) (-1,1,0) (-1,0,0) (1,0,-1) (1,-1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-52
SLIDE 52

26/30

Polynomial termination - example

q1 q2 q3 q4 (0,0,0) (-1,1,0) (-1,0,1) (1,-1,0) (0,0,0) (0,0,0) (-1,1,0) (-1,0,0) (1,0,-1) (1,-1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-53
SLIDE 53

26/30

Polynomial termination - example

q1 q2 q3 q4 (0,0,0) (-1,1,0) (-1,0,1) (1,-1,0) (0,0,0) (-1,1,0) (1,0,-1) (1,-1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-54
SLIDE 54

26/30

Polynomial termination - example

q1 q2 q3 q4 (0,0,0) (-1,1,0) (-1,0,1) (1,-1,0) (0,0,0) (-1,1,0) (1,0,-1) (1,-1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-55
SLIDE 55

26/30

Polynomial termination - example

q1 q2 q3 q4 (-1,1,0) (1,-1,0) (-1,1,0) (1,-1,0)

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-56
SLIDE 56

27/30

Polynomial termination - idea of the proof

The proof is by induction on the depth of recursion. The O-bound follows from the following:

the size of every reachable configuration is in O(n), we can move at most linear distance from any point in any direction.

In order to obtain the Ω-bound, we construct the path of required length. Here we use that fact that for a good normal n and u ∈ Inc we have u·n = 0 iff −u ∈ cone(Inc).

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-57
SLIDE 57

27/30

Polynomial termination - idea of the proof

The proof is by induction on the depth of recursion. The O-bound follows from the following:

the size of every reachable configuration is in O(n), we can move at most linear distance from any point in any direction.

In order to obtain the Ω-bound, we construct the path of required length. Here we use that fact that for a good normal n and u ∈ Inc we have u·n = 0 iff −u ∈ cone(Inc). If we consider n ≥ 0 we can use the same idea and obtain a valid Ω-bound (but not valid O-bound in general).

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-58
SLIDE 58

28/30

Overview

1

The problem

2

Linear termination

3

Polynomial termination

4

The algorithm

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-59
SLIDE 59

29/30

The algorithm

Decompose(A)

1

f ← a QRF for A maximizing the number of ranked transitions,

2

Tf ← {f -neutral transitions of A}

3

if Tf = T then return ∞

4

if Tf = ∅ then return 1

5

let A1,...,Al be all SCCs of (Q,Tf ) with at least one transition

6

return 1+max{Decompose(A1),...,Decompose(Al)}

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-60
SLIDE 60

30/30

Conclusion

VASS termination time complete characterization of linear VASS

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS

slide-61
SLIDE 61

30/30

Conclusion

VASS termination time complete characterization of linear VASS partial characterization of polynomial VASS (including the degree of the polynomial)

no QRF ⇒ non-terminating VASS positive QRF ⇒ complete classification QRF ⇒ open problem

Brázdil, Chatterjee, Kučera, Novotný, Velan, Zuleger Asymptotic termination in VASS