Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Coinduction in concurrent timed systems Jan Komenda Institute of Mathematics, Czech Academy of Sciences, Brno, Czech Republic 10th Workskop on Coalgebraic Methods in Computer Science (CMCS’10) Paphos, Cyprus, March 28, 2010 1 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Outline Mealy and weighted automata as coalgebras 1 Functional stream calculus 2 (max,+)-automata and timed automata 3 (max,+)-automata algebraically (max,+)- automata as coalgebras Synchronous composition 4 Algebraic definition Coinductive definition Product Interval Automata 5 Conclusion 6 2 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Outline Mealy and weighted automata as coalgebras 1 Functional stream calculus 2 (max,+)-automata and timed automata 3 (max,+)-automata algebraically (max,+)- automata as coalgebras Synchronous composition 4 Algebraic definition Coinductive definition Product Interval Automata 5 Conclusion 6 3 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Coalgebra and automata theory Labelled transition systems (incl. timed) are coalgebras Various automata are coalgebras of suitable set functors Weighted automata (automata with multiplicities) are coalgebras Deterministic automata have simple final coalgebras: e.g. languages, formal power series (Moore automata) 2 ways of coding concurrency using weighted automata : nondeterminism (heap automata) and synchronous composition (like timed automata) Classes of timed automata (product interval automata) and corresponding classes of Petri nets Behaviors of synchronous compositions 4 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Deterministic K-weighted automata as coalgebras Mealy automata (inputs in A , outputs in K ) are coalgebras ( S , t ) , S set of states, t : S → ( K × S ) A transition function. A partial MA is ( S , t ) , where t : S → ( 1 + ( K × S )) A with 1 = {∅} . Partial Mealy automata are deterministic K-weighted automata with all states final A deterministic K-weighted automaton is viewed as partial Mealy automaton ( S , t ) above. Examples of multiplicity semirings : K = R min = ( R ∪ {∞} , min , + , ∞ , 0 ) . . . (min,+)-automata (price) R max = ( R ∪ {−∞} , max , + , −∞ , 0 ) . . . (max,+)-automata (time) K = I max max = ( R max × R max ∪ ( −∞ , −∞ ) , ⊕ , ⊗ , ( −∞ , −∞ ) , ( 0 , 0 )) . . . interval automaton ( R + , + , × , 0 , 1 ) . . . stochastic automata (probability semiring) 5 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Outline Mealy and weighted automata as coalgebras 1 Functional stream calculus 2 (max,+)-automata and timed automata 3 (max,+)-automata algebraically (max,+)- automata as coalgebras Synchronous composition 4 Algebraic definition Coinductive definition Product Interval Automata 5 Conclusion 6 6 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Stream coalgebra Streams are infinite sequences over a set, e.g. a semiring K = ( K , ⊕ , ⊗ , 0 , 1 ) . ( K ω , � head , tail � ) is the final coalgebra of F ( S ) = K × S . Definition. For s = ( s ( 0 ) , s ( 1 ) , s ( 2 ) , s ( 3 ) , . . . ) ∈ K ω : head ( s ) = s ( 0 ) and tail ( s ) = s ′ = ( s ( 1 ) , s ( 2 ) , s ( 3 ) , . . . ) . Other notation: [ r ] = ( r , 0 , 0 , . . . ) . . . constant stream for r ∈ K . X = ( 0 , 1 , 0 , . . . ) . . . important to describe any stream 7 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Final Mealy automaton Behaviors of Mealy automata are causal stream functions f : A ω → K ω . f : A ω → K ω is causal if ∀ n ∈ N , σ, τ ∈ A ∞ : ∀ i : i ≤ n : σ ( i ) = τ ( i ) then f ( σ )( n ) = f ( τ )( n ) . Stream derivatives: ω = ( ω 0 , ω 1 , . . . ) ∈ K ω , ω → ω ′ = ( ω 1 , . . . ) . Stream functions form final coalgebra of Mealy automata with t ( f ) = � f [ a ] , f a � f [ a ] = f ( a : σ )( 0 ) and f a ( σ ) = f ( a : σ ) ′ For partial Mealy automata consider f : A ω → ( 1 + K ) ω f is consistent if σ ∈ A ω : f ( σ )( k ) = ∅ then f ( σ )( n ) = ∅ for any n > k . F = ( F , t F ) is the final coalgebra of partial Mealy automata: F = { f : A ω → ( 1 + K ) ω | f is causal and consistent } . � � f [ a ] , f a � if f [ a ] � = ∅ ∈ 1 , t F ( f )( a ) = ∅ otherwise , 8 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Equivalent presentation of behaviors σ ( 0 ) | k 0 σ ( 1 ) | k 1 σ ( n ) | k n s 0 → s 1 → s 2 · · · → s n + 1 . We define l ( s 0 )( σ )( n ) = k n . A ∞ = A ω ∪ A + , where A + = A ∗ \ { λ } F is isomorphic to functions between finite and infinite sequences! F ∞ = { f : A ∞ → K ∞ | f length preserving, causal, dom ( f ) prefix-closed } f [ a ] = f ( a )( 0 ) whenever f is defined for a ∈ A . f a : A ∞ → ( 1 + K ) ∞ given by f a ( s ) = f ( a : s ) ′ � � f [ a ] , f a � if f [ a ] is defined t F ∞ ( f )( a ) = undefined otherwise , 9 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Fundamental theorem of stream functionals Fundamental theorem of stream calculus: σ = σ ( 0 ) ⊕ X σ ′ ( 0 ) ⊕ X 2 σ ′′ ( 0 ) ⊕ . . . has its stream functional counterpart: Theorem. For any f ∈ F and σ = ( σ ( 0 ) , σ ( 1 ) , . . . , σ ( k ) , . . . ) ∈ A ω we have: f ( σ ) = f ( σ )( 0 ) ⊕ Xf σ ( 0 ) ( σ ′ )( 0 ) ⊕ . . . X k f σ ( 0 ) ...,σ ( k − 1 ) ( ω ( k ) )( 0 ) ⊕ . . . or equivalently, f ( σ ) = f [ σ ( 0 )] ⊕ Xf σ ( 0 ) [ σ ( 1 )] ⊕ . . . X k f σ ( 0 ) ...,σ ( k − 1 ) [ σ ( k )] ⊕ . . . Proposition. For any f ∈ F ∞ , ω ∈ A ∞ , and a ∈ A : f ( a ) : f a ( ω ) = f ( a ω ) . 1 More generally, for any u ∈ A + and ω ∈ A ∞ : f ( u ) : f u ( ω ) = f ( u ω ) . 2 10 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Properties of stream functionals Initial output is a particular partial stream functional defined by � f [ a ] if σ = a , f ∞ [ a ]( σ ) = undefined otherwise: σ � = a , Definition. For f , g ∈ F ∞ , σ = ( σ ( 0 ) : σ ′ ) ∈ A ∞ , and a ∈ A we define � f ( σ ( 0 )) : g ( σ ′ ) if a = σ ( 0 ) ∈ dom ( f ) , ( f ∞ [ a ] ⊙ g )( σ ( 0 ) : σ ′ ) = undefined otherwise , a ∈ A f ∞ [ a ] ⊙ f a . Theorem 1. For any f ∈ F ∞ we have: f = � Theorem 2. For any f ∈ F ∞ and a ∈ A : ( f ∞ [ a ] ⊙ f ) a = f 11 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc Outline Mealy and weighted automata as coalgebras 1 Functional stream calculus 2 (max,+)-automata and timed automata 3 (max,+)-automata algebraically (max,+)- automata as coalgebras Synchronous composition 4 Algebraic definition Coinductive definition Product Interval Automata 5 Conclusion 6 12 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc (max,+)-automata algebraically (max,+)- automata (max,+) automata are G = ( Q , α, t , β ) , where Q is a finite set of states, α : Q → R max , t : Q × A × Q → R max , and β : Q → R max , called initial, transition, and final delays. Also: G = ( Q , A , q 0 , Q m , t ) , where A set of discrete events, q 0 initial state, Q m subset of final or marked states, t : Q × A × Q → R max transition function Meaning: output value t ( q , a , q ′ ) ∈ R max corresponds to the duration of a − transition from q to q ′ and t ( q , a , q ′ ) = ε if there is no transition from q to q ′ labeled by a . 13 / 43
Mealy and weighted automata as coalgebras Functional stream calculus (max,+)-automata and timed automata Synchronous composition Produc (max,+)-automata algebraically Algebraic behaviors of (max,+)- automata Formal power series with variables in A and coefficients in R max . R max ( A ) isomorphic to { ω : A ∗ → R max } . Behavior of G = � Q , A , q 0 , Q m , t � for w = a 1 . . . a n ∈ A ∗ : l ( G )( w ) = q 1 ,..., q n ∈ Q : q n ∈ Q m ( t ( q o , a 1 , q 1 )+ t ( q 1 , a 2 , q 2 )+ · · · + t ( q n − 1 , a n , q n )) . max l ( G )( w ) is the longest path corresponding to label w from the initial state to a final state. Using the matrix formalism: l ( G )( w ) = α ⊗ t ( w ) ⊗ β, typically α = ( e , ε, . . . , ε ) and similarly for β 14 / 43
Recommend
More recommend