robert.atkey@strath.ac.uk Operational and Denotational Semantics for Classical Processes Robert Atkey University of Strathclyde, Glasgow 6th January 2017
Girard/Abramsky, early 90s: (Linear Logic) Proofs as Processes ▶ Processes realise proofs ▶ Process reductions in lock-step with Cut-reduction ▶ Not a completely neat fit (Bellin, Scott, 1994) ▶ Fruitful idea: GoI, Interaction Categories, Game Semantics, ... Caires, Pfenning: Intuitionistic Linear Logic and Session Types ▶ Assign proof terms to DILL proofs ▶ Careful “channel management”: propositions as sessions ▶ (Wadler, 2012) Classical LL version: CP
Damiano Mazza, The True Concurrency of Differential Interaction Nets , 2015. However, although linear logic has kept providing, even in recent times, useful tools for ensuring properties of process algebras, especially via type systems (Kobayashi et al., 1999; Yoshida et al., 2004; Caires and Pfenning, 2010; Honda and Laurent, 2010), all further investigations have failed to bring any deep logical insight into concurrency theory, in the sense that no concurrent primitive has found a convincing counterpart in linear logic, or anything even remotely resembling the perfect correspondence between functional languages and intuitionistic logic. In our opinion, we must simply accept that linear logic is not the right framework for carrying out Abramsky’s “proofs as processes” program (which, in fact, more than 20 years after its inception has yet to see a satisfactory completion).
My Goal: What is the observable result of a CP process? ▶ An Operational Semantics ▶ A notion of “observed behaviour” ▶ A notion of “observational equivalence” ▶ A denotational semantics with an adequacy proof
Wadler’s “Classical Processes” (a term language for Girard’s Classical Linear Logic)
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A ⊥ lp A ` B A & B ? A
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A positive ⊥ lp A ` B A & B ? A
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A positive ⊥ lp A ` B A & B ? A negative
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A positive ⊥ lp A ` B A & B ? A negative � �� � ���� � �� � additive exponentials multiplicative
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A output ⊥ lp A ` B A & B ? A negative � �� � ���� � �� � additive exponentials multiplicative
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A output ⊥ lp A ` B A & B ? A input � �� � ���� � �� � additive exponentials multiplicative
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A output ⊥ lp A ` B A & B ? A input � �� � ���� � �� � additive exponentials topology
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A output ⊥ lp A ` B A & B ? A input � �� � ���� � �� � data exponentials topology
Propositions as Sessions A , B ::= 1 lp A ⊗ B A ⊕ B ! A output ⊥ lp A ` B A & B ? A input � �� � ���� � �� � data lpservers topology
Propositions as Sessions Output a choice: Bit = 1 ⊕ 1 Input a choice: Bit ⊥ = ⊥ & ⊥
Propositions as Sessions Duality flips input and output: 1 ⊥ ⊥ ⊥ = ⊥ = 1 A ⊥ ` B ⊥ A ⊥ ⊗ B ⊥ ( A ⊗ B ) ⊥ ( A ` B ) ⊥ = = A ⊥ & B ⊥ A ⊥ ⊕ B ⊥ ( A ⊕ B ) ⊥ ( A & B ) ⊥ = = ( ! A ) ⊥ ? A ⊥ ( ? A ) ⊥ ! A ⊥ = =
Another way of writing Server, using A B A B: Server ! Bit Bit Bit Propositions as Sessions Receive two bits and return a bit: Server = ! ( Bit ⊥ ` Bit ⊥ ` Bit ⊗ 1) Emit two bits and receive a bit: Client = Server ⊥ = ? ( Bit ⊗ Bit ⊗ Bit ⊥ ` ⊥ )
Propositions as Sessions Receive two bits and return a bit: Server = ! ( Bit ⊥ ` Bit ⊥ ` Bit ⊗ 1) Emit two bits and receive a bit: Client = Server ⊥ = ? ( Bit ⊗ Bit ⊗ Bit ⊥ ` ⊥ ) Another way of writing Server, using A ⊸ B = A ⊥ ` B: Server = ! ( Bit ⊸ Bit ⊸ Bit ⊗ 1)
Processes as Proofs ⊢ P :: x 1 : A 1 , . . . , x n : A n � �� � unconnected channels
Processes as Proofs Structural ⊢ x ↔ y :: x : A , y : A ⊥ (Ax) ⊢ Q :: ∆ , x : A ⊥ ⊢ P :: Γ , x : A (Cut) (Mix 0 ) ⊢ ν x . ( P | Q ) :: Γ , ∆ ⊢ 0 ::
Processes as Proofs Multiplicative ⊢ P :: Γ ( 1 ) ( ⊥ ) ⊢ x [] :: x : 1 ⊢ x () . P :: Γ , x : ⊥ ⊢ P :: Γ , y : A ⊢ Q :: ∆ , x : B ⊢ P :: Γ , y : A , x : B ( ⊗ ) ( ` ) ⊢ x [ y ] . ( P | Q ) :: Γ , ∆ , x : A ⊗ B ⊢ x ( y ) . P :: Γ , x : A ` B
Processes as Proofs Additive ⊢ P :: Γ , x : A i ( ⊕ i ) ⊢ x [ i ] . P :: Γ , x : A 0 ⊕ A 1 ⊢ P :: Γ , x : A 0 ⊢ Q :: Γ , x : A 1 (&) ⊢ x . case ( P , Q ) :: Γ , x : A 0 & A 1
Processes as Proofs Exponential ⊢ P :: ? Γ , y : A ⊢ P :: Γ , y : A (!) (?) ⊢ ! x [ y ] . P :: ? Γ , x : ! A ⊢ ? x ( y ) . P :: Γ , x : ? A ⊢ P :: Γ , x 1 : ? A , x 2 : ? A ⊢ P :: Γ (C) (W) ⊢ P { x 1 / x 2 } :: Γ , x 1 : ? A ⊢ P :: Γ , x : ? A
An “AND” server: ! x y y p y q case p 0 case q 0 y 0 y 1 y 0 y 1 case q 0 y 0 y 1 y 1 y x Server A binary binary operation client: ? x y y 1 y 1 case y 0 y 1 y x Client Processes as Proofs Some syntactic sugar: def x [ 0 ] . P x [ y ] . ( y [0] . y [] | P ) = def x [ 1 ] . P x [ y ] . ( y [1] . y [] | P ) = def case x . { 0 �→ P ; 1 �→ Q } x . case ( x () . P , x () . Q ) =
A binary binary operation client: ? x y y 1 y 1 case y 0 y 1 y x Client Processes as Proofs Some syntactic sugar: def x [ 0 ] . P x [ y ] . ( y [0] . y [] | P ) = def x [ 1 ] . P x [ y ] . ( y [1] . y [] | P ) = def case x . { 0 �→ P ; 1 �→ Q } x . case ( x () . P , x () . Q ) = An “AND” server: ⊢ ! x [ y ] . y ( p ) . y ( q ) . case p . { 0 �→ case q . { 0 �→ y [ 0 ] . y []; 1 �→ y [ 0 ] . y [] } ; 1 �→ case q . { 0 �→ y [ 0 ] . y []; 1 �→ y [ 1 ] . y [] }} :: x : Server
Processes as Proofs Some syntactic sugar: def x [ 0 ] . P x [ y ] . ( y [0] . y [] | P ) = def x [ 1 ] . P x [ y ] . ( y [1] . y [] | P ) = def case x . { 0 �→ P ; 1 �→ Q } x . case ( x () . P , x () . Q ) = An “AND” server: ⊢ ! x [ y ] . y ( p ) . y ( q ) . case p . { 0 �→ case q . { 0 �→ y [ 0 ] . y []; 1 �→ y [ 0 ] . y [] } ; 1 �→ case q . { 0 �→ y [ 0 ] . y []; 1 �→ y [ 1 ] . y [] }} :: x : Server A binary binary operation client: ⊢ ? x ( y ) . y [ 1 ] . y [ 1 ] . case y . { 0 �→ y () . 0; 1 �→ y () . 0 } :: x : Client
Dynamics of Classical Processes ( Cut -Elimination?)
Joined by a Cut : P x A Q x A x P Q Cut-Elimination as Execution Two processes: ⊢ Q :: ∆ , x : A ⊥ ⊢ P :: Γ , x : A
Cut-Elimination as Execution Two processes: ⊢ Q :: ∆ , x : A ⊥ ⊢ P :: Γ , x : A Joined by a Cut : ⊢ Q :: ∆ , x : A ⊥ ⊢ P :: Γ , x : A ⊢ ν x . ( P | Q ) :: Γ , ∆
Cut -elimination yields... . . . . . . P x A i Q i x A i x P Q i (the proof tree has become smaller, and data was moved) Cut-Elimination as Execution . . . . . . . . . ⊢ Q 0 :: ∆ , x : A ⊥ ⊢ Q 1 :: ∆ , x : A ⊥ ⊢ P :: Γ , x : A i 0 1 ⊢ x [ i ] . P :: Γ , x : A 0 ⊕ A i ⊢ x . case ( Q 0 , Q 1 ) :: ∆ , x : A ⊥ 0 & A ⊥ 1 (Cut) ⊢ ν x . ( x [ i ] . P | x . case ( Q 0 , Q 1 )) :: Γ , ∆
Cut-Elimination as Execution . . . . . . . . . ⊢ Q 0 :: ∆ , x : A ⊥ ⊢ Q 1 :: ∆ , x : A ⊥ ⊢ P :: Γ , x : A i 0 1 ⊢ x [ i ] . P :: Γ , x : A 0 ⊕ A i ⊢ x . case ( Q 0 , Q 1 ) :: ∆ , x : A ⊥ 0 & A ⊥ 1 (Cut) ⊢ ν x . ( x [ i ] . P | x . case ( Q 0 , Q 1 )) :: Γ , ∆ Cut -elimination yields... . . . . . . ⊢ Q i :: ∆ , x : A ⊥ ⊢ P :: Γ , x : A i i ⊢ ν x . ( P | Q i ) :: Γ , ∆ (the proof tree has become smaller, and data was moved)
Cut-Elimination as Execution Orientation of Principal Cut s as Reductions : ν x . ( x [] | x () . P ) P − → ν x . ( x [ y ] . ( P | Q ) | R ) ν y . ( P | ν x . ( Q | R )) − → ν x . ( x [ i ] . P | x . case ( Q 0 , Q 1 )) ν x . ( P | Q i ) − → ν x . ( ! x [ y ] . P | ? x ( y ) . Q ) ν y . ( P | Q ) − → ν x . ( ! x [ y ] . P | Q { x / x ′ } ) ν x . ( ! x [ y ] . P | ν x ′ . ( ! x ′ [ y ] . P | Q )) − → ν x . ( ! x [ y ] . P | Q ) Q − →
Cut-Elimination as Execution What if we are stuck? ν z . ( x () . P | Q )
Cut-Elimination as Execution What if we are stuck? ν z . ( x () . P | Q ) x () .ν z . ( P | Q ) − → ν z . ( x [ y ] . ( P | Q ) | R ) x [ y ] . ( ν z . ( P | R ) | Q ) − → ν z . ( x [ y ] . ( P | Q ) | R ) x [ y ] . ( P | ν z . ( Q | R )) − → ν z . ( x ( y ) . P | Q ) x ( y ) .ν z . ( P | Q ) − → ν z . ( x [ i ] . P | Q ) x [ i ] .ν z . ( P | Q ) − → ν z . ( x . case ( P , Q ) | R ) x . case ( ν z . ( P | R ) , ν z . ( Q | R )) − → ν z . ( ! x [ y ] . P | Q ) ! x [ y ] .ν z . ( P | Q ) − → ν z . ( ? x ( y ) . P | Q ) ? x ( y ) .ν z . ( P | Q ) − →
Recommend
More recommend