Generic Partition Refjnement and Weighted Tree Automata Hans-Peter - - PowerPoint PPT Presentation

generic partition refjnement and weighted tree automata
SMART_READER_LITE
LIVE PREVIEW

Generic Partition Refjnement and Weighted Tree Automata Hans-Peter - - PowerPoint PPT Presentation

Generic Partition Refjnement and Weighted Tree Automata Hans-Peter Deifel , Stefan Milius, Lutz Schrder, Thorsten Wimann FM19 10.10.2019 1 / 22 Partition Refjnement 2 / 22 - e g i a P n m log n a j r a T Colour


slide-1
SLIDE 1

Generic Partition Refjnement and Weighted Tree Automata

Hans-Peter Deifel, Stefan Milius, Lutz Schröder, Thorsten Wißmann FM’19 10.10.2019

1 / 22

slide-2
SLIDE 2

Partition Refjnement

P a i g e

  • T

a r j a n

m · log n

Hopcroft

n · l

  • g

n

Markov Chain Lumping

m · l

  • g

n

Colour Refjnement

m · log n

…and many more

2 / 22

slide-3
SLIDE 3

Partition Refjnement

P a i g e

  • T

a r j a n

m · log n

Hopcroft

n · l

  • g

n

Markov Chain Lumping

m · l

  • g

n

Colour Refjnement

m · log n

…and many more

2 / 22

slide-4
SLIDE 4

Partition Refjnement

P a i g e

  • T

a r j a n

m · log n

Hopcroft

n · l

  • g

n

Markov Chain Lumping

m · l

  • g

n

Colour Refjnement

m · log n

…and many more

2 / 22

slide-5
SLIDE 5

Partition Refjnement

P a i g e

  • T

a r j a n

m · log n

Hopcroft

n · l

  • g

n

Markov Chain Lumping

m · l

  • g

n

Colour Refjnement

m · log n

…and many more

2 / 22

slide-6
SLIDE 6

Partition Refjnement

P a i g e

  • T

a r j a n

m · log n

Hopcroft

n · l

  • g

n

Markov Chain Lumping

m · l

  • g

n

Colour Refjnement

m · log n

…and many more

2 / 22

slide-7
SLIDE 7

Coalgebraic Partition Refjnement

3 / 22

slide-8
SLIDE 8

Coalgebras X FX c

states successor map type functor

Type Functor FX=

Labelled Transition Systems Deterministic Automata Markov Chains

4 / 22

slide-9
SLIDE 9

Coalgebras X FX c

states successor map type functor

Type Functor F: Set → Set FX= P(A × X)

Labelled Transition Systems

2 × XA

Deterministic Automata

R(X)

Markov Chains

. . .

4 / 22

slide-10
SLIDE 10

Behavioural Equivalence

X FX Y FY c

states successor map type functor

d h

homomorphism

Fh Identifjed by Coalgebra Homomorphism FX= P(A × X)

Bisimilarity

2 × XA

Language Equivalence

R(X)

Weighted Bisimilarity

. . .

5 / 22

slide-11
SLIDE 11

Coalgebraic Partition Refjnement

Generic Algorithm Functor F F-Coalgebra Refjnement Interface for F Partition

6 / 22

slide-12
SLIDE 12

Splitting Blocks

. . . . . . 0.3 0.7 0.5 0.5 0.2 0.8

B S B \ S A

✂ ✂ ✂

7 / 22

slide-13
SLIDE 13

Splitting Blocks

. . . . . . 0.3 0.7 0.5 0.5 0.2 0.8

B S B \ S A

✂ ✂ ✂

7 / 22

slide-14
SLIDE 14

Splitting Blocks

. . . . . . 0.3 0.7 0.5 0.5 0.2 0.8

B S B \ S A

✂ ✂ ✂

7 / 22

slide-15
SLIDE 15

Coalgebraic Partition Refjnement

Generic Algorithm Functor F F-Coalgebra Refjnement Interface for F Partition

8 / 22

slide-16
SLIDE 16

Refjnement Interface for F

Functor Encoding

Labels A ♭ : FX → B Bags (A × X)

Refjnement Interface

Type W (abstract, could be ints, reals, trees, …) init: F1 × BA → W update: BA Labels to S × W Weight of B → W × F3 × W

9 / 22

slide-17
SLIDE 17

Refjnement Interface for F

Functor Encoding

Labels A ♭ : FX → B Bags (A × X)

Refjnement Interface

Type W (abstract, could be ints, reals, trees, …) init: F1 × BA → W update: BA Labels to S × W Weight of B → W × F3 × W  . . . . . . 1 k b · · · · · ·

B S B \ S 9 / 22

slide-18
SLIDE 18

Refjnement Interface for F

Functor Encoding

Labels A ♭ : FX → B Bags (A × X)

Refjnement Interface

Type W (abstract, could be ints, reals, trees, …) init: F1 × BA → W update: BA Labels to S × W Weight of B → W × F3 × W

