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
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
Hans-Peter Deifel, Stefan Milius, Lutz Schröder, Thorsten Wißmann FM’19 10.10.2019
1 / 22
P a i g e
a r j a n
m · log n
Hopcroft
n · l
n
Markov Chain Lumping
m · l
n
Colour Refjnement
m · log n
…and many more
2 / 22
P a i g e
a r j a n
m · log n
Hopcroft
n · l
n
Markov Chain Lumping
m · l
n
Colour Refjnement
m · log n
…and many more
2 / 22
P a i g e
a r j a n
m · log n
Hopcroft
n · l
n
Markov Chain Lumping
m · l
n
Colour Refjnement
m · log n
…and many more
2 / 22
P a i g e
a r j a n
m · log n
Hopcroft
n · l
n
Markov Chain Lumping
m · l
n
Colour Refjnement
m · log n
…and many more
2 / 22
P a i g e
a r j a n
m · log n
Hopcroft
n · l
n
Markov Chain Lumping
m · l
n
Colour Refjnement
m · log n
…and many more
2 / 22
3 / 22
states successor map type functor
Type Functor FX=
Labelled Transition Systems Deterministic Automata Markov Chains
4 / 22
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
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
Generic Algorithm Functor F F-Coalgebra Refjnement Interface for F Partition
6 / 22
. . . . . . 0.3 0.7 0.5 0.5 0.2 0.8
B S B \ S A
7 / 22
. . . . . . 0.3 0.7 0.5 0.5 0.2 0.8
B S B \ S A
7 / 22
. . . . . . 0.3 0.7 0.5 0.5 0.2 0.8
B S B \ S A
7 / 22
Generic Algorithm Functor F F-Coalgebra Refjnement Interface for F Partition
8 / 22
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
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
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
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
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
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
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
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
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
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
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 =
m · log n
Högberg, Maletti, May 2007
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
Example Language: zigzag (Högberg, Maletti, May)
= {β/0, σ/2}, M = N zigzg: T → N zigzg( β ) = 1 zigzg( σ(β, _) ) = 2 zigzg( σ(σ(_, t), _) ) = 2 + zigzg(t) σ → 3 σ → 2 β → 1 β → 1 β → 1 ⇒ Recognized by automaton with 3 states
15 / 22
Tasks
Describe the functor Find equivalence that corresponds to coalgebraic behavioural equivalence “Backwards Bisimulation” Implement refjnement interface Composite of:
16 / 22
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
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
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
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
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
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
M cancellative ⇔ + c = b + c ⇒ = b
Refjnement Interface
M cancellative? Done (via Grothendieck construction) M non-cancellative? ???
17 / 22
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
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
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
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
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
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, mx, 0) (2, ∨, 0)64
20 / 22
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, mx, 0) (2, ∨, 0)64
20 / 22
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 =
m · log n
Högberg, Maletti, May 2007
22 / 22