Optimal Storage of Combinatorial State Spaces Alfons Laarman ( - - PowerPoint PPT Presentation

optimal storage of combinatorial state spaces
SMART_READER_LITE
LIVE PREVIEW

Optimal Storage of Combinatorial State Spaces Alfons Laarman ( - - PowerPoint PPT Presentation

Optimal Storage of Combinatorial State Spaces Alfons Laarman ( alfons@laarman.com ) Theory Group, LIACS . 1 / 25 Optimal Storage of Combinatorial State Spaces Optimal Compression u u + w + k Uncompressed Information Theory This


slide-1
SLIDE 1

Optimal Storage of Combinatorial State Spaces

1 / 25

Optimal Storage of Combinatorial State Spaces

Alfons Laarman (alfons@laarman.com)

Theory Group, LIACS .

slide-2
SLIDE 2

Optimal Storage of Combinatorial State Spaces

2 / 25

Optimal Compression

u k +ǫ u +ǫ w Uncompressed Information Theory This paper

slide-3
SLIDE 3

Optimal Storage of Combinatorial State Spaces

3 / 25

Model Checking

slide-4
SLIDE 4

Optimal Storage of Combinatorial State Spaces

4 / 25

Enumerative Model Checking

Example (Peterson mutex protocol)

1

bool flag[2] = {0,0};

2

bool turn = 0;

1

flag[0] = 1;

2

turn = 1;

3

!flag[1] || turn==0; /* critical section */

4

flag[0] = 0; goto 1;

1

flag[1] = 1;

2

turn = 0;

3

!flag[0] || turn==1; /* critical section */

4

flag[1] = 0; goto 1;

Transition System (S,I,δ)

slide-5
SLIDE 5

Optimal Storage of Combinatorial State Spaces

4 / 25

Enumerative Model Checking

Example (Peterson mutex protocol)

1

bool flag[2] = {0,0};

2

bool turn = 0;

1

flag[0] = 1;

2

turn = 1;

3

!flag[1] || turn==0; /* critical section */

4

flag[0] = 0; goto 1;

1

flag[1] = 1;

2

turn = 0;

3

!flag[0] || turn==1; /* critical section */

4

flag[1] = 0; goto 1;

Transition System (S,I,δ)

  • S : pc1,pc2,flag[0],flag[1],turn
slide-6
SLIDE 6

Optimal Storage of Combinatorial State Spaces

4 / 25

Enumerative Model Checking

Example (Peterson mutex protocol)

1

bool flag[2] = {0,0};

2

bool turn = 0;

1

flag[0] = 1;

2

turn = 1;

3

!flag[1] || turn==0; /* critical section */

4

flag[0] = 0; goto 1;

1

flag[1] = 1;

2

turn = 0;

3

!flag[0] || turn==1; /* critical section */

4

flag[1] = 0; goto 1;

Transition System (S,I,δ)

  • S : pc1,pc2,flag[0],flag[1],turn
  • I := {1,1,0,0,0}
slide-7
SLIDE 7

Optimal Storage of Combinatorial State Spaces

4 / 25

Enumerative Model Checking

Example (Peterson mutex protocol)

1

bool flag[2] = {0,0};

2

bool turn = 0;

1

flag[0] = 1;

2

turn = 1;

3

!flag[1] || turn==0; /* critical section */

4

flag[0] = 0; goto 1;

1

flag[1] = 1;

2

turn = 0;

3

!flag[0] || turn==1; /* critical section */

4

flag[1] = 0; goto 1;

Transition System (S,I,δ)

  • S : pc1,pc2,flag[0],flag[1],turn
  • I := {1,1,0,0,0}
  • Defining δ:
  • δ(1,1,0,0,0) =
slide-8
SLIDE 8

Optimal Storage of Combinatorial State Spaces

4 / 25

Enumerative Model Checking

Example (Peterson mutex protocol)

1

bool flag[2] = {0,0};

2

bool turn = 0;

1

flag[0] = 1;

2

turn = 1;

3

!flag[1] || turn==0; /* critical section */

4

flag[0] = 0; goto 1;

1

flag[1] = 1;

2

turn = 0;

3

!flag[0] || turn==1; /* critical section */

4

flag[1] = 0; goto 1;

Transition System (S,I,δ)

  • S : pc1,pc2,flag[0],flag[1],turn
  • I := {1,1,0,0,0}
  • Defining δ:
  • δ(1,1,0,0,0) = {2,1,1,0,0,1,2,0,1,0}
  • δ(2,1,1,0,0) = ..., etc
slide-9
SLIDE 9

Optimal Storage of Combinatorial State Spaces

5 / 25

Enumerative Model Checking

1,1,0,0,0

peterson(i ∈ {0,1})

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

Reachability from I := {1,1,0,0,0}

  • S : pc1,pc2,flag[0],flag[1],turn
slide-10
SLIDE 10

Optimal Storage of Combinatorial State Spaces

5 / 25

Enumerative Model Checking

1,1,0,0,0 2,1,1,0,0 1,2,1,0,0

peterson(i ∈ {0,1})

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

Reachability from I := {1,1,0,0,0}

  • S : pc1,pc2,flag[0],flag[1],turn
slide-11
SLIDE 11

Optimal Storage of Combinatorial State Spaces

5 / 25

Enumerative Model Checking

1,1,0,0,0 2,1,1,0,0 1,2,1,0,0 3,1,1,0,1 2,2,1,1,0 1,3,0,1,0 4,1,1,0,1 1,4,0,1,0 3,2,1,1,1 2,3,1,1,0 4,2,1,1,1 2,4,1,1,0 3,3,1,1,1 3,3,1,1,0 3,4,1,1,1 4,3,1,1,0

peterson(i ∈ {0,1})

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

Reachability from I := {1,1,0,0,0}

  • S : pc1,pc2,flag[0],flag[1],turn
slide-12
SLIDE 12

Optimal Storage of Combinatorial State Spaces

5 / 25

Enumerative Model Checking

1,1,0,0,0 2,1,1,0,0 1,2,1,0,0 3,1,1,0,1 2,2,1,1,0 1,3,0,1,0 4,1,1,0,1 1,4,0,1,0 3,2,1,1,1 2,3,1,1,0 4,2,1,1,1 2,4,1,1,0 3,3,1,1,1 3,3,1,1,0 3,4,1,1,1 4,3,1,1,0

peterson(i ∈ {0,1})

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

Reachability from I := {1,1,0,0,0}

  • S : pc1,pc2,flag[0],flag[1],turn
  • Reachability from I
  • Check invariant ϕ ¬(pc1 = pc2 = 4)
slide-13
SLIDE 13

Optimal Storage of Combinatorial State Spaces

5 / 25

Enumerative Model Checking

1,1,0,0,0 2,1,1,0,0 1,2,1,0,0 3,1,1,0,1 2,2,1,1,0 1,3,0,1,0 4,1,1,0,1 1,4,0,1,0 3,2,1,1,1 2,3,1,1,0 4,2,1,1,1 2,4,1,1,0 3,3,1,1,1 3,3,1,1,0 3,4,1,1,1 4,3,1,1,0

peterson(i ∈ {0,1})

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

Reachability from I := {1,1,0,0,0}

  • S : pc1,pc2,flag[0],flag[1],turn
  • Reachability from I
  • Check invariant ϕ ¬(pc1 = pc2 = 4)
  • Also: LTL, CTL, modal µ-calculus, etc
slide-14
SLIDE 14

Optimal Storage of Combinatorial State Spaces

6 / 25

Locality in Model Checking

Example (Peterson)

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

1 1 0 0 0 2 1 1 0 0 3 1 1 0 1 4 1 1 0 1 1 1 0 0 1

slide-15
SLIDE 15

Optimal Storage of Combinatorial State Spaces

6 / 25

Locality in Model Checking

Example (Peterson)

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

1 1 0 0 0 2 1 1 0 0 3 1 1 0 1 4 1 1 0 1 1 1 0 0 1

Observations

  • Locality
slide-16
SLIDE 16

Optimal Storage of Combinatorial State Spaces

6 / 25

Locality in Model Checking

Example (Peterson)

1 flag[i] = 1; 2 turn = 1 − i; 3 !flag[1 − i] || turn==i; / critical section / 4 flag[i] = 0; goto 1;

1 1 0 0 0 2 1 1 0 0 3 1 1 0 1 4 1 1 0 1 1 1 0 0 1

Observations

  • Locality
  • Combinatorial

(Similar vectors of size k · u bit)

slide-17
SLIDE 17

Optimal Storage of Combinatorial State Spaces

7 / 25

Analysis of Compression Potential

slide-18
SLIDE 18

Optimal Storage of Combinatorial State Spaces

8 / 25

Claude Shannon (1916 — 2001)

“Father of Information Theory”

slide-19
SLIDE 19

Optimal Storage of Combinatorial State Spaces

9 / 25

Information Theory Refresher

Information Entropy

  • Encoding a random English text takes log2(±30) bit/char
slide-20
SLIDE 20

Optimal Storage of Combinatorial State Spaces

9 / 25

Information Theory Refresher

Information Entropy

  • Encoding a random English text takes log2(±30) bit/char
  • How some characters occur more frequent than others
  • Idea: use shorter bit patterns to encode frequent characters
slide-21
SLIDE 21

Optimal Storage of Combinatorial State Spaces

9 / 25

Information Theory Refresher

Information Entropy

  • Encoding a random English text takes log2(±30) bit/char
  • How some characters occur more frequent than others
  • Idea: use shorter bit patterns to encode frequent characters
  • H(A) = −Σα∈Ap(α)log2(p(α)) bits
slide-22
SLIDE 22

Optimal Storage of Combinatorial State Spaces

10 / 25

Optimum Compression

1,1,0,0,0,0 1,2,0,0,0,0 1,2,0,1,2,0

Information theoretical lower bound

  • View states as stream:
  • v1

1,...v1 K

  • ,
  • v2

1,...v2 K

  • ,...
slide-23
SLIDE 23

Optimal Storage of Combinatorial State Spaces

10 / 25

Optimum Compression

1,1,0,0,0,0 1,2,0,0,0,0 1,2,0,1,2,0 p( 1

k )

p( k−1

k )

Information theoretical lower bound

  • View states as stream:
  • v1

1,...v1 K

  • ,
  • v2

1,...v2 K

  • ,...
  • p(vi

j vi−1 j

) = 1

k

(locality!)

  • p(vi

j = vi−1 j

) = k−1

k

slide-24
SLIDE 24

Optimal Storage of Combinatorial State Spaces

10 / 25

Optimum Compression

1,1,0,0,0,0 1,2,0,0,0,0 1,2,0,1,2,0 p( 1

k )

p( k−1

k )

Information theoretical lower bound

  • View states as stream:
  • v1

1,...v1 K

  • ,
  • v2

1,...v2 K

  • ,...
  • p(vi

j vi−1 j

) = 1

k

(locality!)

  • p(vi

j = vi−1 j

) = k−1

k

  • Entropy per state ≈ u + log2(k) + ǫ bits
slide-25
SLIDE 25

Optimal Storage of Combinatorial State Spaces

10 / 25

Optimum Compression

1,1,0,0,0,0 1,2,0,0,0,0 1,2,0,1,2,0 p( 1

k )

p( k−1

k )

Information theoretical lower bound

  • View states as stream:
  • v1

1,...v1 K

  • ,
  • v2

1,...v2 K

  • ,...
  • p(vi

j vi−1 j

) = 1

k

(locality!)

  • p(vi

j = vi−1 j

) = k−1

k

  • Entropy per state ≈ u + log2(k) + ǫ bits
  • Store differences as new-value (u) × location (log2(k)):

1,1,0,0,0,0 2@1 1@3,2@4

slide-26
SLIDE 26

Optimal Storage of Combinatorial State Spaces

10 / 25

Optimum Compression

1,1,0,0,0,0 1,2,0,0,0,0 1,2,0,1,2,0 p( 1

k )

p( k−1

k )

Information theoretical lower bound

  • View states as stream:
  • v1

1,...v1 K

  • ,
  • v2

1,...v2 K

  • ,...
  • p(vi

j vi−1 j

) = 1

k

(locality!)

  • p(vi

j = vi−1 j

) = k−1

k

  • Entropy per state ≈ u + log2(k) + ǫ bits
  • Store differences as new-value (u) × location (log2(k)):

1,1,0,0,0,0 2@1 1@3,2@4

  • Yields O(n2) data structure

[Evangelista et al. — ATVA’13]

slide-27
SLIDE 27

Optimal Storage of Combinatorial State Spaces

11 / 25

Tree Compression

slide-28
SLIDE 28

Optimal Storage of Combinatorial State Spaces

12 / 25

Tree Compression Idea

1 0 0 0 0 0 2 0 0 0 0 0

n−1 0 0

0 0 0 n 0 0 0 0 0 u u u u u k 1 2

n−1

n × 0 0 0 0 0 − →

Best-case compression

  • Ω(n · k · u)

vs Ω(n · u)

slide-29
SLIDE 29

Optimal Storage of Combinatorial State Spaces

12 / 25

Tree Compression Idea

1 0 0 0 0 0 2 0 0 0 0 0

n−1 0 0

0 0 0 n 0 0 0 0 0 u u u u u k 1 2

n−1

n × 0 0 0 0 0 − → 1 0 2 0

n−1 0

n 0 0 0 0 0 0

Best-case compression

  • Ω(n · k · u)

vs Ω(n · u)

slide-30
SLIDE 30

Optimal Storage of Combinatorial State Spaces

13 / 25

Tree Compression

Inserting a vector in the tree

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3

slide-31
SLIDE 31

Optimal Storage of Combinatorial State Spaces

13 / 25

Tree Compression

Inserting a vector in the tree

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 3,5,5 4,1,3

slide-32
SLIDE 32

Optimal Storage of Combinatorial State Spaces

13 / 25

Tree Compression

Inserting a vector in the tree

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 3,5,5 4,1,3 3,5 4,1

slide-33
SLIDE 33

Optimal Storage of Combinatorial State Spaces

13 / 25

Tree Compression

Inserting a vector in the tree

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-34
SLIDE 34

Optimal Storage of Combinatorial State Spaces

13 / 25

Tree Compression

Inserting a vector in the tree

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 5 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-35
SLIDE 35

Optimal Storage of Combinatorial State Spaces

13 / 25

Tree Compression

Inserting a vector in the tree

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 6 5 1 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-36
SLIDE 36

Optimal Storage of Combinatorial State Spaces

13 / 25

Tree Compression

Inserting a vector in the tree

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 2 5 6 5 1 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-37
SLIDE 37

Optimal Storage of Combinatorial State Spaces

14 / 25

Tree Compression

5 1 2 1 2 1 2 1 2 1 1 1 2 2 2 1 1 1 1 1 1 6 8 5 6 6 8 5 5 8 4 3 3 4 3 3 4 3 3 4 3 3 5 4 5 5 4 5 5 4 5 5 4 4 4 4 4 4 4 4 4 4 1 4 4 4 5 5 5 6 6 6 3 3 3 3 3 3 5 6 1 1 2 3 3 5 6 8

O(n · k) Ω(2n · (k − 1))

slide-38
SLIDE 38

Optimal Storage of Combinatorial State Spaces

14 / 25

Tree Compression

5 1 2 1 2 1 2 1 2 1 1 1 2 2 2 1 1 1 1 1 1 6 8 5 6 6 8 5 5 8 4 3 3 4 3 3 4 3 3 4 3 3 5 4 5 5 4 5 5 4 5 5 4 4 4 4 4 4 4 4 4 4 1 4 4 4 5 5 5 6 6 6 3 3 3 3 3 3 5 6 1 1 2 3 3 5 6 8

O(n · k) Ω(2n · (k − 1)) n √n √n

slide-39
SLIDE 39

Optimal Storage of Combinatorial State Spaces

14 / 25

Tree Compression

5 1 2 1 2 1 2 1 2 1 1 1 2 2 2 1 1 1 1 1 1 6 8 5 6 6 8 5 5 8 4 3 3 4 3 3 4 3 3 4 3 3 5 4 5 5 4 5 5 4 5 5 4 4 4 4 4 4 4 4 4 4 1 4 4 4 5 5 5 6 6 6 3 3 3 3 3 3 5 6 1 1 2 3 3 5 6 8

O(n · k) Ω(2n · (k − 1)) n √n √n

Compression

✓ Combinatorial ⇒ balanced tree (n + 2√n + 4 4

  • (n)··· ≈ n tuples)
slide-40
SLIDE 40

Optimal Storage of Combinatorial State Spaces

14 / 25

Tree Compression

5 1 2 1 2 1 2 1 2 1 1 1 2 2 2 1 1 1 1 1 1 6 8 5 6 6 8 5 5 8 4 3 3 4 3 3 4 3 3 4 3 3 5 4 5 5 4 5 5 4 5 5 4 4 4 4 4 4 4 4 4 4 1 4 4 4 5 5 5 6 6 6 3 3 3 3 3 3 5 6 1 1 2 3 3 5 6 8

O(n · k) Ω(2n · (k − 1)) n √n √n

Compression

✓ Combinatorial ⇒ balanced tree (n + 2√n + 4 4

  • (n)··· ≈ n tuples)

✓ Can compresses states of length k to almost 2 · w bits! (w bits for pointers)

slide-41
SLIDE 41

Optimal Storage of Combinatorial State Spaces

14 / 25

Tree Compression

5 1 2 1 2 1 2 1 2 1 1 1 2 2 2 1 1 1 1 1 1 6 8 5 6 6 8 5 5 8 4 3 3 4 3 3 4 3 3 4 3 3 5 4 5 5 4 5 5 4 5 5 4 4 4 4 4 4 4 4 4 4 1 4 4 4 5 5 5 6 6 6 3 3 3 3 3 3 5 6 1 1 2 3 3 5 6 8

O(n · k) Ω(2n · (k − 1)) n √n √n

Compression

✓ Combinatorial ⇒ balanced tree (n + 2√n + 4 4

  • (n)··· ≈ n tuples)

✓ Can compresses states of length k to almost 2 · w bits! (w bits for pointers) ✗ What about access times?

slide-42
SLIDE 42

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree

3,5,5,4,1,3

slide-43
SLIDE 43

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree

3,5,5,4,1,3 3,5,5 4,1,3

slide-44
SLIDE 44

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree

3,5,5,4,1,3 3,5,5 4,1,3 3,5 4,1

slide-45
SLIDE 45

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-46
SLIDE 46

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 5 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-47
SLIDE 47

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 6 5 1 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-48
SLIDE 48

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree
  • Propagate hashed tuples back up

3,5,5,4,1,3 2 5 6 5 1 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-49
SLIDE 49

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree
  • Propagate hashed tuples back up
  • Incremental updates: (K − 1) → log2(K − 1) lookups

3,5,5,4,1,3 2 5 6 5 1 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-50
SLIDE 50

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree
  • Propagate hashed tuples back up
  • Incremental updates: (K − 1) → log2(K − 1) lookups

3,5,5,4,1,3 3,5,9,4,1,3 2 5 6 5 1 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1

slide-51
SLIDE 51

Optimal Storage of Combinatorial State Spaces

15 / 25

Incremental Tree Compression

[Laarman, van de Pol, Weber spin11]

Incremental insertion

  • Fold vectors in binary tree
  • Propagate hashed tuples back up
  • Incremental updates: (K − 1) → log2(K − 1) lookups

3,5,5,4,1,3 3,5,9,4,1,3 2 5 6 5 1 3 3 5 4 1 3,5,5 4,1,3 3,5 4,1 ? 5 6 9

slide-52
SLIDE 52

Optimal Storage of Combinatorial State Spaces

16 / 25

Compact Tree Compression

slide-53
SLIDE 53

Optimal Storage of Combinatorial State Spaces

17 / 25

Compact Tree Idea

2 2 1 2 2 1 1 1

Idea: store the universe of tuples in tree compactly

  • log2(|U|) = 2w

(internal pointers)

slide-54
SLIDE 54

Optimal Storage of Combinatorial State Spaces

17 / 25

Compact Tree Idea

2 2 1 2 2 1 1 1 n

Idea: store the universe of tuples in tree compactly

  • log2(|U|) = 2w

(internal pointers)

slide-55
SLIDE 55

Optimal Storage of Combinatorial State Spaces

17 / 25

Compact Tree Idea

2 2 1 2 2 1 1 1 n √n ≤ L ≤ n √n ≤ R ≤ n

Idea: store the universe of tuples in tree compactly

  • log2(|U|) = 2w

(internal pointers)

slide-56
SLIDE 56

Optimal Storage of Combinatorial State Spaces

17 / 25

Compact Tree Idea

2 2 1 2 2 1 1 1 n √n ≤ L ≤ n √n ≤ R ≤ n log2(L · R)

Idea: store the universe of tuples in tree compactly

  • log2(|U|) = 2w

(internal pointers)

slide-57
SLIDE 57

Optimal Storage of Combinatorial State Spaces

17 / 25

Compact Tree Idea

2 2 1 2 2 1 1 1 n √n ≤ L ≤ n √n ≤ R ≤ n log2(L · R)

Idea: store the universe of tuples in tree compactly

  • log2(|U|) = 2w

(internal pointers)

  • |U| = L · R
slide-58
SLIDE 58

Optimal Storage of Combinatorial State Spaces

17 / 25

Compact Tree Idea

2 2 1 2 2 1 1 1 n √n ≤ L ≤ n √n ≤ R ≤ n log2(L · R)

Idea: store the universe of tuples in tree compactly

  • log2(|U|) = 2w

(internal pointers)

  • |U| = L · R
  • n ≤ |U| ≤ n2
slide-59
SLIDE 59

Optimal Storage of Combinatorial State Spaces

17 / 25

Compact Tree Idea

2 2 1 2 2 1 1 1 n √n ≤ L ≤ n √n ≤ R ≤ n log2(L · R)

Idea: store the universe of tuples in tree compactly

  • log2(|U|) = 2w

(internal pointers)

  • |U| = L · R
  • n ≤ |U| ≤ n2
  • Can still be larger than optimal: 2w > u + log2(k) + ǫ
slide-60
SLIDE 60

Optimal Storage of Combinatorial State Spaces

18 / 25

Storing Tuples for log2(|U|) ∈ O(log2(n))

[Cleary ’84] [Geldenhuys, Valmari – spin’03][vdVegt, Laarman – memics’11]

Keys K |K| ≤ |T | ≤ |U| Universe U |U| = 2x k1 k2 k3 k4 r1 r3 r4 r2 q(k1) q ( k2 ) q ( k3 ) q ( k4 ) ∀i : ri = rem(ki) ∀i : ki = ri · |T | + q(ki) Cleary table T b = r + 3 2m

  • Cleary compact table ‘splits’ keys into quotient & remainder
  • Quotient is used to hash (therefore is log2(|T|) bit)
slide-61
SLIDE 61

Optimal Storage of Combinatorial State Spaces

18 / 25

Storing Tuples for log2(|U|) ∈ O(log2(n))

[Cleary ’84] [Geldenhuys, Valmari – spin’03][vdVegt, Laarman – memics’11]

Keys K |K| ≤ |T | ≤ |U| Universe U |U| = 2x k1 k2 k3 k4 r1 r3 r4 r2 q(k1) q ( k2 ) q ( k3 ) q ( k4 ) ∀i : ri = rem(ki) ∀i : ki = ri · |T | + q(ki) Cleary table T b = r + 3 2m

  • Cleary compact table ‘splits’ keys into quotient & remainder
  • Quotient is used to hash (therefore is log2(|T|) bit)
  • Only remainder is stored (r = log2(|U|) − log2(|T|) bit)

(additionally, 3 administration bits are needed to resolve collisions.)

slide-62
SLIDE 62

Optimal Storage of Combinatorial State Spaces

18 / 25

Storing Tuples for log2(|U|) ∈ O(log2(n))

[Cleary ’84] [Geldenhuys, Valmari – spin’03][vdVegt, Laarman – memics’11]

Keys K |K| ≤ |T | ≤ |U| Universe U |U| = 2x k1 k2 k3 k4 r1 r3 r4 r2 q(k1) q ( k2 ) q ( k3 ) q ( k4 ) ∀i : ri = rem(ki) ∀i : ki = ri · |T | + q(ki) Cleary table T b = r + 3 2m

  • Cleary compact table ‘splits’ keys into quotient & remainder
  • Quotient is used to hash (therefore is log2(|T|) bit)
  • Only remainder is stored (r = log2(|U|) − log2(|T|) bit)

(additionally, 3 administration bits are needed to resolve collisions.)

  • In practice, compression from 2w up to w

(i.e., often close to optimal)

slide-63
SLIDE 63

Optimal Storage of Combinatorial State Spaces

19 / 25

Theorem about compression

1 k +ǫ 1 +ǫ

u w−o+7

Uncompressed Information Theory This paper

Theorem

Let Treeopt be the best-case compact-tree compressed vector sizes. We have Treeopt ≤ w−o+7

u

Entropy provided 8 ≤ k ≤

4

√n + 4.

slide-64
SLIDE 64

Optimal Storage of Combinatorial State Spaces

20 / 25

Experiments [±500 models]

Language Models DVE All benchmarks from the BEEM database Promela All SPIN case studies, e.g.: GARP/i/x509/BRP protocols, etc Petri nets Subset from MCC 2016 competition also considered by [Jensen et al. NASA FM’17] mcrl2 process algebra Several industrial case studies

Model Checkers

  • LTSmin

[Kant, Laarman, et al. – TACAS’15]

  • SPIN, only Promela

[Holzmann ’97]

  • verifypn

[Jensen et al. NASA FM’17]

slide-65
SLIDE 65

Optimal Storage of Combinatorial State Spaces

20 / 25

Experiments [±500 models]

Language Models DVE All benchmarks from the BEEM database Promela All SPIN case studies, e.g.: GARP/i/x509/BRP protocols, etc Petri nets Subset from MCC 2016 competition also considered by [Jensen et al. NASA FM’17] mcrl2 process algebra Several industrial case studies

Model Checkers

  • LTSmin

[Kant, Laarman, et al. – TACAS’15]

  • SPIN, only Promela

[Holzmann ’97]

  • verifypn

[Jensen et al. NASA FM’17]

Tree Configuration

  • w = u = 30
  • Optimal is compressed size is 4 bytes / state
slide-66
SLIDE 66

Optimal Storage of Combinatorial State Spaces

21 / 25

Experiments: Compression

20 50 100 200 500 1000 5 10 15 20 25 State length (Bytes) Bytes/state (Compact Tree)

  • dve

mcrl2 petrinet promela avg=6.89 min=4B

1e+04 1e+06 1e+08 1e+10 5 10 15 20 25 Number of states Bytes/state (Compact Tree)

  • dve

mcrl2 petrinet promela avg=6.89 min=4B

Compression reaches information theoretic optimum

  • Lossless compression up to 4 bytes / state
  • Mean compression of 6.9 bytes / state
  • Also for long vectors and large state spaces
slide-67
SLIDE 67

Optimal Storage of Combinatorial State Spaces

22 / 25

Experiments: Compression

  • ● ●●

1e+03 1e+05 1e+07 50 100 150 Number of states Compression (Bytes / state)

  • SPIN

Tree

  • 1e+06

5e+06 2e+07 1e+08 20 40 60 80 Number of states Compression (Bytes / state)

  • Trie

Compact Tree (petrinet)

Comparison

  • SPIN uses collapse compression

[Holzmann ’97]

  • verifypn uses a trie

[Jensen et al. NASA FM’17]

slide-68
SLIDE 68

Optimal Storage of Combinatorial State Spaces

23 / 25

Experiments: Performance

!"!#$ !"#!$ #"!!$ #!"!!$ #!!"!!$ !"!#$ !"#!$ #"!!$ #!"!!$ #!!"!!$ !"##$%&#'($$ )*&+$,*-.#$%&#'($ %&'(&)*+,$-()*.&$/0&12$ 34$15-&$-()*.&$/0&12$ 6$7$8$

Runtime performance and parallel scalability

  • As fast as hash table
slide-69
SLIDE 69

Optimal Storage of Combinatorial State Spaces

23 / 25

Experiments: Performance

!"!#$ !"#!$ #"!!$ #!"!!$ #!!"!!$ !"!#$ !"#!$ #"!!$ #!"!!$ #!!"!!$ !"##$%&#'($$ )*&+$,*-.#$%&#'($ %&'(&)*+,$-()*.&$/0&12$ 34$15-&$-()*.&$/0&12$ 6$7$8$ 1e−02 1e+00 1e+02 1e+04 1e−02 1e+00 1e+02 1e+04 Compact Tree 1x (sec) Concurrent Compact Tree 48x (sec)

  • dve

mcrl2 petrinet promela 48x speedup equilibrium

Runtime performance and parallel scalability

  • As fast as hash table
  • Scalable on 48 core machine
slide-70
SLIDE 70

Optimal Storage of Combinatorial State Spaces

24 / 25

Experiments: BDD Comparison

  • 1e−01

1e+01 1e+03 1e−01 1e+01 1e+03 LTSmin with BDD (Bytes per state) Compact Tree (Bytes per state)

  • dve

mcrl2 petrinet promela min=4B equilibrium

  • 1e−01

1e+01 1e+03 1e−01 1e+01 1e+03 LTSmin with BDD (sec) Compact Tree (sec)

  • dve

mcrl2 petrinet promela timeout (10h) equil.

Compact Tree vs BDDs

  • BDD compression is non-linear
  • Performance is input-dependent
slide-71
SLIDE 71

Optimal Storage of Combinatorial State Spaces

25 / 25

“Optimal” Compression for Free

Conclusion

  • “Optimal” compression for free
  • Parallelizable
slide-72
SLIDE 72

Optimal Storage of Combinatorial State Spaces

25 / 25

“Optimal” Compression for Free

Conclusion

  • “Optimal” compression for free
  • Parallelizable

Future Work

  • Apply tree compression elsewhere
  • Apply information theory to decision diagrams

(non-linear)

  • Distributed tree with bit array