Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella PRL, Northeastern University MFPS 25 Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Motivation • Probabilistic process calculi (e.g. stochastic CCS) • Probabilistic choice • Stochastic process calculi (e.g. stochastic π calculus) • Probabilistic delay on actions • Take the first enabled communication • Probabilistic vs. “stochastic” • Categorical models for first-order languages Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
1. Adding delay to categorical models of iteration 2. Adding delay to the category of stochastic relations Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Adding delay to categorical models of iteration Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Monadic models of iteration • First-order imperative language of loops S ::= skip | S ; S | let v = E in S | v := E | if E then S else S | while E do S • Monadic state-transformer semantics � S � : � Γ � → T � Γ � ( Γ ⊢ S ) • T models nontermination/failure (at least) Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Monadic models of iteration C • Finite products • State spaces: � Γ � = � τ 1 � × · · · × � τ n � • Finite coproducts, distributive category • � bool � = 1 + 1 • X × (1 + 1) − → ( X + 1) × ( X + 1) C T • Partially additive [Manes,Arbib 86] • Loops Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Iteration • Par ∼ = Set − ⊥ semantics � S � : � Γ � → � Γ � ⊥ • Unrollings of loop body � � ¬ E � ! , � while E do S � = + � E � !; � S � ; � ¬ E � ! , � E � !; � S � ; � E � !; � S � ; � ¬ E � ! , . . . • Infinite summation • Partially defined Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Iteration: partially additive categories • Summation on arrows • Partial functions � X,Y on countable subets of D ( X, Y ) • { f } i ∈ I summable if � { f } i ∈ I defined • . . . • Examples • Par – disjoint domains, graph union • Rel – graph union (not partial) • CPO ⊥ – directed sets, lub • Zero arrows: 0 X,Y = � X,Y ∅ • Failure effect Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Iteration: partially additive categories X f Every ✲ X + Y decomposes as � � � X f 1 ✲ X ι 1 X f 2 ✲ Y ι 2 f = ✲ X + Y , ✲ X + Y and gives the iterate X f n X f † � ✲ X f 2 ✲ Y = ✲ Y 1 n<ω � † � � Γ � � E � ? ✲ � Γ � + � Γ � � S � + η ✲ T � Γ � + T � Γ � � while E do S � = ✲ T � Γ � � Γ � Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Delay • Time taken by computation • Delay effect: − × M monad ( M monoid) � wait E � = � Γ � � 1 , � E � � ✲ � Γ � × M • Not impure monoids in C T m : M × M → TM e : 1 → TM • Pure monoids in C m : M × M → M e : 1 → M Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Delay and T ? ✲ ✛ C −× M C T ✲ ✛ C • ( − × M ) · T – coarse-grained timing • T · ( − × M ) – fine-grained timing, failure from T • Assume distributive law λ X : TX × M → T ( X × M ) • Strong monad suffices Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Delay and iteration delay + iteration ∼ D ′ C T ( −× M ) ✛ ✲ ✻ ∼ C −× M C T D ✛ ✲ delay iteration C Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Lifting partial additivity Definition Given D and D ′ partially additive, F : D → D ′ preserves partial additivity iff • { f i } summable ⇒ { Ff i } summable • F ( � f i ) = � Ff i Proposition If S : D → D preserves partial additivity then D S is partial additive where � � � � ( f i ) S X f i ✲ YS • summable iff ✲ SY summable XS �� � ( f i ) S X f i • � ✲ YS = ✲ SY XS S Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Lifting partial additivity delay + iteration ∼ D ′ C T ( −× M ) ✛ ✲ ✻ ∼ C −× M C T D ✛ ✲ delay iteration C Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Lifting monads Proposition If S distributes over T , then S lifts to a monad S : C T → C T st. C TS ∼ = ( C T ) S The monad: � � SX Sf ✲ ST Y λ Y � � f T ✲ T SY S ✲ YT = ✲ ( SY ) T T XT ( SX ) T η S � � X η TS ✲ ( SX ) T = ✲ T SX X T X T XT SSX ( η T ◦ µ S ) X µ S � � ✲ ( SX ) T = ✲ T SX X T ( SSX ) T T Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Lifting monads delay + iteration delay ∼ ( C T ) −× M D −× M ✛ ✲ ✻ ∼ C −× M C T D ✛ ✲ delay iteration C Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Lifting partial additivity Theorem Let S, T : C → C be monads with C T partially additive. If S distributes over T and S : C T → C T perserves partial additivity, then C TS is partially additive. Corollary Let C have finite products with monoid M , let T : C → C be a strong monad, and C T be partially additive. Then T ( − × M ) : C → C is a monad and, if − × M : C T → C T preserves partial additivity, then C T ( −× M ) is partially additive. Par • − ⊥ : Set → Set strong • − × M : Par → Par preserves partial additivity • Par −× M models iteration and delay • � S � : � Γ � → ( � Γ � × M ) ⊥ Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Adding delay to the category of stochastic relations Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
∼ C T ( −× M ) D −× M ✲ ✛ ✻ ∼ C −× M C T D ✲ ✛ C Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
∼ Meas Π( −×M ) TSRel M ✲ ✛ ✻ ∼ Meas −×M Meas Π SRel ✲ ✛ Meas Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Meas : a category for probability • Probability distribution / probability measure N → [0 , 1] R → [0 , 1] P R → [0 , 1] Σ R → [0 , 1] ( Σ R ⊆ P R ) • Measurable space— σ -algebra of observable events ( X, Σ X ) • Measurable function f : ( X, Σ X ) → ( Y, Σ Y ) f − 1 : Σ Y → Σ X • Category of measurable spaces: Meas Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
SRel : Stochastic relations • Stochastic relation / transition function / sub-Markov kernel f : X × Σ Y → [0 , 1] f ( x, − ) sub-probability measure f ( − , B ) measurable function • SRel • Objects: measurable spaces ( X, Σ X ) • Arrows: f : X → Y is a stochastic relation X × Σ Y → [0 , 1] • Composition: . . . • More concisely f : X → Π Y ∈ Meas where Π Y = { sub-probability measures on Y } • Π : Meas → Meas monad [Giry 81] • SRel ∼ = Meas Π Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
SRel : Stochastic relations • Composition ∼ existential join of relations f : X → Π Y g : Y → Π Z f : X × Σ Y → [0 , 1] g : Y × Σ Z → [0 , 1] � gf ( x, C ) = f ( x, dy ) g ( y, C ) Y • Discrete case: f : X × Y → [0 , 1] g : Y × Z → [0 , 1] � gf ( x, z ) = f ( x, y ) g ( y, z ) y ∈ Y Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
SRel for probabilistic while languages • Meas has finite products, finite coproducts, and distributivity • (Think: topological spaces) • SRel is partially additive � iteration [Panangaden 99] • SRel models probabilistic behavior � { (1 − p ) � S 1 � , p � S 2 � } � S 1 + p S 2 � = � Γ � ✲ Π � Γ � Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
SRel with delay • Π : Meas → Meas strong: t X,Y : X × Π Y → Π( X × Y ) ( x, ν ) �→ δ x × ν • Π( − × M ) : Meas → Meas monad • − × M : SRel → SRel preserves partial additivity • SRel −×M partially additive • SRel −×M models probabilistic behavior, iteration, and delay • Let TSRel M ∼ = SRel −×M Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
TSRel M : Timed stochastic relations • Composition: existential join on states, accumulate delay f : X → Π( Y × M ) g : Y → Π( Z × M ) f : X × Σ Y ×M → [0 , 1] g : Y × Σ Z ×M → [0 , 1] � � gf ( x, C ) = f ( x, dy, da )) g ( y, dz, db )) χ C ( z, m ( b, a )) Y ×M Z ×M • Discrete case: f : X × Y × M → [0 , 1] g : Y × Z × M → [0 , 1] � � gf ( x, z, c ) = f ( x, y, a ) g ( y, z, b ) χ { c } ( m ( b, a )) y ∈ Y,a ∈M z ∈ Z,b ∈M Categories of Timed Stochastic Relations Daniel Brown and Riccardo Pucella
Recommend
More recommend