automata learning an algebraic approach
play

Automata Learning: An Algebraic Approach Henning Urbat joint work - PowerPoint PPT Presentation

Automata Learning: An Algebraic Approach Henning Urbat joint work with Lutz Schr oder Oberseminar October 22, 2019 Automata Learning Black Box System Formal Model s 0 learn ejectGrog insertCoin s 1


  1. Automata Learning: An Algebraic Approach Henning Urbat – joint work with Lutz Schr¨ oder – Oberseminar October 22, 2019

  2. � � Automata Learning Black Box System Formal Model � s 0 learn ejectGrog insertCoin � s 1 � Hypothesis � � Tests � Hypothesis � ··· Hypothesis � Tests 2

  3. � Automata Learning Black Box System Formal Model ◮ Finite automaton ◮ Weighted automaton learn ◮ B¨ uchi automaton ◮ Register automaton ◮ · · · � �� � (Co-)Algebra 2

  4. � Automata Learning Black Box System Formal Model ◮ Finite automaton ◮ Weighted automaton learn ◮ B¨ uchi automaton ◮ Register automaton ◮ · · · � �� � (Co-)Algebra 2

  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. cf. Boja´ 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

  6. Automata Learning: Categorical View Part I Learning Automata in a Category 4

  7. � � � Categorical Automata Fix a complete and cocomplete category D with ( E , M )-factorizations and F � D D ⊥ G An ( F -)automaton is given by the data FQ δ Q i Q f Q � Q � O I δ @ Q GQ 5

  8. � � � Classical Deterministic Automata Σ × ( − ) � Set Set ⊥ [Σ , − ] Σ × Q δ Q i Q f Q � Q � 2 1 δ @ Q [Σ , Q ] 6

  9. � � � Sorted Deterministic Automata F � Set S Set S ⊥ G � � where Σ = (Σ s , t ) s , t , ( FQ ) t = Σ s , t × Q s , ( GQ ) t = [Σ t , s , Q s ] s s � s Σ s , t × Q s δ Q , t i Q , t f Q , t � Q t � 2 1 δ @ Q , t � s [Σ t , s , Q s ] 7

  10. � � � Linear Weighted Automata Σ ⊗ ( − ) � K − Vect K − Vect ⊥ [Σ , − ] Σ ⊗ Q δ Q i Q f Q � Q � K K δ @ Q [Σ , Q ] 8

  11. � � � Semilattice Automata (a.k.a. Nondeterministic Automata) Σ ⊗ ( − ) � SLat SLat ⊥ [Σ , − ] Σ ⊗ Q δ Q i Q f Q � Q � 2 2 δ @ Q [Σ , Q ] Ad´ amek, Milius, Myers, Urbat: Canonical Nondeterministic Automata, 2014 Denis, Lemay, Terlutte: Residual Finite State Automata, 2001 9

  12. � � � Nominal Automata [Boja´ nczyk, Klin, Lasota 2013] A × ( − ) � Nom Nom ⊥ [ A , − ] A × Q δ Q i Q f Q � Q � 2 1 δ @ Q [ A , Q ] 10

  13. � � � Nominal Automata with Name Binding [Kozen et al. 2015] A × ( − ) + A ∗ ( − ) � Nom Nom ⊥ [ A , − ] × [ A ]( − ) A × Q + A ∗ Q δ Q i Q f Q � Q � 2 1 δ @ Q [ A , Q ] × [ A ] Q 11

  14. � � � Nominal Automata with Two-Sided Name Binding A × ( − ) + A ∗ ( − ) + [ A ]( − ) � Nom Nom ⊥ [ A , − ] × [ A ]( − ) × R A × Q + A ∗ Q + [ A ] Q δ Q i Q f Q � Q � 2 1 δ @ Q [ A , Q ] × [ A ] Q × RQ cf. Gabbay, Ghica, Petri¸ san: Leaving the Nest, 2015 12

  15. � � � Categorical Automata Fix a complete and cocomplete category D with ( E , M )-factorizations and F � D D ⊥ G An ( F -)automaton is given by the data FQ δ Q i Q f Q � Q � O I δ @ Q GQ 13

  16. � Language Semantics F � D D + I , O ∈ D ⊥ G Initial algebra for F I = I + F : F 2 I ¡ ¡ F I ¡ → F 2 µ F I = colim( 0 − → F I 0 − − I 0 − − → · · · ) Final coalgebra for G O = O × G : G 2 O ! G O ! ! − G 2 ← − G O 1 ← − ← − − · · · ) ν G O = lim( 1 O 1 A language is a morphism L : µ F I → O . The accepted language of an automaton Q is defined by e Q f Q � Q � O ) . L Q = ( µ F I 14

  17. � Language Semantics: Classical Automata Σ × ( − ) � Set Set + I = 1 , O = 2 ⊥ [Σ , − ] Initial algebra for F I = 1 + Σ × ( − ): Σ ∗ = colim( Σ < 0 ֌ Σ < 1 ֌ Σ < 2 ֌ · · · ) Final coalgebra for G O = 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 L Q = ( Σ ∗ e Q f Q − → Q − → 2 ) . 15

  18. � � � � � � Minimal Automata An automaton Q is minimal if it is ◮ reachable: the unique F I -algebra morphism e Q : µ F I → Q lies in E ; ◮ simple: the unique G O -coalgebra morphism m Q : Q → ν G O lies in M . Theorem (cf. Arbib, Manes 1975) For every language L : µ F I → O there exists a unique minimal automaton Min( L ) accepting L. µ F I e Q e Min( L ) Q (acc. L ) m m Q ν G O 16

  19. � � Angluin’s Algorithm: Overview Goal: Given an unknown finite automaton Σ × Q δ Q i Q f Q � Q � 2 1 δ @ Q [Σ , Q ] learn an automaton equivalent to Q by asking questions to a teacher: ◮ Membership queries. Given w ∈ Σ ∗ , is w ∈ L Q ? ◮ Equivalence queries. Given an automaton H , is L H = L Q ? If not, teacher delivers a counterexample w ∈ L H ⊕ L Q . 17

  20. � � � � � � � � � � Angluin’s Algorithm: Overview � Σ < 1 � � · · · � Σ < n +1 � � · · · Σ < 0 � Σ < n � Σ ∗ e Q Q m Q [Σ < 0 , 2] [Σ < 1 , 2] [Σ < k +1 , 2] [Σ ∗ , 2] [Σ < k , 2] · · · · · · m Q ◦ e Q : v �→ λ w . L Q ( vw ) (“Hankel matrix”) 18

  21. � � �� � � � � � � � � � � Angluin’s Algorithm: Overview � · · · � · · · � Σ < 1 � � Σ < n +1 � Σ < 0 � Σ < n � Σ ∗ S e Q Q [ T , 2] m Q [Σ < 0 , 2] [Σ < 1 , 2] [Σ < k +1 , 2] [Σ ∗ , 2] [Σ < k , 2] · · · · · · S ⊆ Σ < n , T ⊆ Σ < k 19

  22. �� � � � � � � � � � � � � � Angluin’s Algorithm: Overview � · · · � · · · � Σ < 1 � � Σ < n +1 � Σ < 0 � Σ < n � Σ ∗ S e Q Q h S , T [ T , 2] m Q [Σ < 0 , 2] [Σ < 1 , 2] [Σ < k +1 , 2] [Σ ∗ , 2] [Σ < k , 2] · · · · · · h S , T : s �→ λ t . L Q ( st ) (“Observation table”) 20

  23. � � � � � � � � � � � � �� � �� � � Angluin’s Algorithm: Overview � · · · � · · · � Σ < 1 � � Σ < n +1 � Σ < 0 � Σ < n � Σ ∗ S e Q e S , T H S , T Q h S , T m S , T [ T , 2] m Q [Σ < 0 , 2] [Σ < 1 , 2] [Σ < k , 2] [Σ < k +1 , 2] [Σ ∗ , 2] · · · · · · Idea: Define automata structure on H S , T that approximates Q . Requires the pair ( S , T ) to be closed and consistent! 21

  24. � � � � � � � � � � � � �� � �� � � Angluin’s Algorithm: Overview � · · · � · · · � Σ < 1 � � Σ < n +1 � Σ < 0 � Σ < n � Σ ∗ S e Q e S , T H S , T Q h S , T m S , T [ T , 2] m Q [Σ < 0 , 2] [Σ < 1 , 2] [Σ < k , 2] [Σ < k +1 , 2] [Σ ∗ , 2] · · · · · · Idea: Define automata structure on H S , T that approximates Q . Requires the pair ( S , T ) to be closed and consistent! 21

  25. Angluin’s Algorithm: Closed Pairs The pair ( S , T ) is closed if for s ∈ S and a ∈ Σ there exists s ′ ∈ S with h S ∪ S Σ , T ( sa ) = h S , T ( s ′ ) . 22

  26. � � � � � � � � � � � � �� � � � � �� � � � � � Angluin’s Algorithm: Closed Pairs � · · · � · · · � Σ < 1 � � Σ < n +1 � Σ < 0 � Σ < n � Σ ∗ S ∪ S Σ S � e Q e S , T �� e S ∪ S Σ , T H S , T H S ∪ S Σ , T Q h S , T h S ∪ S Σ , T m S , T m S ∪ S Σ , T [ T , 2] [ T , 2] m Q [Σ < 0 , 2] [Σ < 1 , 2] [Σ < k , 2] [Σ < k +1 , 2] [Σ ∗ , 2] · · · · · · 23

  27. � � � �� � � � � � � � � � � �� � � � � � � � � � Angluin’s Algorithm: Closed Pairs � · · · � · · · � Σ < 1 � � Σ < n +1 � Σ < 0 � Σ < n � Σ ∗ S ∪ S Σ S � e Q e S , T �� e S ∪ S Σ , T H S , T � H S ∪ S Σ , T Q h S , T h S ∪ S Σ , T m S , T m S ∪ S Σ , T [ T , 2] [ T , 2] m Q [Σ < 0 , 2] [Σ < 1 , 2] [Σ < k , 2] [Σ < k +1 , 2] [Σ ∗ , 2] · · · · · · 24

  28. Angluin’s Algorithm: Closed Pairs The pair ( S , T ) is closed if for s ∈ S and a ∈ Σ there exists s ′ ∈ S with h S ∪ S Σ , T ( sa ) = h S , T ( s ′ ) . Equivalently: H S , T ֌ H S ∪ 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 , h S ∪ S Σ , T ( sa ) � = h S , T ( s ′ ) . 2. Add the word sa to S . 25

  29. Angluin’s Algorithm: Closed Pairs The pair ( S , T ) is closed if for s ∈ S and a ∈ Σ there exists s ′ ∈ S with h S ∪ S Σ , T ( sa ) = h S , T ( s ′ ) . Equivalently: H S , T ֌ H S ∪ 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 , h S ∪ S Σ , T ( sa ) � = h S , T ( s ′ ) . 2. Add the word sa to S . 25

  30. Angluin’s Algorithm: Consistent Pairs The pair ( S , T ) is consistent if h S , T ( s ) = h S , T ( s ′ ) implies h S , T ∪ Σ T ( s ) = h S , T ∪ Σ T ( s ) . 26

Recommend


More recommend