Concurrent Kleene Algebra Tobias Kapp e University College London - - PowerPoint PPT Presentation

concurrent kleene algebra
SMART_READER_LITE
LIVE PREVIEW

Concurrent Kleene Algebra Tobias Kapp e University College London - - PowerPoint PPT Presentation

Concurrent Kleene Algebra Tobias Kapp e University College London BCTCS 2018 What is Kleene Algebra? Kleene Algebra describes program behavior T. Kapp e Concurrent Kleene Algebra BCTCS 2018 2 16 What is Kleene Algebra? Kleene


slide-1
SLIDE 1

Concurrent Kleene Algebra

Tobias Kapp´ e

University College London

BCTCS 2018

slide-2
SLIDE 2

What is Kleene Algebra?

Kleene Algebra describes program behavior

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 2 16
slide-3
SLIDE 3

What is Kleene Algebra?

Kleene Algebra regular expressions describes program behavior

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 2 16
slide-4
SLIDE 4

What is Kleene Algebra?

Kleene Algebra regular expressions describes program behavior

  • rder, repetition
  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 2 16
slide-5
SLIDE 5

A tale of two programs

while φ1 do if φ2 then foo; else bar; end end while ψ1 do foo; end while ψ2 do bar; while ψ3 do foo; end end

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 3 16
slide-6
SLIDE 6

A tale of two programs

while φ1 do if φ2 then foo; else bar; end end while ψ1 do foo; end while ψ2 do bar; while ψ3 do foo; end end

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 3 16
slide-7
SLIDE 7

A tale of two programs

while φ1 do if φ2 then foo; else bar; end end while ψ1 do foo; end while ψ2 do bar; while ψ3 do foo; end end

(foo + bar)∗

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 3 16
slide-8
SLIDE 8

A tale of two programs

while φ1 do if φ2 then foo; else bar; end end while ψ1 do foo; end while ψ2 do bar; while ψ3 do foo; end end

(foo + bar)∗

foo∗ · (bar · foo∗)∗

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 3 16
slide-9
SLIDE 9

A tale of two programs

We can prove this using KA:

(foo + bar)∗ ≡KA foo∗ · (bar · foo∗)∗

where ≡KA is generated by axioms such as (among others) e + e ≡KA e e · 1 ≡KA e e∗ ≡KA 1 + e · e∗

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 4 16
slide-10
SLIDE 10

The lay of the land

KA is well-understood:

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 5 16
slide-11
SLIDE 11

The lay of the land

KA is well-understood:

Theorem (Salomaa 1966; Kozen 1994)

KA axiomatizes regex-equivalence, i.e., e ≡KA f ⇔ L(e) = L(f).

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 5 16
slide-12
SLIDE 12

The lay of the land

KA is well-understood:

Theorem (Salomaa 1966; Kozen 1994)

KA axiomatizes regex-equivalence, i.e., e ≡KA f ⇔ L(e) = L(f).

Theorem (Kleene 1956; Brzozowski 1964)

Every regex is equivalent to some finite automaton, and vice versa.

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 5 16
slide-13
SLIDE 13

Towards concurrency

Thread 1 Thread 2 a c b d How do we model concurrent composition in KA?

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 6 16
slide-14
SLIDE 14

Towards concurrency

Thread 1 Thread 2 a c b d

  • a·b·c·d+a·c·b·d+···?

Interleaving is insufficient!

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 6 16
slide-15
SLIDE 15

Towards concurrency

Thread 1 Thread 2 a c b d

  • (a·b)(c·d)

Concurrent KAa adds parallel composition () expressions grow linearly with the program interleaving still possible: (e f) · (g h) ≦CKA (e · g) (f · h).

aHoare et al. 2009.
  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 6 16
slide-16
SLIDE 16

Questions begged

Enquiring minds want to know:

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 7 16
slide-17
SLIDE 17

Questions begged

Enquiring minds want to know:

Question

Does CKA axiomatize “concurrent regex” equivalence, i.e., e ≡CKA f ⇔ L(e) = L(f)?

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 7 16
slide-18
SLIDE 18

Questions begged

Enquiring minds want to know:

Question

Does CKA axiomatize “concurrent regex” equivalence, i.e., e ≡CKA f ⇔ L(e) = L(f)?

Question

Is there an automaton model that corresponds to concurrent regular expressions?

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 7 16
slide-19
SLIDE 19

Interlude: partially ordered multisets

A pomset is a “word with parallelism” a · (b c) · d ≈ a b c d

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 8 16
slide-20
SLIDE 20

Interlude: partially ordered multisets

A pomset is a “word with parallelism” a · (b c) · d ≈ a b c d

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 8 16
slide-21
SLIDE 21

Interlude: partially ordered multisets

A pomset is a “word with parallelism” a · (b c) · d ≈ a b c d Pomset subsumption: a b c d

