multiport interaction nets and concurrency
play

Multiport Interaction Nets and Concurrency Damiano Mazza Institut - PowerPoint PPT Presentation

Multiport Interaction Nets and Concurrency Damiano Mazza Institut de Math ematiques de Luminy Marseilles, France CONCUR 2005 San Francisco, 23 August 2005 Interaction Net Systems: cells, wires, nets Interaction Net Systems were introduced


  1. Multiport Interaction Nets and Concurrency Damiano Mazza Institut de Math´ ematiques de Luminy Marseilles, France CONCUR 2005 San Francisco, 23 August 2005

  2. Interaction Net Systems: cells, wires, nets Interaction Net Systems were introduced by Yves Lafont (1990) as a generalization of MLL proof-nets. The basic elements of an Interaction Net System (INS for short) are cells and wires : auxiliary ports . . . α wire principal port Wires can be used to connect occurrences of cells to form nets : ε ε ε δ γ γ γ ε δ δ γ A set Σ of cells is called an alphabet . Slide 1/19

  3. Interaction Net Systems: interaction When two cells are connected through their principal ports, they form an active pair . Active pairs can be reduced by means of interaction rules of the following form: . . . . . . . . . . . . α β → α ⊲ ⊳ β ◮ α ⊲ ⊳ β is a net whose free ports are in bijection (implicitly given by the graphical representation) with the auxiliary ports of α, β . ◮ Reduction step: replace an active pair α, β of a net µ with α ⊲ ⊳ β (this is why a bijection is needed), yielding a new net µ ′ . We then write µ → µ ′ . ◮ An INS is defined by an alphabet (maybe infinite, but denumerable) and a set of interaction rules (at most one per active pair). ◮ We can use a type discipline to limit the possible connections/active pairs. Slide 2/19

  4. Interaction Net Systems: properties ◮ Strong confluence → no reduction strategies → strong determinism. ◮ Turing-completeness: given a Turing machine, there exists an INS simulating it. ◮ The “right” syntax for the Geometry of Interaction (Girard, 1988, Gonthier-Abadi- L´ evy, 1992, Interaction Combinators, Yves Lafont, 1995). ◮ All of these properties are a consequence of the locality of interaction. ◮ Limitation: INS’s model distributed, but sequential computation, i.e., there is no parallel-or, gustave , etc. → truly concurrent behavior is excluded. Slide 3/19

  5. Multiport Interaction Net Systems Cells are allowed to have more than one principal port ( multicells , opposed to mono- cells ). Active pairs are still cells having one of their principal ports wired together: . . . . . . . . . . . . α β . . . . . . . . . . . . α i ⊲ ⊳ β j − → σ i σ j . . . . . . . . . . . . We have used the two wirings σ i and σ j just for graphical convenience; they are not part of the interaction. Notice that a multicell can be involved in several active pairs; the choice of which one is reduced is non-deterministic. Thus, in general, we have lost confluence, but we have gained in expressive power ( parallel-or is easily encodable). Slide 4/19

  6. The “core” π -calculus The “core” π -calculus ( C π for short) can be seen as a synchronous and extended version of the Pict language (Pierce and Turner, 1997): � � x ( z ) π ::= xy Prefixes: � � π κ ::= x ( z ) Extended prefixes: � � � � � π.P � P | Q � κ ⊲ P � ν ( z ) P P, Q ::= 0 Processes: Reduction: xy.P | x ( z ) .Q − → P | Q { y/z } xy.P | x ( z ) ⊲ Q − → P | Q { y/z } | x ( z ) ⊲ Q x ( z ) ⊲ P | x ( z ) .Q − → ν ( z )( P | Q ) | x ( z ) ⊲ P Structural congruence: as in the finite π -calculus, i.e., no such thing as ! P ≡ P | ! P Slide 5/19

  7. Names as multicells We shall now define an encoding of �·� of C π processes into Multiport Interaction Nets. The key point is encoding names, i.e., concurrent communication channels. Multicells are going to be fundamental here: synchronization input queue output queue X m i/o requests . . . m principal ports Slide 6/19

  8. Synchronization Prefixes are encoded by means of two binary monocells π − , π + : − + N C C N X m +2 π + π − . . . . . . . . . xy.P | x ( z ) .Q | R − → P | Q { y/z } | R Slide 7/19

  9. Synchronization Upon interaction, prefixes become queue constructors: − + N C C N ρ − X m +1 π + . . . . . . xy.P | x ( z ) .Q | R − → P | Q { y/z } | R Slide 7/19

  10. Synchronization The i/o queues are built according to the (non-deterministic) reduction order: − + N C C N ρ − ρ + X m . . . xy.P | x ( z ) .Q | R − → P | Q { y/z } | R Slide 7/19

  11. Synchronization The top elements of the two queues eventually meet, implementing synchronization: N C C N ρ + ρ − X m . . . xy.P | x ( z ) .Q | R − → P | Q { y/z } | R Slide 7/19

  12. Synchronization The name sent is connected to the receiver, and the two continuations communicate: N C C N X m . . . xy.P | x ( z ) .Q | R − → P | Q { y/z } | R Slide 7/19

  13. Name passing We use a family of monocells B n (of arity n ) to collect the occurrences of a name bound by an input prefix. Name passing is thus implemented by the following rule: . . . . . . X m +1 X m + n B n − → . . . . . . . . . . . . ω i . . . Slide 8/19

  14. Guards To encode guards, we use two families of monocells Λ + n , Λ − n , of arity 2 n : . . . . . . . . . . . . Λ + Λ − n k → Suppose � P � is already defined; then we build the net .P � as follows: . . . . . . x 1 x k . . . µ µ . . . . . . . . . .P � = . . . � P � = = ⇒ x 1 x k Λ � k + c c active pairs contained in � P � In practice, active pairs (both present and future) are “inhibited”, and restored upon synchronization. Slide 9/19

  15. Replication We can use two standard duplicator cells δ + , δ − , with the following rules: . . . . . . δ � δ + α δ − δ � 1 δ � n α α − → − → . . . . . . α is any cell except X m and δ − � X m +1 X m +2 δ + . . . . . . − → ω i . . . . . . Problem: only reduced nets containing no X m or δ � cells can be duplicated. Slide 10/19

  16. Replicated guards Suppose that .P � is a net containing n X -cells and (among others) k free ports labelled with the name z : X m 1 X m n z z . . . . . . . . . . . . . . . µ .P � = Then, we define ⊲ P � and ⊲ P z as follows: N n N n +1 . . . . . . ! X k +1 z z ! X m 1 ! X m n ! X m 1 ! X m n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . µ µ σ � ⊲ P � ⊲ P z Slide 11/19

  17. Replicated guards We also add a zeroary monocell ϕ with the following interaction rules: . . . . . . ϕ N n ϕ ϕ X m → → . . . ! X m ϕ . . . The following property holds: . . . . . . ⊲ P � δ � 1 δ � n σ � → ∗ . . . . . . δ − � δ + ⊲ P � .P � σ � ϕ Slide 12/19

  18. Replicated prefixes Additional monocells ! π − , ! π + (arity 4 ) and ! ρ − , ! ρ + (arity 5 ) are used to encode replicated prefixes and their respective queue constructors. Synchronization of replicated prefixes involves dispatching duplicators and ϕ cells appropriately: δ + δ + δ + δ + δ + δ + δ − δ − ! ρ + ! ρ − ϕ ϕ ! π + ! π − − → There is of course also the “asymmetric” case in which a ! ρ � cell interacts with a ρ − � cell, in which duplicators are dispatched only on one side. Slide 13/19

  19. Inductive definition of the encoding ◮ � 0 � is the empty net. ◮ � P | Q � is the net obtained by juxtaposing � P � and � Q � . ◮ � π.P � is the following net, depending on the nature of π : . . . y . . . . . . . . . .P + B n .P − � x ( z ) .P � = � xy.P � = π − π + x x In the encoding of the input prefix, the n free ports of .P − labelled by z are connected to the B n cell. Slide 14/19

  20. Inductive definition of the encoding ◮ � κ ⊲ P � is the following net, depending on the nature of κ : x y . . . x x . . . . . . . . . . . . ⊲ P + ⊲ P z B n ⊲ P − ! π + ! π + ! π − x x x � xy ⊲ P � � x ( z ) ⊲ P � � x ( z ) ⊲ P � ◮ If � P � has m free ports labelled by z , then � ν ( z ) P � is the net obtained from � P � by connecting all such free ports to the free ports of the following net: X m . . . Remark: this is the only case in which active pairs may be introduced. Slide 15/19

  21. The strong encoding So far the encoding is only able to implement synchronizations which are due on restricted channels, so we force our processes to be “closed”: Definition 1 Let x range over fn ( P ) ; if in � P � there are m free ports labelled by x , we define [ P ] as the net obtained from � P � by connecting all such ports to a X m +1 cell, which will be left with one free port labelled by x : X m +1 . . . x [ P ] is virtually identical to � ν ( � x ) P � , where � x are the free names of P , the only difference being that we want to remember the names we artificially bound. Slide 16/19

  22. Readback The encoding commutes with reduction only modulo a readback procedure: X m + n + p Q + Q − n p ! π − π + ! π + π − � . . . . . . . . . . . . . . . X m . . . X m +1 x x � . . . x m m The readback procedure “undoes” the choices made in queuing up prefixes and ν the readback of a net ν . removes artificial name restrictions. We denote by � Only the reduction of active pairs involving ρ � and/or ! ρ � cells affects the readback. We write µ ։ ν iff the reduction from µ to ν contains exactly one such reduction. Slide 17/19

Recommend


More recommend