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

generic trace semantics and graded monads
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Generic Trace Semantics and Graded Monads

Stefan Miliusa Dirk Pattinsonb Lutz Schr¨

  • dera

aFriedrich-Alexander-Universit¨

at Erlangen-N¨ urnberg

bAustralian National University, Canberra

CALCO 2015

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

1

slide-2
SLIDE 2

Introduction

◮ Coalgebra does bisimilarity ◮ Traces need algebra: impose additional equational laws

◮ See [Kurz/Milius/Pattinson/Schr¨

  • der 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¨

  • der: Generic Trace Semantics and Graded Monads

2

slide-3
SLIDE 3

Trace Semantics and Algebraic Laws

LTS = Coalgebras for functor GX = P(Σ×X). Algebraically: Shallow theory

◮ Operations ∑ai(·)i ◮ Shallow laws (e.g. a(x)+b(y) = b(y)+a(x))

Trace semantics:

◮ Split operations : ∑, a ◮ JSL laws for ∑ ◮ Distributivity:

a(∑xi) = ∑a(xi),

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

3

slide-4
SLIDE 4

Trace Semantics, Incrementally

c

a

  • a
  • c10

b

  • c11

c20 Pretrace = Pair (u,d), u word, d state. Pretraces Traces Stage 0 :

{(ε,c)} {ε}

Stage 1 :

{(a,c10),(a,c11)} {a}

Stage 2 :

{(ab,c20))} {ab}

Stage 3 :

/ /

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

4

slide-5
SLIDE 5

Graded Monads

(Smirnov 2008)

◮ Functors Mn : C → C

◮ Think: MnX = Terms of uniform depth n over X

◮ Unit η : id → M0 ◮ Multiplication µnk : MnMk → Mn+k ◮ Correspond to graded theories

◮ operators with assigned depths (e.g. 0, 1) ◮ Uniform-depth equations

Here: depth = trace length.

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

5

slide-6
SLIDE 6

Traces Semantics Via Graded Monads

Trace semantics of G =

◮ Graded monad (Mn) ◮ Natural transformation α : G → M1

For coalgebra γ : X → GX α-pretrace maps

γ(0) = η : X → M0X γ(n+1) = X

αγ

M1X

M1γ(n) M1MnX µ1n

X

Mn+1X and α-trace maps X

γ(n) MnX Mn!

Mn1

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

6

slide-7
SLIDE 7

Trace Semantics: Examples

◮ Finite-depth bisimilarity: Mn = Gn;

trace maps X → Gn1 = cone into final sequence.

◮ Trace semantics of LTS: MnX = P(Σn ×X) ◮ Mazurkiewicz traces ◮ Probabilistic traces:

◮ Generative probabilistic transition systems: G = D(Σ×X) ◮ Mn = D(Σn ×X) from

a(∑pixi) = ∑pia(xi)

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

7

slide-8
SLIDE 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 X → Tν ¯ F ∼

= T µF = P(Σ∗)

(becomes trivial for plain LTS, i.e. F = Σ× )

◮ TF n is graded monad ◮ α-trace maps X → TF n1 ∼

= P(∑i≤n Σi): traces and accepted words

◮ Language semantics by canonical forgetting

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

8

slide-9
SLIDE 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 X

η

→ TX → Uν ˆ

F ∼

= νF = P(Σ∗)

(becomes trivial for plain LTS, i.e. F = X Σ)

◮ F nT is graded monad ◮ α-trace maps X → F nT1 = F nP1: traces and accepted words ◮ Language semantics by canonical forgetting

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

9

slide-10
SLIDE 10

Graded Algebras

Mn-algebra for n < ω (similarly for n = ω):

◮ Objects Ak, k ≤ n ◮ Maps

amk : MmAk → Am+k

(m +k ≤ n)

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

10

slide-11
SLIDE 11

Trace Properties

(MkX)k≤n is the free Mn-Algebra over X.

◮ → Mn-Algebras + one truth value τ : 1 → An are trace properties:

X

Mn!γ(n) Mn1 τ#

n

An

◮ Compositional syntax?

◮ That’s what trace logics are about:

a⊤∧b⊤ is trace-invariant, a(a⊤∧b⊤) is not.

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

11

slide-12
SLIDE 12

Depth-1 Graded Monads

◮ Depth-1 graded theory:

◮ all operations and equations have depth ≤ 1

◮ Depth-1 graded monad:

◮ µnk and M0µ1n are pointwise epi ◮ µ1n is a (reflexive) coequalizer

M1M0Mn

M1µ0n

  • µ10Mn

M1Mn

µ1n M1+n .

In depth 1, Mn-algebras are compatible chains of M1-algebras

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

12

slide-13
SLIDE 13

Generic Trace Logics

Formulas:

◮ Depth 0: Constants c ◮ Depth n +1: L(φ1,...,φn), L modal operator, φi depth n.

Semantics:

◮ M0-algebra Ω of truth values ◮ Truth values [[c]] : 1 → Ω ◮ M1-algebras [[L]] : M1(Ωn) → Ω. ◮ [[φ]] is trace property (Mn-algebra, truth value)

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

13

slide-14
SLIDE 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]] : P(Σ×2) → 2, S →

(a,⊤) ∈ S ⊥

  • therwise

◮ Generally: [[L]] interprets a ∈ Σ as join-cont. map 2n → 2

→ add disjunction

◮ Finite-depth bisimilarity (Mn = Gn):

◮ Set 2 of truth values ◮ k-ary operators: maps [[L]] : G(2k) → 2 are k-ary predicate liftings ◮ closed under Boolean operators

→ coalgebraic modal logic

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

14

slide-15
SLIDE 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(ca +∑qaiφai)

where ca +∑qai(·)ai : [0,1]k → [0,1].

Milius/Pattinson/Schr¨

  • der: Generic Trace Semantics and Graded Monads

15

slide-16
SLIDE 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¨

  • der: Generic Trace Semantics and Graded Monads

16