Download presentation
Presentation is loading. Please wait.
Published byAmie Hodges Modified over 9 years ago
1
C. Varela1 Chapter 5: Join Calculus Programming Distributed Computing Systems: A Foundational Approach Carlos Varela Rensselaer Polytechnic Institute
2
Reflexive CHAM and Join Calculus Attempt to overcome “distribution” issues in π-calculus, yet keeping formal investigation results. Bridge gap between theory and practice, and form the basics for a programming language. Imposes locality and adds reflexion to generic CHAM of Boudol and Berry. Combines restriction, reception, and replication (of π- calculus) into a single (joint) receptor definition. C. Varela2
3
Reflexive Chemical Abstract Machine x atom M | M molecule e.g. ready ready | job D or J P reaction e.g. ready | job printer C. Varela3
4
Printer Example 0 ├ ready, job, job 0 ├ ready | job, job Let D = ready | job printer D ├ ready | job, job D ├ laser, job C. Varela4
5
Reflection def D in Pmolecule 0 ├ def D in ready | job | job D ├ ready | job | job C. Varela5
6
Names, Processes, Definitions P= x asynchronous polyadic message def D in Pdefinition of new names P | Pparallel composition J = x join patterns J | J D = J Pmatching join D Dpatterns to processes C. Varela6 def ~ ~
7
Variable Types Received variables (join patterns) rv(x ) = {u in v} rv(J | J ’ ) = rv(J) U rv(J ’ ) Defined variables (join patterns and definitions) dv(x ) = {x} dv(J | J ’ ) = dv(J) U dv(J ’ ) dv(J P) = dv(J) dv(D D ’ ) = dv(D) U dv(D ’ ) C. Varela7 ~~ def ~
8
Free Variables (processes and definitions) fv(J P) = dv(J) U (fv(P) – rv(J)) fv(D D ’ ) = fv(D) U fv(D ’ ) fv(x ) = {x} U {u in v} fv(def D in P) = (fv(P) U fv(D)) – dv(D) fv(P | P ’ ) = fv(P) U fv(P ’ ) C. Varela8 ~ def ~
9
Operational Semantics Structural Equivalence (str-join) ├ P | Q ├ P,Q (“ “ heating, “ “ cooling) (str-and)D E ├ D,E├ (str-def)├ def D in P D ├ P (red)J P ├ J J P ├ P σ dv instantiates port variable dv(D) to fresh names. σ rv substitutes transmitted names for distinct received variables rv(J). C. Varela9 σ dv σ rv
10
Examples 1.def x y in P messages on local name x in P are forwarded to the outside as messages on y. 2.def y x in def x y in P messages on local name x are forwarded in two steps on the external name x (internal x needs renaming). 3.def x 1 | x 2 x in P performs multiplexing of messages on x whose parts are supplied on x 1 and x 2. C. Varela10
11
Examples (continued) 4.def x | y k in P models π-calculus-like channels, as values are sent on x and requests for values are sent on y. 5.def s<> P s<> Q in s<> express internal non-determinism P + Q 6.def once<> | y x in y | y | y | once<> uses the message on once as a lock for non-determinism x + x + x C. Varela11
12
Recursion Example def loop<> P | loop<> in loop<> replicates the process P (!P), starting a new copy each time the definition is used. C. Varela12
13
Reference Cell def mkcell in P P = def c s in mkcell C. Varela13 def get | s k | s set | s k<> | s in s | k 0
14
Mutual Exclusion def s<> P | s<> Q | s<> in s<> (semaphore) def in s<> (guarantees mutual exclusion) C. Varela14 s<> def J P s<> in J P s<> def J Q s<> in J Q
15
Dining Philosophers def in P P = Π (phil | chopstick ) C. Varela15 phil def l<> | r<> eat | l<> | r<> in 0 chopstick c<> 0 ≤ i < n
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.