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 Algebra describes program behavior regular expressions T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 2 16
What is Kleene Algebra? order, repetition Kleene Algebra describes program behavior regular expressions T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 2 16
A tale of two programs while ψ 1 do while φ 1 do foo; if φ 2 then end foo; while ψ 2 do else bar; bar; while ψ 3 do end foo; end end end T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 3 16
A tale of two programs while ψ 1 do while φ 1 do foo; if φ 2 then end foo; while ψ 2 do else bar; bar; while ψ 3 do end foo; end end end T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 3 16
A tale of two programs while ψ 1 do while φ 1 do foo; if φ 2 then end foo; while ψ 2 do ( foo + bar ) ∗ else bar; bar; while ψ 3 do end foo; end end end T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 3 16
A tale of two programs while ψ 1 do while φ 1 do foo; if φ 2 then end foo; while ψ 2 do foo ∗ · ( bar · foo ∗ ) ∗ ( foo + bar ) ∗ else bar; bar; while ψ 3 do end foo; end end end T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 3 16
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 ∗ ≡ KA 1 + e · e ∗ e + e ≡ KA e e · 1 ≡ KA e T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 4 16
The lay of the land KA is well-understood: T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 5 16
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
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
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
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
Towards concurrency Thread 1 Thread 2 a c b d � �� � ( a · b ) � ( c · d ) Concurrent KA a adds parallel composition ( � ) expressions grow linearly with the program interleaving still possible: ( e � f ) · ( g � h ) ≦ CKA ( e · g ) � ( f · h ) . a Hoare et al. 2009. T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 6 16
Questions begged Enquiring minds want to know: T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 7 16
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
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
Interlude: partially ordered multisets A pomset is a “word with parallelism” b a · ( b � c ) · d ≈ a d c T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 8 16
Interlude: partially ordered multisets A pomset is a “word with parallelism” b a · ( b � c ) · d ≈ a d c T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 8 16
Interlude: partially ordered multisets A pomset is a “word with parallelism” b a · ( b � c ) · d ≈ a d c Pomset subsumption: a c a c ⊑ b d b d T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 8 16
Interlude: partially ordered multisets A pomset is a “word with parallelism” b a · ( b � c ) · d ≈ a d c Pomset subsumption: a c a c ( a � b ) · ( c � d ) ≈ ⊑ ≈ ( a · c ) � ( b · d ) b d b d T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 8 16
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
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 <ω U n T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 9 16
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 <ω U n Closure: U ↓ = { U ′ ∈ Pom Σ : U ′ ⊑ U ∈ U} . T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 9 16
Axiomatization CKA semantics is given by � − � CKA : T → 2 Pom Σ . � e ∗ � CKA = � e � ∗ � 0 � CKA = ∅ � e + f � CKA = � e � CKA ∪ � f � CKA CKA ↓ � 1 � CKA = { 1 } � e · f � CKA = � e � CKA · � f � CKA � e � f � CKA = ( � e � CKA � � f � CKA ) ↓ � a � CKA = { a } 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
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
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
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d a T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d a T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d a T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d a T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d a T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d a · ( b � c · d ) T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model b q 3 q 5 a e q 0 q 1 q 2 q 7 q 4 q 6 q 8 c d a · ( b � c · d ) · e T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 12 16
Automata model q 1 a q 0 q 3 q 2 q 4 b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b a � b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b a · ( a � b ) � b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b a · ( a · ( a � b )) � b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model q 1 a q 0 q 3 q 2 q 4 b T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 13 16
Automata model Theorem (K . et al. 2017) The following are equivalent: U is described by a concurrent regex i ii U is recognized by a fork-acyclic pomset automaton. T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 14 16
Further work Question KA can be described coalgebraically; what about CKA ? T. Kapp´ e Concurrent Kleene Algebra BCTCS 2018 15 16
Recommend
More recommend