Example: FX = RX (real-valued functor)

A := R W := R × R init(_, ) = (0, ) update(, (r, b)) = ((r + b − , ), . . .)

9 / 22

slide-19
SLIDE 19

Refjnement Interface for F

Functor Encoding

Labels A ♭ : FX → B Bags (A × X)

Refjnement Interface

Type W (abstract, could be ints, reals, trees, …) init: F1 × BA → W update: BA Labels to S × W Weight of B → W × F3 × W Modular: Refjnement Interface can automatically be derived for composite functors (e.g. PD(−), M × M(−))

9 / 22

slide-20
SLIDE 20

Implementation “CoPaR”

Generic Imple- mentation

{f,n} x P({a,b} x X) q: (n, {(a, p), (b, r)}) p: (n, {(a, q), (b, r)}) r: (f, {(a, q), (b, p)})

Refjnement Interface

Block 0: r Block 1: q, p

Available at: git8.cs.fau.de/ software/copar

10 / 22

slide-21
SLIDE 21

Implementation “CoPaR”

Generic Imple- mentation

{f,n} x P({a,b} x X) q: (n, {(a, p), (b, r)}) p: (n, {(a, q), (b, r)}) r: (f, {(a, q), (b, p)})

Refjnement Interface

Block 0: r Block 1: q, p

Available at: git8.cs.fau.de/ software/copar

10 / 22

slide-22
SLIDE 22

Implementation “CoPaR”

Generic Imple- mentation

{f,n} x P({a,b} x X) q: (n, {(a, p), (b, r)}) p: (n, {(a, q), (b, r)}) r: (f, {(a, q), (b, p)})

Refjnement Interface

Block 0: r Block 1: q, p

Available at: git8.cs.fau.de/ software/copar

10 / 22

slide-23
SLIDE 23

Implementation - Refjnement Interface

Math

init: F1 × BA → W update: BA × W → W × F3 × W

Haskell

class (Ord (F1 f), Ord (F3 f)) ⇒ RefjnementInterface f where init :: F1 f → [Label f] → Weight f update :: [Label f ] → Weight f → (Weight f, F3 f, Weight f)

Also Modular: Automatically derived for composite functors (e.g. PD(−), M × M(−))

11 / 22

slide-24
SLIDE 24

Complexity

Refjnement Interface

init: F1 × BA → W, update: BA × W → W × F3 × W O(|ℓ| · p(n, m)) O(|ℓ| · p(n, m)) |ℓ| number of labels to subblock (BA) n number of states in coalgebra m number of edges in coalgebra

12 / 22

slide-25
SLIDE 25

Complexity

Refjnement Interface

init: F1 × BA → W, update: BA × W → W × F3 × W O(|ℓ| · p(n, m)) O(|ℓ| · p(n, m))

Overall

O((m + n) · log n · p(n, m)) Modularity: May add intermediate states

12 / 22

slide-26
SLIDE 26

System Functor FX Run-Time (m ≥ n) Specifjc algorithm Transition Systems PfX m · log n = m · log n

Paige, Tarjan 1987

LTS Pf(N × X) m · log m = m · log m

Dovier, Piazza, Policriti 2004

> m · log n

Valmari 2009

Markov Chains R(X) m · log n = m · log n

Valmari, Franceschinis 2010

DFA 2 × XA (A fjxed) n · log n = n · log n

Hopcroft 1971

2 × Pf(A × X) |A| · n · log(n + |A|) ≈ |A| · n · log n

Gries 1973/Knuutila 2001

Segala Systems Pf(A × DX) mD · log mPf < m · log n

Baier, Engelen, Majster-Cederbaum 2000

= mD · log mPf

Groote, Verduzco, de Vink 2018

Colour Refjnement BfX m · log n = m · log n

Berkholz, Bonsma, Grohe 2017

Weighted Tree Automata M × M(X)

M non-cancellative

m · log2 m ≪ m · n

Högberg, Maletti, May 2007

M × M(X)

M cancellative

m · log m =

  • poly. bound

m · log n

Högberg, Maletti, May 2007

slide-27
SLIDE 27

Case Study: Weighted Tree Automata

Defjnition

WTA: (Q, , M, ƒ, μ) Q: Set of states : Ranked alphabet M: Semiring (M, ·, +) ƒ: Final weight distribution ƒ : Q → M μ: Transition function μ : k → Qk → Q → M

14 / 22

slide-28
SLIDE 28

Case Study: Weighted Tree Automata

Example Language: zigzag (Högberg, Maletti, May)

 = {β/0, σ/2}, M = N zigzg: T → N zigzg( β ) = 1 zigzg( σ(β, _) ) = 2 zigzg( σ(σ(_, t), _) ) = 2 + zigzg(t) σ → 3 σ → 2 β → 1 β → 1 β → 1 ⇒ Recognized by automaton with 3 states

15 / 22

slide-29
SLIDE 29

Case Study: Weighted Tree Automata

Tasks

Describe the functor Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:

16 / 22

