generic trace semantics and graded monads
play

Generic Trace Semantics and Graded Monads Stefan Milius a Dirk - PowerPoint PPT Presentation

Generic Trace Semantics and Graded Monads Stefan Milius a Dirk Pattinson b oder a Lutz Schr a Friedrich-Alexander-Universit at Erlangen-N urnberg b Australian National University, Canberra CALCO 2015 Milius/Pattinson/Schr oder: Generic


  1. Generic Trace Semantics and Graded Monads Stefan Milius a Dirk Pattinson b oder a Lutz Schr¨ a Friedrich-Alexander-Universit¨ at Erlangen-N¨ urnberg b Australian National University, Canberra CALCO 2015 Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 1

  2. Introduction ◮ Coalgebra does bisimilarity ◮ Traces need algebra: impose additional equational laws ◮ See [Kurz/Milius/Pattinson/Schr¨ oder 2015] for trace semantics via monads ◮ Here: refine this to use graded monads ◮ control over trace length ◮ Generalize all previous approaches ◮ Introduce graded algebras ◮ obtain generic trace logic Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 2

  3. Trace Semantics and Algebraic Laws LTS = Coalgebras for functor GX = P (Σ × X ) . Algebraically: Shallow theory ◮ Operations ∑ a i ( · ) i ◮ Shallow laws (e.g. a ( x )+ b ( y ) = b ( y )+ a ( x ) ) Trace semantics: ◮ Split operations : ∑ , a ◮ JSL laws for ∑ ◮ Distributivity: a ( ∑ x i ) = ∑ a ( x i ) , Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 3

  4. � � � Trace Semantics, Incrementally c a a c 10 c 11 b c 20 Pretrace = Pair ( u , d ) , u word, d state. Pretraces Traces Stage 0 : { ( ε , c ) } { ε } Stage 1 : { ( a , c 10 ) , ( a , c 11 ) } { a } Stage 2 : { ( ab , c 20 )) } { ab } Stage 3 : 0 / 0 / Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 4

  5. Graded Monads (Smirnov 2008) ◮ Functors M n : C → C ◮ Think: M n X = Terms of uniform depth n over X ◮ Unit η : id → M 0 ◮ Multiplication µ nk : M n M k → M n + k ◮ Correspond to graded theories ◮ operators with assigned depths (e.g. 0, 1) ◮ Uniform-depth equations Here: depth = trace length. Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 5

  6. Traces Semantics Via Graded Monads Trace semantics of G = ◮ Graded monad ( M n ) ◮ Natural transformation α : G → M 1 For coalgebra γ : X → GX α -pretrace maps γ ( 0 ) = η : X → M 0 X M 1 γ ( n ) � M 1 M n X µ 1 n αγ γ ( n + 1 ) = X � M 1 X � M n + 1 X X and α -trace maps γ ( n ) � M n X M n ! � M n 1 X Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 6

  7. Trace Semantics: Examples ◮ Finite-depth bisimilarity: M n = G n ; trace maps X → G n 1 = cone into final sequence. ◮ Trace semantics of LTS: M n X = P (Σ n × X ) ◮ Mazurkiewicz traces ◮ Probabilistic traces: ◮ Generative probabilistic transition systems: G = D (Σ × X ) ◮ M n = D (Σ n × X ) from a ( ∑ p i x i ) = ∑ p i a ( x i ) Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 7

  8. Example: Trace Semantics, Kleisli Style (Hasuo/Jacobs/Sokolova 2007) E.g. LTS with explicit termination (NDA) are TF -coalgebras for T = P F = 1 +Σ × Kleisli law ( ∼ = lifting ¯ F of F to Kleisli category) λ X : FT → TF + some assumptions → language semantics via final map F ∼ X → T ν ¯ = T µ F = P (Σ ∗ ) (becomes trivial for plain LTS, i.e. F = Σ × ) ◮ TF n is graded monad ◮ α -trace maps X → TF n 1 ∼ = P ( ∑ i ≤ n Σ i ) : traces and accepted words ◮ Language semantics by canonical forgetting Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 8

  9. Example: Trace Semantics, Eilenberg-Moore Style (Bonsangue/Milius/Silva 2013) E.g. LTS with explicit termination (NDA) are FT -coalgebras for Σ T = P F = 2 × EM-law ( ∼ = lifting ˆ F of F to EM category) ρ : TF → FT Language semantics: Final Map η → TX → U ν ˆ F ∼ = ν F = P (Σ ∗ ) X (becomes trivial for plain LTS, i.e. F = X Σ ) ◮ F n T is graded monad ◮ α -trace maps X → F n T 1 = F n P 1: traces and accepted words ◮ Language semantics by canonical forgetting Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 9

  10. Graded Algebras M n -algebra for n < ω (similarly for n = ω ): ◮ Objects A k , k ≤ n ◮ Maps a mk : M m A k → A m + k ( m + k ≤ n ) Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 10

  11. Trace Properties ( M k X ) k ≤ n is the free M n -Algebra over X . ◮ → M n -Algebras + one truth value τ : 1 → A n are trace properties: τ # M n ! γ ( n ) � M n 1 n � A n X ◮ Compositional syntax? ◮ That’s what trace logics are about: � a �⊤∧� b �⊤ is trace-invariant, � a � ( � a �⊤∧� b �⊤ ) is not. Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 11

  12. � Depth-1 Graded Monads ◮ Depth-1 graded theory: ◮ all operations and equations have depth ≤ 1 ◮ Depth-1 graded monad: ◮ µ nk and M 0 µ 1 n are pointwise epi ◮ µ 1 n is a (reflexive) coequalizer M 1 µ 0 n µ 1 n � M 1 + n . M 1 M 0 M n � M 1 M n µ 10 M n In depth 1, M n -algebras are compatible chains of M 1 -algebras Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 12

  13. Generic Trace Logics Formulas: ◮ Depth 0: Constants c ◮ Depth n + 1: L ( φ 1 ,..., φ n ) , L modal operator, φ i depth n . Semantics: ◮ M 0 -algebra Ω of truth values ◮ Truth values [[ c ]] : 1 → Ω ◮ M 1 -algebras [[ L ]] : M 1 (Ω n ) → Ω . ◮ [[ φ ]] is trace property ( M n -algebra, truth value) Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 13

  14. Trace logics: Examples ◮ LTS ( G = P (Σ × X ) ): ◮ Truth value object: 2 with the usual P -algebra structure (complete JSL) ◮ Unary operators: e.g. � ⊤ ( a , ⊤ ) ∈ S [[ � a � ]] : P (Σ × 2 ) → 2 , S �→ ⊥ otherwise ◮ Generally: [[ L ]] interprets a ∈ Σ as join-cont. map 2 n → 2 → add disjunction ◮ Finite-depth bisimilarity ( M n = G n ): ◮ Set 2 of truth values ◮ k -ary operators: maps [[ L ]] : G ( 2 k ) → 2 are k -ary predicate liftings ◮ closed under Boolean operators → coalgebraic modal logic Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 14

  15. Example: Probabilistic Trace Logic For G = D (Σ × X ) : ◮ Set [ 0 , 1 ] of truth values ◮ Unary operators: e.g. [[ � a � ]] : D (Σ × [ 0 , 1 ]) → [ 0 , 1 ] µ �→ ∑ p ∈ [ 0 , 1 ] p µ ( a , p ) ◮ Generally: k -ary operator interprets a as convex morphism [ 0 , 1 ] k → [ 0 , 1 ] , i.e. affine map ◮ Thus: add affine combinations, including fuzzy negation 1 − φ . ◮ Precisely: φ ::= ∑ a ∈ Σ � a � ( c a + ∑ q ai φ ai ) where c a + ∑ q ai ( · ) ai : [ 0 , 1 ] k → [ 0 , 1 ] . Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 15

  16. Conclusions and Future Work ◮ Trace semantics via graded monoids ◮ subsumes existing approaches to generic finite traces ◮ Graded algebras are formulae in trace logics ◮ Cover proper probabilistic systems ◮ Future work: ◮ Expressivity ◮ Temporal extensions ◮ Model checking ◮ Reasoning Milius/Pattinson/Schr¨ oder: Generic Trace Semantics and Graded Monads 16

Recommend


More recommend