Tree Automata as Algebras: Minimisation and Determinisation Tobias - - PowerPoint PPT Presentation

tree automata as algebras minimisation and determinisation
SMART_READER_LITE
LIVE PREVIEW

Tree Automata as Algebras: Minimisation and Determinisation Tobias - - PowerPoint PPT Presentation

Tree Automata as Algebras: Minimisation and Determinisation Tobias Kapp e Jurriaan Rot Gerco van Heerdt Matteo Sammartino Alexandra Silva University College London June 3, 2019 1 / 17 DFAs: nice diagrams a b b a a b 2 / 17 Tree


slide-1
SLIDE 1

Tree Automata as Algebras: Minimisation and Determinisation

Gerco van Heerdt Tobias Kapp´ e Jurriaan Rot Matteo Sammartino Alexandra Silva

University College London

June 3, 2019

1 / 17

slide-2
SLIDE 2

DFAs: nice diagrams

a b a a b b

2 / 17

slide-3
SLIDE 3

Tree automata: no nice diagrams

Transitions originate from multiple states Automaton reads trees rather than words Alphabet Γ with arities ar: Γ → N Sets I, O Tree automaton (Q, {δγ}γ∈Γ, i, o) ◮ transitions δγ : Qar(γ) → Q ◮ initial states i : I → Q ◮ output o : Q → O DFAs: every γ has arity 1

3 / 17

slide-4
SLIDE 4

Tree automata: no nice diagrams :(

Transitions originate from multiple states Automaton reads trees rather than words Alphabet Γ with arities ar: Γ → N Sets I, O Tree automaton (Q, {δγ}γ∈Γ, i, o) ◮ transitions δγ : Qar(γ) → Q ◮ initial states i : I → Q ◮ output o : Q → O DFAs: every γ has arity 1

3 / 17

slide-5
SLIDE 5

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1}

4 / 17

slide-6
SLIDE 6

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1

4 / 17

slide-7
SLIDE 7

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-8
SLIDE 8

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-9
SLIDE 9

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-10
SLIDE 10

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-11
SLIDE 11

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-12
SLIDE 12

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-13
SLIDE 13

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-14
SLIDE 14

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-15
SLIDE 15

Example

I = {a, b} Γ = {•}, ar(•) = 2 O = {0, 1} Q = {qa, qb, q1, q⊥} i(a) = qa i(b) = qb δ•(qa, qb) = q1 δ•(qa, q1) = qa δ•(q1, qb) = qb δ•(−) = q⊥

  • (qa) = o(qb) = o(q⊥) = 0
  • (q1) = 1
  • q1

a qa qa qa

  • qb
  • q1

b qb qb qb a qa qa b qb qb

4 / 17

slide-16
SLIDE 16

Tree automata as functor algebras

Tree automata over Γ can be seen as algebras for signature endofunctor ΣX =

  • γ∈Γ

X ar(γ) (together with initial states and output) Free Σ-algebra with generators X written Σ⋄X ◮ trees over the signature with additional X constants Σ⋄ forms a monad

5 / 17

slide-17
SLIDE 17

Tree language

Given: tree automaton (Q, δ, i, o), δ: ΣQ → Q I

i

− → Q extends to reachability map Σ⋄I

reach

− − − → Q Accepted language is LQ = Σ⋄I

reach

− − − → Q o − → O In general, a language is a morphism Σ⋄I → O

6 / 17

slide-18
SLIDE 18

Minimality of DFAs: nice diagram

A∗ × A Q × A 2A∗ × A A∗ Q 2A∗ 1 2

c δ ∂ reach

  • bs

ε? i ε

Reachable: reach surjective Observable: obs injective Minimal: reachable + observable

7 / 17

slide-19
SLIDE 19

Minimality of tree automata: no nice diagram

Reachable: Σ⋄I

reach

− − − → Q surjective Minimal: final among automata that ◮ are reachable and ◮ accept the same language Minimisation of an automaton: final quotient automaton Q Q′ Q′′

q q′ u

Minimisations of reachable automata are minimal

8 / 17

slide-20
SLIDE 20

