Concurrent Kleene Algebra: Free Model and Completeness Tobias Kapp´ e Paul Brunet Alexandra Silva Fabio Zanasi University College London Leiden, 28 May 2018
Introduction Let’s write a program that outputs n > 0 space-separated � ’s. T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 2 20
Introduction Let’s write a program that outputs n > 0 space-separated � ’s. i := 1 while i < n do print � print i := i + 1 end print � T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 2 20
Introduction Let’s write a program that outputs n > 0 space-separated � ’s. i := 1 i := 1 while i < n do print � print � while i < n do print print i := i + 1 print � i := i + 1 end print � end T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 2 20
Introduction Let’s write a program that outputs n > 0 space-separated � ’s. i := 1 i := 1 while i < n do print � print � while i < n do print print i := i + 1 print � i := i + 1 end print � end Are these programs equivalent? T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 2 20
Introduction Programs are expressions T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 3 20
Introduction Programs are expressions , thus we should be able to reason equationally . T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 3 20
Introduction Programs are expressions , thus we should be able to reason equationally . Kleene Algebra (KA) provides an algebraic framework to do this. T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 3 20
Introduction program expression a , b , . . . ∈ Σ atomic action T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 4 20
Introduction program expression a , b , . . . ∈ Σ atomic action abort execution 0 T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 4 20
Introduction program expression a , b , . . . ∈ Σ atomic action abort execution 0 no-operation 1 T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 4 20
Introduction program expression a , b , . . . ∈ Σ atomic action abort execution 0 no-operation 1 e + f nondeterministic choice T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 4 20
Introduction program expression a , b , . . . ∈ Σ atomic action abort execution 0 no-operation 1 e + f nondeterministic choice sequential composition e · f T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 4 20
Introduction program expression a , b , . . . ∈ Σ atomic action abort execution 0 no-operation 1 e + f nondeterministic choice sequential composition e · f e ∗ repetition T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 4 20
Introduction i := 1 i := 1 while i < n do print � print � while i < n do print print i := i + 1 print � i := i + 1 end print � end T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 5 20
Introduction i := 1 i := 1 while i < n do print � print � while i < n do ( � · ) ∗ · � print print i := i + 1 print � i := i + 1 end print � end T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 5 20
Introduction i := 1 i := 1 while i < n do print � print � while i < n do ( � · ) ∗ · � � · ( · � ) ∗ print print i := i + 1 print � i := i + 1 end print � end T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 5 20
Introduction Axioms of KA: e + 0 ≡ e e + e ≡ e e + f ≡ f + e e + ( f + g ) ≡ ( e + f ) + g e · 0 ≡ 0 ≡ 0 · e e · 1 ≡ e ≡ 1 · e e · ( f · g ) ≡ ( e · f ) · g e · ( f + g ) ≡ e · f + e · g ( e + f ) · g ≡ e · g + f · g 1 + e · e ∗ ≡ e ∗ ⇒ e ∗ · g ≦ f e · f + g ≦ f = 1 + e ∗ · e ≡ e ∗ ⇒ g · f ∗ ≦ e e · f + g ≦ e = T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 6 20
Introduction Axioms of KA: e + 0 ≡ e e + e ≡ e e + f ≡ f + e e + ( f + g ) ≡ ( e + f ) + g e · 0 ≡ 0 ≡ 0 · e e · 1 ≡ e ≡ 1 · e e · ( f · g ) ≡ ( e · f ) · g e · ( f + g ) ≡ e · f + e · g ( e + f ) · g ≡ e · g + f · g 1 + e · e ∗ ≡ e ∗ ⇒ e ∗ · g ≦ f e · f + g ≦ f = 1 + e ∗ · e ≡ e ∗ ⇒ g · f ∗ ≦ e e · f + g ≦ e = T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 6 20
Introduction � · ( · � ) ∗ ≡ ( � · ) ∗ · � T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 7 20
Introduction Theorem (Kozen 1990) The axioms for KA are sound & complete for equivalence: e ≡ f ⇐ ⇒ L ( e ) = L ( f ) L ( e ) is the regular language interpretation of e. T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 8 20
Introduction Theorem (Kozen 1990) The axioms for KA are sound & complete for equivalence: e ≡ f ⇐ ⇒ L ( e ) = L ( f ) L ( e ) is the regular language interpretation of e. Upshot: to check KA equivalence is to check regular language equivalence through Kleene’s theorem, this means checking DFA equivalence sophisticated (near-linear) algorithms exist to do this T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 8 20
Adding concurrency Which new axioms do we need for parallel composition? T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 9 20
Adding concurrency Which new axioms do we need for parallel composition? e � f ≡ f � e T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 9 20
Adding concurrency Which new axioms do we need for parallel composition? e � f ≡ f � e e � ( f � g ) ≡ ( e � f ) � g T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 9 20
Adding concurrency Which new axioms do we need for parallel composition? e � f ≡ f � e e � ( f � g ) ≡ ( e � f ) � g e � 1 ≡ e T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 9 20
Adding concurrency Which new axioms do we need for parallel composition? e � f ≡ f � e e � ( f � g ) ≡ ( e � f ) � g e � 1 ≡ e e � 0 ≡ 0 T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 9 20
Adding concurrency Which new axioms do we need for parallel composition? e � f ≡ f � e e � ( f � g ) ≡ ( e � f ) � g e � 1 ≡ e e � 0 ≡ 0 e � ( f + g ) ≡ e � f + e � g T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 9 20
Adding concurrency e f Thread #1 g Thread #2 h time T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 10 20
Adding concurrency e f Thread #1 g Thread #2 h time T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 10 20
Adding concurrency e f Thread #1 g Thread #2 h time T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 10 20
Adding concurrency e f Thread #1 g Thread #2 h time T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 10 20
Adding concurrency e f Thread #1 g Thread #2 h time Equationally: ( e � g ) · ( f � h ) ≦ ( e · f ) � ( g · h ) . T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 10 20
Adding concurrency e f Thread #1 g Thread #2 h time Equationally: ( e � g ) · ( f � h ) ≦ ( e · f ) � ( g · h ) . p ≦ q ⇐ ⇒ p + q ≡ q T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 10 20
Adding concurrency e f Thread #1 g Thread #2 h time Equationally: ( e � g ) · ( f � h ) ≦ ( e · f ) � ( g · h ) . Nondeterministic interleaving as special case: e · f + f · e ≦ e � f . T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 10 20
Adding concurrency Question Can we have a regular interpretation � − � such that e ≡ f ⇐ ⇒ � e � = � f � ? T. Kapp´ e, P . Brunet, A. Silva, F. Zanasi Concurrent Kleene Algebra: Free Model and Completeness 11 20
Recommend
More recommend