towards a coalgebraic chomsky hierarchy
play

Towards a Coalgebraic Chomsky Hierarchy Sergey Goncharov , Stefan - PowerPoint PPT Presentation

Towards a Coalgebraic Chomsky Hierarchy Sergey Goncharov , Stefan Milius, Alexandra Silva CMCS 2014, Grenoble, 6.04.2014 Short Histrory of Coalgebraic Invasion to Automata Theory Deterministic automata as coalgebras [Rutten, 1998] .


  1. Towards a Coalgebraic Chomsky Hierarchy Sergey Goncharov , Stefan Milius, Alexandra Silva CMCS 2014, Grenoble, 6.04.2014

  2. Short Histrory of Coalgebraic Invasion to Automata Theory • Deterministic automata as coalgebras [Rutten, 1998] . • Generalized regular expressions and Kleene’s theorem for (Kripke-)polynomial functors [Silva, 2010] . • Generalized powerset construction [Silva et al., 2010] . • Regular expressions for equationally presented functors and monads [Myers, 2013] . • Context-free languages, coalgebraically [Winter et al., 2013] . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 2

  3. Base Case: Moore Automata Moore automaton with input alphabet A and output alphabet B is given by t m : X × A → X o m : X → B (transition) and (output) Thus, a Moore automaton is a coalgebra m : X → B × X A on Set . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 3

  4. We shall assume finite Base Case: Moore Automata Moore automaton with input alphabet A and output alphabet B is given by t m : X × A → X o m : X → B (transition) and (output) Thus, a Moore automaton is a coalgebra m : X → B × X A on Set . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 3

  5. We shall assume finite Base Case: Moore Automata Moore automaton with input alphabet A and output alphabet B is given by t m : X × A → X o m : X → B (transition) and (output) Thus, a Moore automaton is a coalgebra m : X → B × X A on Set . A final L A , B -coalgebra is carried by the set B A ∗ of formal power series on B with coalgebra structure � o , t � : B A ∗ → B × ( B A ∗ ) A o ( σ : A ∗ → B ) = σ ( ε ) t ( σ : A ∗ → B , a ) = λ w .σ ( a · w ) . and CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 3

  6. L A , B X := B × X A We shall assume finite Base Case: Moore Automata Moore automaton with input alphabet A and output alphabet B is given by t m : X × A → X o m : X → B (transition) and (output) Thus, a Moore automaton is a coalgebra m : X → B × X A on Set . A final L A , B -coalgebra is carried by the set B A ∗ of formal power series on B with coalgebra structure � o , t � : B A ∗ → B × ( B A ∗ ) A o ( σ : A ∗ → B ) = σ ( ε ) t ( σ : A ∗ → B , a ) = λ w .σ ( a · w ) . and CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 3

  7. L A , B X := B × X A We shall assume finite Base Case: Moore Automata Moore automaton with input alphabet A and output alphabet B is given by t m : X × A → X o m : X → B (transition) and (output) Thus, a Moore automaton is a coalgebra m : X → B × X A on Set . A final L A , B -coalgebra is carried by the set B A ∗ of formal power series on B with coalgebra structure � o , t � : B A ∗ → B × ( B A ∗ ) A o ( σ : A ∗ → B ) = σ ( ε ) t ( σ : A ∗ → B , a ) = λ w .σ ( a · w ) . and Derivatives: given w ∈ A ∗ , ∂ ε ( σ ) = σ ∂ a · w ( σ ) = t ( ∂ w ( σ ) , a ) and If B = 2 then B A ∗ ≃ P ( A ∗ ) is the set of all formal languages over A . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 3

  8. � � Rationality of Formal Power Series By the the universal property of the final coalgebra for any m : X → B × X A there exists a unique L A , B -coalgebra homomorphism � m such that: � � B A ∗ m X ι m � B × ( B A ∗ ) A B × X A id × � m A Given x ∈ X , � x � m := � m ( x ) is the “language” recognized by m at x . A formal power series σ : A ∗ → B is rational if { ∂ w ( σ ) | w ∈ A ∗ } is finite. Theorem. A formal power series σ is rational iff σ = � x � � m for some m : X → B × X A and x ∈ X . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 4

  9. � � � � Generalized Powerset Construction and T -automata Definition: Let T be a monad. A T -automaton is a triple of maps o m : X → B , t m : X × A → TX , a m : TB → B where a m is a T -algebra. Essentially, a T -automaton is a coalgebra m : X → B × ( TX ) A . η m ♯ � B A ∗ X TX � ������������������ ι m m ♯ m ♯ ) A id × ( � � B × ( B A ∗ ) A B × ( TX ) A Factorization m = m ♯ η is unique and we put � x � m = � η ( x ) � m ♯ . Theorem: If B is finite then � x � m is rational. CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 5

  10. � � � � Generalized Powerset Construction and T -automata Definition: Let T be a monad. A T -automaton is a triple of maps o m : X → B , t m : X × A → TX , a m : TB → B where a m is a T -algebra. Essentially, a T -automaton is a coalgebra m : X → B × ( TX ) A . η m ♯ � P A ∗ P X X � ������������������ ι m m ♯ m ♯ ) A id × ( � � 2 × ( P A ∗ ) A 2 × ( P X ) A Factorization m = m ♯ η is unique and we put � x � m = � η ( x ) � m ♯ . Theorem: If B is finite then � x � m is rational. CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 5

  11. Monads as Theories An algebraic theory is given by a signature Σ and a set of equations. Any algebraic theory E defines a monad: • T E X = ‘set of Σ -terms over X modulo E ’; • η coerces a variable to a term; • σ ∗ ( t ) applies substitution σ : X → T E Y to p : T E X . Example: Finite powerset monad P ω ⇐ ⇒ join semilattices with bottom. Example: Finite store monad TX = ( X × S ) S ⇐ ⇒ finite mnemoids ( lookup l : X v → X , update l , v : X → X where S ∼ = L → V ). CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 6

  12. Expressions for T -automata (by Example) B = {⊤ , ⊥} a a T = P ω b b q 0 q 1 q 2 start b   e 0 = a . e 0 ⋔ b . e 1 ⋔ ⊥  e 1 = a . ∅ ⋔ b . ( e 0 + e 2 ) ⋔ ⊥   e 2 = a . e 0 ⋔ b . ∅ ⋔ ⊤ Equivalently, e 0 = µ x . ( a . x ⋔ b .µ y . ( a . ∅ ⋔ b . ( x + µ z . ( a . x ⋔ b . ∅ ⋔ ⊤ )) ⋔ ⊥ ) ⋔ ⊥ ) . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 7

  13. Stack T -automata Stack monad is a submonad of the store monad Γ ∗ → ( X × Γ ∗ ) : � r , t � : Γ ∗ → ( X × Γ ∗ ) is in TX iff r ( u · w ) = r ( u ) t ( u · w ) = t ( u ) · w whenever | u | > k for some k . Stack theory is given by pop : X n + 1 → X and push i : X → X ( i ≤ n ): push i ( pop ( x 1 , . . . , x n , y )) = x i pop ( push 1 ( x ) , . . . , push n ( x ) , x ) = x pop ( x 1 , . . . , x n , pop ( y 1 , . . . , y n , z )) = pop ( x 1 , . . . , x n , z ) Stack T -automaton is a T -automaton m : X → B (Γ) × ( TX ) A where B (Γ) are predicates over Γ ∗ such that p ∈ B (Γ) iff p ( u · w ) ⇐ ⇒ p ( u ) once | u | > k with some k . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 8

  14. Stack T -automata Γ = { γ 1 , . . . , γ n } is stack alphabet Stack monad is a submonad of the store monad Γ ∗ → ( X × Γ ∗ ) : � r , t � : Γ ∗ → ( X × Γ ∗ ) is in TX iff r ( u · w ) = r ( u ) t ( u · w ) = t ( u ) · w whenever | u | > k for some k . Stack theory is given by pop : X n + 1 → X and push i : X → X ( i ≤ n ): push i ( pop ( x 1 , . . . , x n , y )) = x i pop ( push 1 ( x ) , . . . , push n ( x ) , x ) = x pop ( x 1 , . . . , x n , pop ( y 1 , . . . , y n , z )) = pop ( x 1 , . . . , x n , z ) Stack T -automaton is a T -automaton m : X → B (Γ) × ( TX ) A where B (Γ) are predicates over Γ ∗ such that p ∈ B (Γ) iff p ( u · w ) ⇐ ⇒ p ( u ) once | u | > k with some k . CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 8

  15. T -automata and Context-free Languages Theorem. If m is a stack T -automaton then for any x ∈ X and any s ∈ Γ ∗ , � � w ∈ A ∗ | � x � m ( w )( s ) is a deterministic real-time CFL; and conversely: any deterministic real-time CFL can be obtained in this way. Example: Expression µ x . ( a . push ( x ) ⋔ b . pop ( x , ⊤ ) ⋔ ⊥ ) corresponds to context-free grammar: X → aXX , X → b . Further results: • Nondeterministic stack T -automata capture CFL; • Nondeterministic ( m > 2 ) -stack T -automata capture NTIME. CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 9

  16. Tape Monad Tape monad is a submonad of the store monad Z × Γ Z → ( X × Z × Γ Z ) : � r , z , t � : Z × Γ Z → ( X × Z × Γ Z ) is in TX iff there is k such that for any i , j , σ, σ ′ if σ = i ± k σ ′ then t ( i , σ ) = i ± k σ, t ( i , σ ) = i ± k t ( i , σ ′ ) , t ( i , σ + j ) = t ( i + j , σ ) + j , z ( i , σ ) = z ( i , σ ′ ) , z ( i , σ + j ) = z ( i + j , σ ) − j , | z ( i , σ ) − i | ≤ k , r ( i , σ ) = r ( i , σ ′ ) , r ( i , σ + j ) = r ( i + j , σ ) . where σ + j ( i ) = σ ( i + j ) ; σ = i ± k σ ′ iff σ ( j ) = σ ′ ( j ) for all j such that | i − j | ≤ k ; σ = i ± k σ ′ iff σ ( j ) = σ ′ ( j ) for all j such that | i − j | > k . Tape theory is given over signature of operations: read : n → 1, write i : n → 1 (1 ≤ i ≤ n ), lmove : 1 → 1, rmove : 1 → 1. Theorem: Tape theory is not finitely axiomatizable. CMCS 2014, Grenoble, 6.04.2014 | Sergey Goncharov , Stefan Milius, Alexandra Silva | 10

Recommend


More recommend