a b c d

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 8 16
slide-22
SLIDE 22

Interlude: partially ordered multisets

A pomset is a “word with parallelism” a · (b c) · d ≈ a b c d Pomset subsumption:

(a b) · (c d) ≈

a b c d

a b c d

≈ (a · c) (b · d)

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 8 16
slide-23
SLIDE 23

Interlude: partially ordered multisets

Composition lifts to pomset languages:

U · V = {U · V : U ∈ U, V ∈ V} U V = {U V : U ∈ U, V ∈ V}

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 9 16
slide-24
SLIDE 24

Interlude: partially ordered multisets

Composition lifts to pomset languages:

U · V = {U · V : U ∈ U, V ∈ V} U V = {U V : U ∈ U, V ∈ V}

Kleene star: U∗ =

n<ω Un

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 9 16
slide-25
SLIDE 25

Interlude: partially ordered multisets

Composition lifts to pomset languages:

U · V = {U · V : U ∈ U, V ∈ V} U V = {U V : U ∈ U, V ∈ V}

Kleene star: U∗ =

n<ω Un

Closure: U↓ = {U ′ ∈ PomΣ : U ′ ⊑ U ∈ U}.

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 9 16
slide-26
SLIDE 26

Axiomatization

CKA semantics is given by −CKA : T → 2PomΣ.

0 CKA = ∅ e + f CKA = e CKA ∪ f CKA e∗ CKA = e ∗

CKA↓

1 CKA = {1} e · f CKA = e CKA · f CKA a CKA = {a} e f CKA = (e CKA f CKA) ↓

CKA axioms is given by axioms of KA, plus e f ≡CKA f e 0 f ≡CKA 0 1 f ≡CKA f

(e + f) g ≡CKA e g + f g

e (f g) = (e f) g

(e f) · (g h) ≦CKA (e · g) (f · h)

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 10 16
slide-27
SLIDE 27

Axiomatization

Theorem (Kapp´ e et al. 2018)

The axioms for CKA are sound and complete for semantic equivalence: e ≡CKA f ⇔ e CKA = f CKA

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 11 16
slide-28
SLIDE 28

Axiomatization

Theorem (Kapp´ e et al. 2018)

The axioms for CKA are sound and complete for semantic equivalence: e ≡CKA f ⇔ e CKA = f CKA

Question

What happens when we add the “parallel Kleene star”?

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 11 16
slide-29
SLIDE 29

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-30
SLIDE 30

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-31
SLIDE 31

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e a

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-32
SLIDE 32

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e a

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-33
SLIDE 33

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e a

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-34
SLIDE 34

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e a

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-35
SLIDE 35

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e a

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-36
SLIDE 36

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e a · (b c · d)

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-37
SLIDE 37

Automata model

q0 q1 q3 q4 q5 q6 q8 q2 q7 a b c d e a · (b c · d) · e

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 12 16
slide-38
SLIDE 38

Automata model

q0 q1 q2 q3 q4 a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-39
SLIDE 39

Automata model

q0 q1 q2 q3 q4 a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-40
SLIDE 40

Automata model

q0 q1 q2 q3 q4 a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-41
SLIDE 41

Automata model

q0 q1 q2 q3 q4 a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-42
SLIDE 42

Automata model

q0 q1 q2 q3 q4 a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-43
SLIDE 43

Automata model

q0 q1 q2 q3 q4 a b a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-44
SLIDE 44

Automata model

q0 q1 q2 q3 q4 a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-45
SLIDE 45

Automata model

q0 q1 q2 q3 q4 a b a · (a b) b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-46
SLIDE 46

Automata model

q0 q1 q2 q3 q4 a b a · (a · (a b)) b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-47
SLIDE 47

Automata model

q0 q1 q2 q3 q4 a b

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 13 16
slide-48
SLIDE 48

Automata model

Theorem (K. et al. 2017)

The following are equivalent:

i

U is described by a concurrent regex

ii U is recognized by a fork-acyclic pomset automaton.

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 14 16
slide-49
SLIDE 49

Further work

Question

KA can be described coalgebraically; what about CKA?

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 15 16
slide-50
SLIDE 50

Further work

Question

KA can be described coalgebraically; what about CKA?

Question

Is equivalence of pomset-automata (tractably) decidable?

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 15 16
slide-51
SLIDE 51

Further work

Question

KA can be described coalgebraically; what about CKA?

Question

Is equivalence of pomset-automata (tractably) decidable?

Question

NetKAT can be used to describe network policy. Can we add concurrency?

  • T. Kapp´
e Concurrent Kleene Algebra BCTCS 2018 15 16
slide-52
SLIDE 52

Thank you for your attention

CoNeCo

Code: https://doi.org/10.5281/zenodo.926651. Illustrations adapted from https://xkcd.com/208/ (CC-BY-NC)