Minimality of tree automata: no nice diagram :(

Reachable: Σ⋄I

reach

− − − → Q surjective Minimal: final among automata that ◮ are reachable and ◮ accept the same language Minimisation of an automaton: final quotient automaton Q Q′ Q′′

q q′ u

Minimisations of reachable automata are minimal

8 / 17

slide-21
SLIDE 21

Minimisation via cobase

Automaton (Q, δ, i, o) Complete lattice on quotients c ≤ c′ ⇐ ⇒ C Q C′

∃f c c′

Minimisation: gfp of monotone operator involving cobase ΣQ Q C ΣC′

δ Σc′ Σc′ Σd c ∃g Σu ∃h

9 / 17

slide-22
SLIDE 22

Minimisation via cobase

Automaton (Q, δ, i, o) Complete lattice on quotients c ≤ c′ ⇐ ⇒ C Q C′

∃f c c′

Minimisation: gfp of monotone operator involving cobase ΣQ Q C ΣC′ ΣD

δ Σc′ Σc′ Σd c ∃g Σu ∃h

9 / 17

slide-23
SLIDE 23

DFAs as monad algebras

Q × A δ − → Q extends to Q × A∗ δ∗ − → Q δ∗ monoid action = ⇒ bijective correspondence algebra for monad (−) × A∗ Unit X → X × A∗ by empty word Multiplication X × A∗ × A∗ → X × A∗ by concatenation

10 / 17

slide-24
SLIDE 24

Automata based on monad algebras

Given objects I and O and a monad T, we can define automata TQ Q I O

δ

  • i

where δ is a T-algebra Reachability map: TI

i♯

− → Q Language: TI

i♯

− → Q o − → O

11 / 17

slide-25
SLIDE 25

Automata based on monad algebras

DFA case: Q × A∗ Q 1 2

δ

  • i

where δ is a monoid action Reachability map: 1 × A∗ i♯ − → Q Language: 1 × A∗ i♯ − → Q o − → 2

11 / 17

slide-26
SLIDE 26

Nerode equivalence: classic

Used to find minimal automaton Given language L: A∗ → 2, R = {(u, v) ∈ A∗ × A∗ | ∀w ∈ A∗. L(uw) = L(vw)} Largest relation making this diagram commute: R × A∗ A∗ × A∗ A∗ A∗ × A∗ A∗ 2

p2×id p1×id concat L concat L

12 / 17

slide-27
SLIDE 27

Nerode equivalence: classic

Used to find minimal automaton Given language L: A∗ → 2, R = {(u, v) ∈ A∗ × A∗ | ∀w ∈ A∗. L(uw) = L(vw)} Largest relation making this diagram commute: R × A∗ 1 × A∗ × A∗ 1 × A∗ 1 × A∗ × A∗ 1 × A∗ 2

p2×id p1×id µ L µ L

12 / 17

slide-28
SLIDE 28

Nerode equivalence: abstract

∃R, p1, p2 s.t. TR TTI TI TTI TI O

Tp2 Tp1 µ L µ L

and if ∃S, q1, q2 s.t. TS TTI TI TTI TI O

Tq2 Tq1 µ L µ L

then S TI R TI

q1 u q2 p1 p2

Theorem: Nerode equivalence ⇐ ⇒ minimal automaton

13 / 17

slide-29
SLIDE 29

Nerode equivalence: syntactic congruence

I = A, T = (−)∗, µX : (X ∗)∗ → X ∗ flattens Given L: A∗ → 2, R instantiates to the largest relation s.t. (u1, v1), . . . , (un, vn) ∈ R L(u1 · · · un) = L(v1 · · · vn)

  • r equivalently (syntactic congruence)

(u, v) ∈ R w, x ∈ A∗ L(wux) = L(wvx) Minimal automaton: syntactic monoid

14 / 17

slide-30
SLIDE 30

Nerode equivalence in Set

Exists for any finitary monad ◮ Equivalence under contexts T(I + 1) ◮ Element of 1 is a hole where trees can be plugged in

15 / 17

slide-31
SLIDE 31

Plans: learning

Tree automata learning algorithms exist ◮ But not modulo equations ◮ Pomset automata Axiomatisation of semantic object

16 / 17

slide-32
SLIDE 32

Further paper overview

Nominal tree automata ◮ Abstraction ◮ Parse trees for λ-terms Relations between notions of minimality ◮ Minimal, minimisation, simple Determinisation (lifting Kleisli adjunction) ◮ Nondeterministic (nominal) tree automata ◮ Multiplicity/weighted tree automata

17 / 17