130 likes | 318 Views
Chapter 6: Ambient Calculus. Programming Distributed Computing Systems: A Foundational Approach Carlos Varela Rensselaer Polytechnic Institute. Mobile Ambients. Locations represented by a topology of boundaries Not identified with globally vague names
E N D
Chapter 6: Ambient Calculus Programming Distributed Computing Systems: A Foundational Approach Carlos Varela Rensselaer Polytechnic Institute C. Varela
Mobile Ambients • Locations represented by a topology of boundaries • Not identified with globally vague names • Process mobility represented as crossing of boundaries • Not as communication of processes or process names over channels • Security represented as ability/inability to cross boundaries • Interaction between processes is by shared location within a common boundary C. Varela
Mobile Ambients n names P,Q ::= processes (n)P 0 P | Q !P n[P] M.P M ::= capabilities in n out n open n C. Varela
Entry Capability n[ in m.P | Q] | m[ R ] m[ n[ P | Q ] | R ] n m m | in m.P | Q R n | R P| Q C. Varela
Exit Capability m[ n [ out m.P | Q ] | R ] n [ P | Q ] | m[ R ] m n m n |R P | Q R | out m.P | Q C. Varela
Open Capability open m.P | m[ Q ] P | Q open m.P | P | Q m Q C. Varela
Subjective/Objective Moves Subjective moves: n[ in m.P | Q ] | m[ R ] m[ n[ P | Q] | R m[ n[ out m.P | Q ] | R ] m[ R ] | n[ P | Q ] open m.P | m[ Q ] P | Q Objective moves: mv in m.P | m[ R ] m[ P | R ] m[ mv out m.P | R ] P | m[ R ] Ambient I/O: (x).P input <x> output (x).P | <m> P{M/x} [or P{x m} C. Varela
Encoding Objective MovesWith Subjective Moves allow n = !open n mv in n.P = (k) k[ in n.enter[ out k.open k.P ] ] mv out n.P = (k) k[ out n.exit[ out k.open k.P ] ] n [ P ] = n[ P | allow enter ] n [ P ] = n[ P ] | allow exit n [ P ] = n[ P | allow enter ] | allow exit C. Varela
Exercises Prove: • mv in n.P | n [ Q ] * n [ P | Q ] • n [ mv out n.P | Q ] * n [ Q ] | P C. Varela
Reference Cell cell c w = c [ <w> ] get c (x).P = mv in c.(x).(<x> | mv out c.P) set c<w>.P = mv in c.(x).(<w> | mv out c.P) C. Varela
Mutual Exclusion acquire n.P = open n.P release n.P = n[] | P acquire l.P | release l.Q = open l.P | l[] | Q P | 0 | Q ≡ P | Q C. Varela
Dining Philosophers phil l r = !(acquire l.acquire r.(release l | release r)) fork f = release f 2-table = phil f1 f2 | phil f2 f1 | fork f1 | fork f2 2-table-nd = phil f1 f2 | phil f1 f2 | fork f1 | fork f2 3-table = phil f1 f2 | phil f2 f3 | phil f3 f1 | fork f1 | fork f2 | fork f3 C. Varela