Concurrent pattern calculus IFIP TCS 2010 Thomas Given-Wilson 1 Daniele Gorla 2 Barry Jay 1 September 22, 2010 1 QCIS & SoS, University of Technology, Sydney 2 Dip. di Informatica, Univ. di Roma “La Sapienza” Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Outline Motivation Concurrent Pattern Calculus Trade Example Relation to other calculi Conclusions and Future work Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Motivation I - Computation Pattern calculus [Jay09] generalises lambda calculus by driving reduction by pattern matching. The key idea is intensional treatment of arguments: ( x y → s )( d u ) �− → { d / x , u / y } s Pattern matching in process calculi: data structures (CSP) one channel name ( π -calculus [MPW92]) arity (polyadic π -calculus) many names and arity (Linda [Gel85]) decompose pairs (Spi calculus [GA97]) Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Motivation II - Symmetry Lambda calculus has function and argument based upon application, but parallel composition of processes is symmetric. So generalise from pattern matching, to pattern unification where both processes in an interaction as equal. Pattern unification needs to support: input output equality of names structure all in a single interaction. Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Motivation III - Trade Trade is inherently symmetrical with two parties exchanging information in a single interaction. Consider stock trading. A buyer and seller wish to trade in a company’s stock. They must agree upon the company. The buyer exchanges payment information for the seller’s share certificates. Trade should be atomic, either the exchange succeeds or fails. It should not be possible for one party or the other to receive information without giving out their own. Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Concurrent Pattern Calculus Patterns to support: output, equality tests, input, and structure. p , q ::= x | � x � | λ x | p • q Unification of two patterns { p | | q } seeks substitutions on their binding names: { x | | x } { x | | � x � } = Some ( {} , {} ) { � x � | | x } { � x � | | � x � } { λ x | | q } = Some ( { q / x } , {} ) ... { p | | λ x } = Some ( {} , { p / x } ) ... { p 1 • p 2 | | q 1 • q 2 } = Some (( σ 1 ∪ σ 2 ) , ( ρ 1 ∪ ρ 2 )) ... { p | | q } = undefined otherwise. Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Concurrent Pattern Calculus II Process generalised from π -calculus: P ::= 0 | P | P | ! P | ( ν x ) P | p → P with a single new prefix, the case p → P with pattern p body P . Interaction rule given by: p → P | q → Q �− → σ P | ρ Q where { p | | q } = Some ( σ, ρ ). Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Simple trade problem Two traders interested in trading shares of the ABC company. A seller with desire to sell ABC number of shares to sell 100 offer price $0.38 share certificate Cert requires billing account λ a A buyer with desire to buy � ABC � number of shares to buy 100 requires some price λ p requires a certificate λ c has bank account b Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Simple trade solution Represent the a seller: ( ABC • 100 • $ 0 . 38 • Cert • λ a ) → S ( a ) . and the buyer ( � � • 100 • λ p • λ c • b ) → B ( p , c ) . ABC where S ( a ) and B ( p , c ) are successful completion. Their interaction is ABC • 100 • $ 0 . 38 • Cert • λ a → S ( a ) | � ABC � • 100 • λ p • λ c • b → B ( c ) �− → { b / a } S ( a ) | { $0 . 38 / p , Cert / c } B ( p , c ) = S ( b ) | B ($ 0 . 38 , Cert ) . Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Valid encodings An encoding is valid if it satisfies five properties [Gor08]: 1 Compositionality 2 Name invariance 3 Operational correspondence 4 Divergence reflection 5 Success sensitiveness Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Relation to π -calculus Concurrent pattern calculus can encode π -calculus, the interesting process forms are: def [ [ n ( x ) . P ] ] = n � • λ x • z → [ [ P ] ] fresh z � def [ [ n � x � . P ] ] = n � • x • λ z → [ [ P ] ] fresh z � The reverse is not possible, consider the self-matching process x → √ that interacts with itself x → √ | x → √ √ | √ �− → There is no π -calculus process P that reduces in parallel with itself, but does not reduce alone. Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Relation to Spi calculus Concurrent pattern calculus can encode Spi calculus. Selected (for flavour) terms def [ [ ( M , N ) ] ] = pair • [ [ M ] ] • [ [ N ] ] def [ [ { M } N ] ] = encr • [ [ M ] ] • [ [ N ] ] and selected processes def [ [ let ( x , y ) = M in P ] ] = ( ν n )( � n � • (pair • λ x • λ y ) → [ [ P ] ] | � n � • [ [ M ] ] → 0 ) def [ [ case M of { x } N : P ] ] = ( ν n )( � n � • (encr • λ x • [ [ N ] ]) → [ [ P ] ] | � n � • [ [ M ] ] → 0 ) . The reverse is not possible, again consider the self-matching process. Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Relation to fusion calculus Concurrent pattern calculus and Fusion calculus [PV98] are unrelated. Theorem There exists no valid encoding of Fusion into CPC. Proof: [Sketch] Create a reduction in fusion calculus that requires three processes to cooperate, CPC interactions are binary. � Theorem There exists no valid encoding of CPC into Fusion. Proof: [Sketch] CPC can match an infinite number of names in a single interaction, fusion is limited to one. � Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Conclusions Concurrent pattern calculus is an elegant model that supports input, output, and equality tests in an atomic interaction symmetric exchange of information lambda calculus computation (through encoding π -calculus) encodings of many popular calculi There is also an implementation of concurrent pattern calculus in bondi [cpc10]. Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Future Work Many areas still to work on: Relation to computation: pattern calculus, SF-logic [JGW] Relation to other process calculi (many more out there) Security and encryption Develop applications Thank you for listening, any questions? Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Bibliography CPC bondi, 2010. Retrieved 2 September 2010, from http://progsoc.uts.edu.au/˜sanguinev/files/bondi.tar. A.D. Gordon and M. Abadi. A calculus for cryptographic protocols: The spi calculus. 4th ACM Conference on Computer and Communications Security , pages 36 – 47, 1997. David Gelernter. Generative communication in Linda. ACM Trans. Program. Lang. Syst. , 7(1):80–112, 1985. D. Gorla. Towards a unified approach to encodability and separation results for process calculi. In F. van Breugel and M. Chechik, editors, Proc. of 19th International Conference on Concurrency Theory (CONCUR’08) , number 5201 in LNCS, pages 492–507. Springer, 2008. Barry Jay. Pattern Calculus: Computing with Functions and Data Structures . Springer, 2009. Barry Jay and Thomas Given-Wilson. A combinatory approach to internal structure. to appear in Journal of Symbolic Logic . Robin Milner, Joachim Parrow, and David Walker. A calculus of mobile processes, I–II. Information and Computation , 100(1):1–77, 1992. J. Parrow and B. Victor. The fusion calculus: expressiveness and symmetry in mobile processes. Logic in Computer Science, 1998. Proceedings. Thirteenth Annual IEEE Symposium on , pages 176–185, 1998. Thomas Given-Wilson , Daniele Gorla , Barry Jay 1 Concurrent pattern calculus
Recommend
More recommend