SLIDE 1 Automata Learning: An Algebraic Approach
Henning Urbat – joint work with Lutz Schr¨
Oberseminar October 22, 2019
SLIDE 2 Automata Learning
Black Box System
learn
s0
ejectGrog
s1
insertCoin
Hypothesis Tests Hypothesis
··· Hypothesis 2
SLIDE 3 Automata Learning
Black Box System
learn
◮ Finite automaton ◮ Weighted automaton ◮ B¨ uchi automaton ◮ Register automaton ◮ · · ·
2
SLIDE 4 Automata Learning
Black Box System
learn
◮ Finite automaton ◮ Weighted automaton ◮ B¨ uchi automaton ◮ Register automaton ◮ · · ·
2
SLIDE 5 Automata Learning: Categorical View
Coalgebraic approach: ◮ Learning automata with side effects X → 2 × (TX)Σ in Set.
van Heerdt, Sammartino, Silva 2017
◮ Learning coalgebras X → GX in Set.
Barlocco, Kupke, Rot 2019
This talk: Algebraic approach Model formal languages and their algebraic recognition via monads. ◮ Generic approach to algebraic language theory.
nczyk 2015, Urbat, Ad´ amek, Chen, Milius 2016/2017, Salamanca 2017
◮ Well-suited for, e.g., ω-regular languages, tree languages, data languages, cost functions.
3
SLIDE 6
Automata Learning: Categorical View
Part I Learning Automata in a Category
4
SLIDE 7 Categorical Automata
Fix a complete and cocomplete category D with (E, M)-factorizations and D
F ⊥
D
G
- An (F-)automaton is given by the data
FQ
δQ
iQ
Q
δ@
Q
O
GQ
5
SLIDE 8 Classical Deterministic Automata
Set
Σ×(−) ⊥
Set
[Σ,−]
δQ
iQ
Q
δ@
Q
2
[Σ, Q]
6
SLIDE 9 Sorted Deterministic Automata
SetS
F ⊥
SetS
G
Σ = (Σs,t)s,t, (FQ)t =
Σs,t × Qs, (GQ)t =
[Σt,s, Qs]
δQ,t
iQ,t
Qt
δ@
Q,t
2
7
SLIDE 10 Linear Weighted Automata
K−Vect
Σ⊗(−) ⊥
K−Vect
[Σ,−]
δQ
iQ
Q
δ@
Q
K
[Σ, Q]
8
SLIDE 11 Semilattice Automata (a.k.a. Nondeterministic Automata)
SLat
Σ⊗(−) ⊥
SLat
[Σ,−]
δQ
iQ
Q
δ@
Q
2
[Σ, Q]
Ad´ amek, Milius, Myers, Urbat: Canonical Nondeterministic Automata, 2014 Denis, Lemay, Terlutte: Residual Finite State Automata, 2001 9
SLIDE 12 Nominal Automata [Boja´ nczyk, Klin, Lasota 2013]
Nom
A×(−) ⊥
Nom
[A,−]
δQ
iQ
Q
δ@
Q
2
[A, Q]
10
SLIDE 13 Nominal Automata with Name Binding [Kozen et al. 2015]
Nom
A×(−) + A∗(−) ⊥
Nom
[A,−] × [A](−)
δQ
iQ
Q
δ@
Q
2
[A, Q] × [A]Q
11
SLIDE 14 Nominal Automata with Two-Sided Name Binding
Nom
A×(−) + A∗(−) + [A](−) ⊥
Nom
[A,−] × [A](−) × R
δQ
iQ
Q
δ@
Q
2
[A, Q] × [A]Q × RQ
- cf. Gabbay, Ghica, Petri¸
san: Leaving the Nest, 2015 12
SLIDE 15 Categorical Automata
Fix a complete and cocomplete category D with (E, M)-factorizations and D
F ⊥
D
G
- An (F-)automaton is given by the data
FQ
δQ
iQ
Q
δ@
Q
O
GQ
13
SLIDE 16 Language Semantics
D
F ⊥
D
G
I, O ∈ D
Initial algebra for FI = I + F: µFI = colim( 0
¡
− → FI0
FI ¡
− − → F 2
I 0 F 2
I ¡
− − → · · · ) Final coalgebra for GO = O × G: νGO = lim( 1
!
← − GO1
GO!
← − − G 2
O1 G 2
O!
← − − · · · ) A language is a morphism L: µFI → O. The accepted language of an automaton Q is defined by LQ = ( µFI
eQ
Q
fQ
O ).
14
SLIDE 17 Language Semantics: Classical Automata
Set
Σ×(−) ⊥
Set
[Σ,−]
I = 1, O = 2
Initial algebra for FI = 1 + Σ × (−): Σ∗ = colim( Σ<0 Σ<1 Σ<2 · · · ) Final coalgebra for GO = 2 × [Σ, −]: [Σ∗, 2] = lim( [Σ<0, 2] ← [Σ<1, 2] ← [Σ<2, 2] ← · · · ) A language is a function L: Σ∗ → 2. The accepted language of an automaton Q is defined by LQ = ( Σ∗ eQ − → Q
fQ
− → 2 ).
15
SLIDE 18 Minimal Automata
An automaton Q is minimal if it is ◮ reachable: the unique FI-algebra morphism eQ : µFI → Q lies in E; ◮ simple: the unique GO-coalgebra morphism mQ : Q → νGO lies in M. Theorem (cf. Arbib, Manes 1975) For every language L: µFI → O there exists a unique minimal automaton Min(L) accepting L. µFI
eQ
mQ
16
SLIDE 19 Angluin’s Algorithm: Overview
Goal: Given an unknown finite automaton Σ × Q
δQ
iQ
Q
δ@
Q
2
[Σ, Q] learn an automaton equivalent to Q by asking questions to a teacher: ◮ Membership queries. Given w ∈ Σ∗, is w ∈ LQ? ◮ Equivalence queries. Given an automaton H, is LH = LQ? If not, teacher delivers a counterexample w ∈ LH ⊕ LQ.
17
SLIDE 20 Angluin’s Algorithm: Overview
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
mQ
[Σ<1, 2]
[Σ<k+1, 2]
mQ ◦ eQ : v → λw.LQ(vw) (“Hankel matrix”)
18
SLIDE 21 Angluin’s Algorithm: Overview
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
mQ
[Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
S ⊆ Σ<n, T ⊆ Σ<k
19
SLIDE 22 Angluin’s Algorithm: Overview
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS,T
mQ
[Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
hS,T : s → λt.LQ(st) (“Observation table”)
20
SLIDE 23 Angluin’s Algorithm: Overview
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS,T
mQ
[Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
Idea: Define automata structure on HS,T that approximates Q. Requires the pair (S, T) to be closed and consistent!
21
SLIDE 24 Angluin’s Algorithm: Overview
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS,T
mQ
[Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
Idea: Define automata structure on HS,T that approximates Q. Requires the pair (S, T) to be closed and consistent!
21
SLIDE 25
Angluin’s Algorithm: Closed Pairs
The pair (S, T) is closed if for s ∈ S and a ∈ Σ there exists s′ ∈ S with hS∪SΣ,T(sa) = hS,T(s′).
22
SLIDE 26 Angluin’s Algorithm: Closed Pairs
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS∪SΣ,T
- eS∪SΣ,T
- HS,T
- mS,T
- HS∪SΣ,T
- mS∪SΣ,T
- Q
mQ
[T, 2] [Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
23
SLIDE 27 Angluin’s Algorithm: Closed Pairs
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS∪SΣ,T
- eS∪SΣ,T
- HS,T
- mS,T
- HS∪SΣ,T
- mS∪SΣ,T
- Q
mQ
[T, 2] [Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
24
SLIDE 28 Angluin’s Algorithm: Closed Pairs
The pair (S, T) is closed if for s ∈ S and a ∈ Σ there exists s′ ∈ S with hS∪SΣ,T(sa) = hS,T(s′). Equivalently: HS,T HS∪SΣ,T is an isomorphism. If (S, T) is not closed: Extend S
- 1. Choose s ∈ S and a ∈ Σ such that, for all s′ ∈ S,
hS∪SΣ,T(sa) = hS,T(s′).
25
SLIDE 29 Angluin’s Algorithm: Closed Pairs
The pair (S, T) is closed if for s ∈ S and a ∈ Σ there exists s′ ∈ S with hS∪SΣ,T(sa) = hS,T(s′). Equivalently: HS,T HS∪SΣ,T is an isomorphism. If (S, T) is not closed: Extend S
- 1. Choose s ∈ S and a ∈ Σ such that, for all s′ ∈ S,
hS∪SΣ,T(sa) = hS,T(s′).
25
SLIDE 30
Angluin’s Algorithm: Consistent Pairs
The pair (S, T) is consistent if hS,T(s) = hS,T(s′) implies hS,T∪ΣT(s) = hS,T∪ΣT(s).
26
SLIDE 31 Angluin’s Algorithm: Consistent Pairs
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS,T
hS,T∪ΣT
- eS,T∪ΣT
- HS,T
- mS,T
- HS,T∪ΣT
- mS,T∪ΣT
- Q
mQ
[T ∪ ΣT, 2]
[Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
27
SLIDE 32 Angluin’s Algorithm: Consistent Pairs
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS,T
hS,T∪ΣT
- eS,T∪ΣT
- HS,T
- mS,T
- HS,T∪ΣT
- mS,T∪ΣT
- Q
mQ
[T ∪ ΣT, 2]
[Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
28
SLIDE 33 Angluin’s Algorithm: Consistent Pairs
The pair (S, T) is consistent if hS,T(s) = hS,T(s′) implies hS,T∪ΣT(s) = hS,T∪ΣT(s). Equivalently: HS∪SΣ,T ։ HS,T is an isomorphism. If (S, T) is not consistent: Extend T
- 1. Choose s, s′ ∈ S, a ∈ Σ and t ∈ T with
hS,T(s) = hS,T(s′) and hS,T∪ΣT(s)(at) = hS,T∪ΣT(s′)(at).
29
SLIDE 34 Angluin’s Algorithm: Consistent Pairs
The pair (S, T) is consistent if hS,T(s) = hS,T(s′) implies hS,T∪ΣT(s) = hS,T∪ΣT(s). Equivalently: HS∪SΣ,T ։ HS,T is an isomorphism. If (S, T) is not consistent: Extend T
- 1. Choose s, s′ ∈ S, a ∈ Σ and t ∈ T with
hS,T(s) = hS,T(s′) and hS,T∪ΣT(s)(at) = hS,T∪ΣT(s′)(at).
29
SLIDE 35 Angluin’s Algorithm: Constructing Hypotheses
If (S, T) is closed and consistent: build hypothesis automaton on HS,T. S
hS,T
mS,T [T, 2]
◮ states HS,T = hS,T[S]; ◮ transitions hS,T(s) a − → hS∪SΣ,T(sa) for s ∈ S, a ∈ Σ; ◮ initial state hS,T(ǫ); ◮ final states: all hS,T(s) with s ∈ S ∩ LQ.
30
SLIDE 36 Angluin’s Algorithm: Summary
Angluin’s Algorithm Goal: Learn an automaton equivalent to an unknown automaton Q.
- 1. Initialize (S, T) := ({ǫ}, {ǫ}).
- 2. Extend S and T until (S, T) is closed and consistent.
- 3. Build the hypothesis HS,T and ask whether LHS,T = LQ.
◮ If LHS,T = LQ: Return HS,T. ◮ If LHS,T = LQ: Add all prefixes of the counterexample w ∈ Σ∗ to S.
31
SLIDE 37 Learning Categorical Automata
Goal: Learn an automaton equivalent to an unknown automaton FQ
δQ
iQ
Q
δ@
Q
2
GQ
32
SLIDE 38 Angluin’s Algorithm: Overview
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS,T
mQ
[Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
33
SLIDE 39 Learning Categorical Automata: Overview
FI0 · · ·
F n
I 0
F n+1
I
· · ·
µFI
eQ
hS,T
mQ
1 GO1
O1 t
O
1
34
SLIDE 40 Learning Categorical Automata: Overview
FI0 · · ·
F n
I 0
F n+1
I
· · ·
µFI
eQ
hS,T
FIS
mQ
GOT
τ
GO1
O1 t
O
1
S subcoalgebra, T quotient algebra
35
SLIDE 41 Angluin’s Algorithm: Closed Pairs
Σ<0
Σ<1 · · ·
Σ<n
Σ<n+1 · · ·
Σ∗
eQ
hS∪SΣ,T
- eS∪SΣ,T
- HS,T
- mS,T
- HS∪SΣ,T
- mS∪SΣ,T
- Q
mQ
[T, 2] [Σ<0, 2] [Σ<1, 2]
- · · ·
- [Σ<k, 2]
- [Σ<k+1, 2]
- · · ·
- [Σ∗, 2]
(S, T) closed iff HS,T HS∪SΣ,T iso.
36
SLIDE 42 Learning Categorical Automata: Closed Pairs
FI0 · · ·
F n
I 0
F n+1
I
· · ·
µFI
eQ
hS,T
FIS
- FI s
- hFI S,T
- eFI S,T
- HS,T
- mS,T
- HFI S,T
- mFI S,T
- Q
mQ
T 1 GO1
O1 t
O
1
37
SLIDE 43 Learning Categorical Automata: Closed Pairs
The pair (S, T) is closed if HS,T HFI S,T is an isomorphism. If (S, T) is not closed: Extend S
- 1. Choose a factorization
S
FIS
S′
FIS
eFI S,T
HFI S,T lies in E.
s F n I 0 by S′
FIS
FI s F n+1 I
0 .
38
SLIDE 44 Learning Categorical Automata: Closed Pairs
FI0 · · ·
F n
I 0
F n+1
I
· · ·
µFI
eQ
- S
- hS,T
- eS,T
- s
- S′
- HS,T
- mS,T
- Q
mQ
1 GO1
O1 t
O
1
39
SLIDE 45 Learning Categorical Automata: Consistent Pairs
The pair (S, T) is consistent if HS,GOT ։ HS,T is an isomorphism. If (S, T) is not consistent: Extend T
- 1. Choose a factorization
T GOT
τ
mS,GO T GOT
T ′ lies in M.
O1 t
T by G k+1
O
1
GOt GOT
T ′ .
40
SLIDE 46 Learning Categorical Automata: Consistent Pairs
FI0 · · ·
F n
I 0
F n+1
I
· · ·
µFI
eQ
hS,T
mQ
T ′
GO1
O1 t
O
1
41
SLIDE 47 Learning Categorical Automata: Constructing Hypotheses
If (S, T) is closed and consistent: build hypothesis automaton on HS,T. S
hS,T
mS,T T
◮ states HS,T; ◮ initial state I
inl
− → I + FS = FIS
eFI S,T
− − − → HFI S,T
∼ =
− → HS,T; ◮ final states HS,T
∼ =
− → HS,GOT
mS,GO T
− − − − → GOT = O × GT
− − → O; ◮ transitions FHS,T
δS,T
− − → HS,T via diagonal fill-in.
42
SLIDE 48 Learning Categorical Automata: Constructing Hypotheses
FS
FeS,T inr
∼ =
eFI S,T
FmS,GO T
∼ =
Foutr
ǫ
mS,T
T
43
SLIDE 49
Learning Categorical Automata: Counterexamples
In Angluin’s algorithm: If LHS,T = LQ, then ◮ learner receives counterexample w ∈ LHS,T ⊕ LQ, and ◮ adds set C of all prefixes of w to S. Categorical generalization: identify w with C. Definition (Counterexample) A counterexample for HS,T is a subcoalgebra C F m
I 0 with
( C F m
I 0 µFI LHS,T
− − − → O ) = ( C F m
I 0 µFI LQ
− → O ). Adding C F m
I 0 to S F n I 0 means:
replace S by S ∨ C F max{m,n}
I
0.
44
SLIDE 50 Learning Categorical Automata: Summary
Generalized Angluin Algorithm Goal: Learn an automaton equivalent to an unknown automaton Q.
I 0, G k O1 ։ T) = ( I ∼ =
− → F 1
I 0, G 1 O1 ∼ =
− → O).
- 2. Extend S and T until (S, T) is closed and consistent.
- 3. Build the hypothesis HS,T and ask whether LHS,T = LQ.
◮ If LHS,T = LQ: Return HS,T. ◮ If LHS,T = LQ: Add the counterexample C F m
I 0 to S.
Correctness and termination requires Q to be “finite”!
45
SLIDE 51 Learning Categorical Automata: Summary
Generalized Angluin Algorithm Goal: Learn an automaton equivalent to an unknown automaton Q.
I 0, G k O1 ։ T) = ( I ∼ =
− → F 1
I 0, G 1 O1 ∼ =
− → O).
- 2. Extend S and T until (S, T) is closed and consistent.
- 3. Build the hypothesis HS,T and ask whether LHS,T = LQ.
◮ If LHS,T = LQ: Return HS,T. ◮ If LHS,T = LQ: Add the counterexample C F m
I 0 to S.
Correctness and termination requires Q to be “finite”!
45
SLIDE 52
Learning Categorical Automata: Finite Objects
The object Q ∈ D is finite if every proper ascending chain of subobjects S0 S1 S2 S3 · · · Q is finite, and every proper ascending chain of quotients T0 և T1 և T2 և T3 և · · · և Q is finite. The size of Q is the length of the longest proper ascending chain. ◮ Set: finite objects = finite sets, size = cardinality ◮ K−Vect: finite objects = finite-dimensional spaces, size = dimension ◮ Nom: finite objects = orbit-finite sets, size of Q ≈ #(orbits of Q) • max{|supp(q)| : q ∈ Q}.
46
SLIDE 53
Learning Categorical Automata: Finite Objects
The object Q ∈ D is finite if every proper ascending chain of subobjects S0 S1 S2 S3 · · · Q is finite, and every proper ascending chain of quotients T0 և T1 և T2 և T3 և · · · և Q is finite. The size of Q is the length of the longest proper ascending chain. ◮ Set: finite objects = finite sets, size = cardinality ◮ K−Vect: finite objects = finite-dimensional spaces, size = dimension ◮ Nom: finite objects = orbit-finite sets, size of Q ≈ #(orbits of Q) • max{|supp(q)| : q ∈ Q}.
46
SLIDE 54 Learning Categorical Automata: Correctness and Termination
Generalized Angluin Algorithm Goal: Learn an automaton equivalent to an unknown automaton Q.
I 0, G k O1 ։ T) = ( I ∼ =
− → F 1
I 0, G 1 O1 ∼ =
− → O).
- 2. Extend S and T until (S, T) is closed and consistent.
- 3. Build the hypothesis HS,T and ask whether LHS,T = LQ.
◮ If LHS,T = LQ: Return HS,T. ◮ If LHS,T = LQ: Add the counterexample C F m
I 0 to S.
Theorem Suppose that Q is finite. Then the algorithm terminates after O(size(Q)) steps and returns Min(LQ).
47
SLIDE 55
Learning Categorical Automata: Summary
Common generalization and unification of (both known and new) learning algorithms, correctness proofs, complexity analysis: ◮ D = Set: classical deterministic automata [Angluin 1987] ◮ D = SetS: sorted deterministic automata ◮ D = SLat: residual nondeterministic automata [Bollig et al. 2009] ◮ D = K−Vect: linear weighted automata [van Heerdt et al. 2017] ◮ D = Nom: nominal automata without name binding [Moerman et al. 2017], name binding to the right, two-sided name binding. Next: Apply framework to learn ω-regular languages, tree languages, cost functions, . . . . . . using monads!
48
SLIDE 56
Learning Categorical Automata: Summary
Common generalization and unification of (both known and new) learning algorithms, correctness proofs, complexity analysis: ◮ D = Set: classical deterministic automata [Angluin 1987] ◮ D = SetS: sorted deterministic automata ◮ D = SLat: residual nondeterministic automata [Bollig et al. 2009] ◮ D = K−Vect: linear weighted automata [van Heerdt et al. 2017] ◮ D = Nom: nominal automata without name binding [Moerman et al. 2017], name binding to the right, two-sided name binding. Next: Apply framework to learn ω-regular languages, tree languages, cost functions, . . . . . . using monads!
48
SLIDE 57
Automata Learning: Categorical View
Part II Learning Monad-Recognizable Languages
49
SLIDE 58
Languages
Setting: category D with I, O ∈ D and monad T on D. Definition Language = morphism L: TI → O in D ◮ Languages of finite words: semigroup monad TI = I + on Set and O = {0, 1}. ◮ Languages of finite or infinite words: Wilke algebra monad T(I, ∅) = (I +, I (up)) on Set{+,ω} and O = ({0, 1}, {0, 1}). ◮ Data languages (D = nominal sets), weighted languages (D = vector spaces), cost functions (D = posets), . . .
50
SLIDE 59 Algebraic Recognition
Definition A language L: TI → O is recognizable if it factorizes through a T-algebra homomorphism e : (TI, µI) → (A, α) with finite codomain. TI
L
A
∃p
- ◮ Languages of finite words: semigroup monad
TI = I + on Set and O = {0, 1}. Recognizable languages = regular languages
51
SLIDE 60 Algebraic Recognition
Definition A language L: TX → O is recognizable if it factorizes through a T-algebra homomorphism e : (TX, µX) → (A, α) with finite codomain. TX
L
A
∃p
- ◮ Languages of finite or infinite words: Wilke algebra monad
T(I, ∅) = (I +, I (up)) on Set{+,ω} and O = ({0, 1}, {0, 1}). Recognizable languages = ∞-regular languages
51
SLIDE 61
Learning T-Recognizable Languages
Idea: To learn an unknown T-recognizable language L: TI → O: 1 Reduce learning L to learning a finite automaton in D. 2 Apply the Generalized Angluin Algorithm.
51
SLIDE 62 Motivation: ω-regular languages
Every language of infinite words L ⊆ I ω determines the language of finite words lasso(L) = { u$v : u ∈ I ∗, v ∈ I +, uvω ∈ L } ⊆ (I ∪ {$})∗. Then L is ω-regular ⇐ ⇒ lasso(L) is regular.
- cf. Farzan, Chen, Clarke, Tsay, Wang 2008
52
SLIDE 63 Automata Presentations
An automata presentation of (TI, µI) is an F-algebra structure FTI
δ
− → TI for some F : D → D such that
- 1. the FI-algebra I + FTI
[ηI ,δ]
− − − → TI is reachable (eTI : µFI → TI in E);
- 2. finite quotient F-algebras of TI ⇐
⇒ finite quotient T-algebras of TI. FTI
Fe δ
TI
e
∃δA
A
TTI
Te µI
TI
e
∃αA
A
Weak automata presentation: Only “⇐ =”. In Applications: Present (TI, µI) as a (sorted) Σ-automaton FQ = Σ × Q
(FQ)t =
Σs,t × Qt
53
SLIDE 64 Automata Presentations
An automata presentation of (TI, µI) is an F-algebra structure FTI
δ
− → TI for some F : D → D such that
- 1. the FI-algebra I + FTI
[ηI ,δ]
− − − → TI is reachable (eTI : µFI → TI in E);
- 2. finite quotient F-algebras of TI ⇐
⇒ finite quotient T-algebras of TI. FTI
Fe δ
TI
e
∃δA
A
TTI
Te µI
TI
e
∃αA
A
Weak automata presentation: Only “⇐ =”. In Applications: Present (TI, µI) as a (sorted) Σ-automaton FQ = Σ × Q
(FQ)t =
Σs,t × Qt
53
SLIDE 65 Example: Semigroups (TI = I + on Set)
Presentation of I + as a Σ-automaton in Set: Σ × I +
Σ×e δ
I +
e
∃δA
A
⇐ ⇒ (I +)+
e+ µI
I +
e
∃αA
A
◮ Σ = {
←
a : a ∈ I} ∪ {
→
a : a ∈ I} ◮ δ: Σ × I + δ − → I +, (
←
a, w) → aw, (
→
a, w) → wa
54
SLIDE 66
Example: Wilke Algebras (T(I, ∅) = (I +, I (up)) on Set{+,ω})
Weak presentation of (I +, I (up)) as a two-sorted Σ-automaton in Set{+,ω}: δ+,+ : Σ+,+ × I + → I + δ+,ω : Σ+,ω × I + → I (up) δω,+ : Σω,+ × I (up) → I + δω,ω : Σω,ω × I (up) → I (up) quotient automata of (I +, I (up)) ⇐ ⇒ quotient algebras of (I +, I (up)).
55
SLIDE 67 Example: Wilke Algebras (T(I, ∅) = (I +, I (up)) on Set{+,ω})
Weak presentation of (I +, I (up)) as a two-sorted Σ-automaton in Set{+,ω}: δ+,+ : Σ+,+ × I + → I +, (
→
a, w) → wa δ+,ω : Σ+,ω × I + → I (up), (ω, w) → wω δω,+ : Σω,+ × I (up) → I +, δω,ω : Σω,ω × I (up) → I (up), (
←
a, z) → az quotient automata of (I +, I (up)) ⇐ ⇒ quotient algebras of (I +, I (up)). Σ+,+ = {
→
a : a ∈ I}, Σ+,ω = {ω}, Σω,+ = ∅, Σω,ω = {
←
a : a ∈ I}
56
SLIDE 68 Example: Wilke Algebras (T(I, ∅) = (I +, I (up)) on Set{+,ω})
Weak presentation of (I +, I (up)) as a two-sorted Σ-automaton in Set{+,ω}: δ+,+ : Σ+,+ × I + → I +, (
→
a, w) → wa δ+,ω : Σ+,ω × I + → I (up), (ω, w) → wω δω,+ : Σω,+ × I (up) → I +, δω,ω : Σω,ω × I (up) → I (up), (
←
a, z) → az quotient automata of (I +, I (up)) ⇐ ⇒ quotient algebras of (I +, I (up)). Σ+,+ = {
→
a : a ∈ I}, Σ+,ω = {ω}, Σω,+ = ∅, Σω,ω = {
←
a : a ∈ I}
57
SLIDE 69 Example: Wilke Algebras (T(I, ∅) = (I +, I (up)) on Set{+,ω})
Weak presentation of (I +, I (up)) as a two-sorted Σ-automaton in Set{+,ω}: δ+,+ : Σ+,+ × I + → I +, (
→
a, w) → wa δ+,ω : Σ+,ω × I + → I (up), (ω, w) → wω δω,+ : Σω,+ × I (up) → I +, δω,ω : Σω,ω × I (up) → I (up), (
←
a, z) → az quotient automata of (I +, I (up)) ⇐ ⇒ quotient algebras of (I +, I (up)). Σ+,+ = {
→
a : a ∈ I}, Σ+,ω = {ω}, Σω,+ = ∅, Σω,ω = {
←
a : a ∈ I}
58
SLIDE 70 Example: Wilke Algebras (T(I, ∅) = (I +, I (up) on Set{+,ω})
Weak presentation of (I +, I (up)) as a two-sorted Σ-automaton in Set{+,ω}: δ+,+ : Σ+,+ × I + → I +, (
→
a, w) → wa δ+,ω : Σ+,ω × I + → I (up), (ω, w) → wω δω,+ : Σω,+ × I (up) → I +, δω,ω : Σω,ω × I (up) → I (up), (
←
a, z) → az quotient automata of (I +, I (up)) ⇐ ⇒ quotient algebras of (I +, I (up)). Σ+,+ = {
→
a : a ∈ I}, Σ+,ω = {ω}, Σω,+ = ∅, Σω,ω = {
←
a : a ∈ I}
59
SLIDE 71 Automata Presentations
Theorem (Urbat, Ad´ amek, Chen, Milius 2017) (Σ-)automata presentations exist for all monads T on SetS. Theorem If (TI, µI) has an automata presentation, then every T-recognizable language L: TI → O admits a syntactic T-algebra Syn(L). TI
L
e
A
O
Syn(L)
pL
SLIDE 72 Motivation: ω-regular languages
Every language of infinite words L ⊆ I ω determines the language of finite words lasso(L) = { u$v : u ∈ I ∗, v ∈ I +, uvω ∈ L } ⊆ (I ∪ {$})∗. Then L is ω-regular ⇐ ⇒ lasso(L) is regular.
- cf. Farzan, Chen, Clarke, Tsay, Wang 2008
61
SLIDE 73
Linearization of a Language
Suppose that (TI, µI) has a weak automata presentation FTI
δ
− → TI. The linearization of a language L: TI → O is given by lin(L) ≡ µFI
eTI TI L
O.
Since eTI ∈ E, the language lin(L) fully represents L!
62
SLIDE 74 Example: Semigroups (TI = I + on Set)
Presentation of I + as a Σ-automaton (F = Σ × (−)) ◮ Σ = {
←
a : a ∈ I} ∪ {
→
a : a ∈ I} ◮ δ: Σ × I + → I +, (
←
a, w) → aw, (
→
a, w) → wa ◮ µFI = I × Σ∗ ◮ eI + : I × Σ∗ → I +, e.g. (d,
←
c
←
b
→
e
←
a) → abcde lin(L) ≡ I × Σ∗
eI+ I + L
2.
L = {. . . , abcde, . . .} ⇒ lin(L) = {. . . , (d,
←
c
←
b
→
e
←
a), . . .}
63
SLIDE 75 Example: Wilke Algebras (T(I, ∅) = (I +, I (up) on Set{+,ω})
Weak presentation of (I +, I (up) as a sorted Σ-automaton ◮ Σ+,+ = {
→
a : a ∈ I}, Σ+,ω = {ω}, Σω,+ = ∅, Σω,ω = {
←
a : a ∈ I} ◮ δ: Σ+,ω × I + → I ω, (ω, w) → wω etc. ◮ µFI = I ⊗ Σ∗ (sorted words over Σ with initial letter from I) ◮ e(I +,I (up)) : I ⊗ Σ∗ → (I +, I (up)), e.g. (a,
→
bω
←
c ) → c(ab)ω lin(L) ≡ I ⊗ Σ∗
e(I+,I(up))
(I +, I (up))
L
2.
L = {. . . , c(ab)ω, . . .} ⇒ lin(L) = {. . . , (a,
→
bω
←
c ), . . .} ≈ lasso(L)
64
SLIDE 76 Linearization of a Language
lin(L) ≡ µFI
eTI TI L
O.
Theorem
δ
− → TI is a weak automata presentation: L: TI → O is T-recognizable = ⇒ lin(L) is regular.
δ
− → TI is an automata presentation: L: TI → O is T-recognizable ⇐ ⇒ lin(L) is regular and Syn(L) ∼ = Min(lin(L)). = ⇒ Learning L reduces to learning a finite automaton for lin(L)!
65
SLIDE 77 Conclusions
Generic learning strategy for a wide variety of languages Learning T-recognizable language L: TI → O
- Learning regular language lin(L): µFI → O
- Generalized Angluin Algorithm based on initial chain/final cochain
- TODO: Implementation, tools, experimental evaluation
- cf. Deifel, Dorsch, Milius, Schr¨
- der, Wißmann: Coalgebraic Partition Refinement, 2017/19
66