slide-30
SLIDE 30

Case Study: Weighted Tree Automata

Tasks

Describe the functor FX = M × M(X) Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:

16 / 22

slide-31
SLIDE 31

Case Study: Weighted Tree Automata

Tasks

Describe the functor FX = M × M(X) Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:

16 / 22

slide-32
SLIDE 32

Case Study: Weighted Tree Automata

Tasks

Describe the functor FX = M × M(X) Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:

M × − M(−) −

16 / 22

slide-33
SLIDE 33

Case Study: Weighted Tree Automata

Tasks

Describe the functor FX = M × M(X) Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:

M × − Done M(−) −

16 / 22

slide-34
SLIDE 34

Case Study: Weighted Tree Automata

Tasks

Describe the functor FX = M × M(X) Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:

M × − Done M(−) − Done

16 / 22

slide-35
SLIDE 35

Case Study: Weighted Tree Automata

Tasks

Describe the functor FX = M × M(X) Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:

M × − Done M(−) ??? − Done

16 / 22

slide-36
SLIDE 36

Refjnement Interface for M(−)

M cancellative ⇔  + c = b + c ⇒  = b

Refjnement Interface

M cancellative? Done (via Grothendieck construction) M non-cancellative? ???

17 / 22

slide-37
SLIDE 37

Non-cancellative Monoids

Problem

Need to subtract B − S  . . . . . . 1 kb1 · · · · · ·

B S B \ S

Trick

We know: Don’t evaluate sums; store and manipulate symbolically

18 / 22

slide-38
SLIDE 38

Non-cancellative Monoids

Problem

Need to subtract B − S  . . . . . . 1 kb1 · · · · · ·

B S B \ S

Trick

We know: S = 1 + . . . + n, B = 1 + . . . + n + b1 + . . . + bm ⇒ Don’t evaluate sums; store and manipulate symbolically

18 / 22

slide-39
SLIDE 39

Complexity for non-cancellative monoids

Sums stored as balanced search trees M → N ⇒ Size of those trees min(|M|, m) ⇒ Operations in O(log min(|M|, m))

init

O(1)

update

O(|ℓ| · log min(|M|, m))

fjnite infjnite

19 / 22

slide-40
SLIDE 40

Complexity for non-cancellative monoids

Sums stored as balanced search trees M → N ⇒ Size of those trees min(|M|, m) ⇒ Operations in O(log min(|M|, m))

init

O(1)

update

O(|ℓ| · log min(|M|, m))

p(n, m) = log min(|M|, m)

fjnite infjnite

19 / 22

slide-41
SLIDE 41

Complexity for non-cancellative monoids

Sums stored as balanced search trees M → N ⇒ Size of those trees min(|M|, m) ⇒ Operations in O(log min(|M|, m))

init

O(1)

update

O(|ℓ| · log min(|M|, m))

p(n, m) = log min(|M|, m)

⇓ ⇓

M fjnite

O(m log m)

M infjnite

O(m log2 m)

19 / 22

slide-42
SLIDE 42

Random WTAs in 16GB of RAM

4×X 4×X2 4×X3 4×X4 4×X5 0.6 0.8 1 1.2 1.4 ·105 signature states (2, ∨, 0) (N, mx, 0) (2, ∨, 0)64

1 1 – 1 7 m i l l i

  • n

e d g e s < 5 m i n u t e s

20 / 22

slide-43
SLIDE 43

Random WTAs in 16GB of RAM

4×X 4×X2 4×X3 4×X4 4×X5 0.6 0.8 1 1.2 1.4 ·105 signature states (2, ∨, 0) (N, mx, 0) (2, ∨, 0)64

1 1 – 1 7 m i l l i

  • n

e d g e s < 5 m i n u t e s

20 / 22

slide-44
SLIDE 44

System Functor FX Run-Time (m ≥ n) Specifjc algorithm Transition Systems PfX m · log n = m · log n

Paige, Tarjan 1987

LTS Pf(N × X) m · log m = m · log m

Dovier, Piazza, Policriti 2004

> m · log n

Valmari 2009

Markov Chains R(X) m · log n = m · log n

Valmari, Franceschinis 2010

DFA 2 × XA (A fjxed) n · log n = n · log n

Hopcroft 1971

2 × Pf(A × X) |A| · n · log(n + |A|) ≈ |A| · n · log n

Gries 1973/Knuutila 2001

Segala Systems Pf(A × DX) mD · log mPf < m · log n

Baier, Engelen, Majster-Cederbaum 2000

= mD · log mPf

Groote, Verduzco, de Vink 2018

Colour Refjnement BfX m · log n = m · log n

Berkholz, Bonsma, Grohe 2017

Weighted Tree Automata M × M(X)

M non-cancellative

m · log2 m ≪ m · n

Högberg, Maletti, May 2007

M × M(X)

M cancellative

m · log m =

  • poly. bound

m · log n

Högberg, Maletti, May 2007

slide-45
SLIDE 45

Thanks!

22 / 22