Chapter 5: Join Calculus - PowerPoint PPT Presentation

About This Presentation
Title:

Chapter 5: Join Calculus

Description:

Chapter 5: Join Calculus Programming Distributed Computing Systems: A Foundational Approach Carlos Varela Rensselaer Polytechnic Institute C. Varela – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 16
Provided by: Rich2151
Learn more at: http://wcl.cs.rpi.edu
Category:

less

Transcript and Presenter's Notes

Title: Chapter 5: Join Calculus


1
Chapter 5 Join Calculus
  • Programming Distributed Computing Systems A
    Foundational Approach
  • Carlos Varela
  • Rensselaer Polytechnic Institute

2
Reflexive CHAMandJoin Calculus
  • Attempt to overcome distribution issues in
    p-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 p-calculus) into a single (joint) receptor
    definition.

3
Reflexive Chemical Abstract Machine
  • xltygt atom
  • M M molecule
  • e.g.
  • readyltlasergt
  • readyltlasergt joblt1gt
  • D or J P reaction
  • e.g.
  • readyltprintergt jobltfilegt printerltfilegt

4
Printer Example
  • 0 readyltlasergt, joblt1gt, joblt2gt
  • 0 readyltlasergt joblt1gt , joblt2gt
  • Let D readyltprintergt jobltfilegt
    printerltfilegt
  • D readyltlasergt joblt1gt, joblt2gt
  • D laserlt1gt, joblt2gt

5
Reflection
  • def D in P molecule
  • 0 def D in readyltlasergt joblt1gt joblt2gt
  • D readyltlasergt joblt1gt joblt2gt

6
Names, Processes, Definitions

def
  • P xltvgt asynchronous polyadic message
  • def D in P definition of new names
  • P P parallel composition
  • J xltvgt join patterns
  • J J
  • D J P matching join
  • D D patterns to processes


def
def
7
Variable Types
  • Received variables (join patterns)
  • rv(xltvgt) u in v
  • rv(J J) rv(J) U rv(J)
  • Defined variables (join patterns and definitions)
  • dv(xltvgt) x
  • dv(J J) dv(J) U dv(J)
  • dv(J P) dv(J)
  • dv(D D) dv(D) U dv(D)



def
def

def
def
def
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(xltvgt) 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)

def
def


def
def
def
9
Operational SemanticsStructural 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
  • sdv instantiates port variable dv(D) to fresh
    names.
  • srv substitutes transmitted names for distinct
    received variables rv(J).

sdv
sdv
srv
srv
10
Examples
  • def xltugt yltugt in P
  • messages on local name x in P are forwarded to
    the outside as messages on y.
  • def yltugt xltugt in def xltugt yltugt in P
  • messages on local name x are forwarded in two
    steps on the external name x (internal x needs
    renaming).
  • def x1ltugt x2ltvgt xltu,vgt in P
  • performs multiplexing of messages on x whose
    parts are supplied on x1 and x2.

11
Examples (continued)
  • def xltvgt yltkgt kltvgt in P
  • models p-calculus-like channels, as values are
    sent on x and requests for values are sent on y.
  • def sltgt P sltgt Q in sltgt
  • express internal non-determinism P Q
  • def onceltgt yltvgt xltvgt in ylt1gt ylt2gt ylt3gt
    onceltgt
  • uses the message on once as a lock for
    non-determinism xlt1gt xlt2gt xlt3gt

12
Recursion Example
  • def loopltgt P loopltgt in loopltgt
  • replicates the process P (!P), starting a new
    copy each time the definition is used.

13
Reference Cell
  • def mkcellltv0, k0gt
    in P
  • P def cltg,sgt sltw1,kgt in mkcell ltw0, cgt

14
Mutual Exclusion
  • def sltgt P sltgt Q sltgt in sltgt
    (semaphore)
  • def
    in sltgt
  • (guarantees mutual exclusion)

15
Dining Philosophers
  • def
    in P
  • P ? (phillti, ci, c(i1)mod ngt chopstickltcigt)

0 i lt n
Write a Comment
User Comments (0)
About PowerShow.com