Message or Object Origin and Future of ConcurrentMobile



![my CO Computation Model [1977] • Notion of Concurrent Objects – Introducing local state my CO Computation Model [1977] • Notion of Concurrent Objects – Introducing local state](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-4.jpg)







![Conceptual Representations -- examples -(Queue [9 2 4]) -- a queue with three elements Conceptual Representations -- examples -(Queue [9 2 4]) -- a queue with three elements](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-12.jpg)

![Notations for Event/Interaction Specifications <event: [T <= M] <pre-cond: … assertions on local states Notations for Event/Interaction Specifications <event: [T <= M] <pre-cond: … assertions on local states](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-14.jpg)
![Formal Specification of a Queue <event: [queue-class <= (new: (reply-to: customer. CO))] ; ; Formal Specification of a Queue <event: [queue-class <= (new: (reply-to: customer. CO))] ; ;](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-15.jpg)
![Pure/Functional Queue <event: [Q <= (en-q: a)] ; ; enqueuing <pre-cond: (Q is-a (Pure-Queue Pure/Functional Queue <event: [Q <= (en-q: a)] ; ; enqueuing <pre-cond: (Q is-a (Pure-Queue](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-16.jpg)

![Semaphor with P/V-ops Semaphor’s state -- (SEMAPHOR (counter: N) (waiting-q: [!ps]) <event: [S <= Semaphor with P/V-ops Semaphor’s state -- (SEMAPHOR (counter: N) (waiting-q: [!ps]) <event: [S <=](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-18.jpg)







![<event: [ door <= (customer-entering: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (door <event: [ door <= (customer-entering: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (door](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-26.jpg)


![<event: [ mail-box <= (customer: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (mail-box <event: [ mail-box <= (customer: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (mail-box](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-29.jpg)


![Task Specifications [1977] • Specifications of overall functions of a distributed system (e. g. Task Specifications [1977] • Specifications of overall functions of a distributed system (e. g.](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-32.jpg)



![For an event Ec-enter = [door <= (customer-entering: C)] where (C is-a (CUSTOMER (letters: For an event Ec-enter = [door <= (customer-entering: C)] where (C is-a (CUSTOMER (letters:](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-36.jpg)








- Slides: 44

Message or Object? -- Origin and Future of Concurrent/Mobile Objects -Akinori Yonezawa University of Tokyo Invited Talk at FOOL 7 (Foundations of Object. Oriented Languages) in Boston, January. 22, 2000

Modular Actor Formalism for AI • Manifesto/slogan paper by Carl Hewitt et al. (MIT) appeared in Proc. IJCAI’ 73 (Stanford, Aug. 1973) – Procedural Embedding of Knowledge/Data (Minsky School of AI) – Message Passing Paradigm procedural entities get activated by receiving messages. => basic idea of objects – Introducing Inherent Parallelism message transmissions can take place concurrently. => intuitive idea of concurrent objects/actors 2

“Actors” or “Concurrent Objects (COs)” • “Actors” refer to Hewitt & Agha’s model – Hewitt&Baker’s IFIP paper[77]. – Agha’s Actor book[86], established & functional flavored model. mail address, behavior replacement, transition system semantics, … • “COs” refer to Yonezawa’s model – my thesis[77], OOPSLA paper[86], and ABCL book[90]. – thesis is supervised by C. Hewitt and entitled: • “Specification and Verification Techniques for Parall. Moel Programs Based on Message-Passing Semantics, ” (MIT/LCS/TR-191, 1977) 3
![my CO Computation Model [1977] • Notion of Concurrent Objects – Introducing local state my CO Computation Model [1977] • Notion of Concurrent Objects – Introducing local state](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-4.jpg)
my CO Computation Model [1977] • Notion of Concurrent Objects – Introducing local state notions into Actor framework formalism (somewhat against the supervisor’s advice). • Contrasting to Agha&Hewitt’s actor model, which has strong functional flavors, avoiding state notions. – Considering how to optimally distribute (partition ) system’s function over messages and concurrent objects. 4

Concurrent Objects (COs) - 1 -- Computation Model - • a CO has – – – globally unique identity/name. protected updateable local memory. a set of procedures attached to the memory. procedure gets activated by receiving a specified message. a single FIFO queue of arrived messages. autonomous thread(s) of control. non-state-updating threads can be concurrent. 5

Concurrent Objects (COs) - 2 -- Computation Model - • In a CO, – memory-updating procedures are activated one at a time with corresponding message arrival order. – its local state can be defined at the time of message arrival, owing to its single FIFO message queue. • a CO can – send messages to the COs whose ids it knows about at the time of sending. -- point-to-point communication – remember and forget the names of other COs. -- dynamic topology for message transmission – dynamically create COs. 6

What to be Transmitted to a Concurrent Object? -- Messages or Objects— • message tags/headers, values, CO-ids, … • COs should be allowed to be transmitted! – origin of mobile/migratory objects – see “Cambridge Post Office” example – my modeling Post Office suggests “Ambient. ” • COs in motion can receive messages 7

Specifying Behavior of COs - Local State Approach • Use of “Conceptual Representations” – for describing states of individual COs. • Separation of CO’s state and its identity – for describing mutable COs. • Specifications of interactions of COs – “event specifications” – “task specifications” for collective behavior by of Cos. 8

Formal Specification Language • Describing local states of a CO – by conceptual representations which use • conceptual name, • abstract { sequences, records, sets } e. g. , (Queue [h !tl ]), (Mail. Collector {!letter}) (Post. Office {c 1, c 2, c 3}) (c 2 is-a (Counter q 2)) (c 3 is-a (Mail. Box {!m})) 9

Formal Specification Lang. (cont. ) • Describing interactions of – a CO and a message – a CO and a CO • Describing caused events/effects – changes in local states of COs – creation of new COs – caused message transmissions • First order language on event ordering 10

Specification of Interactions • “Interaction” means – a message arrives at a CO. – COs collide. • Interactions are often called “Events. ” 11
![Conceptual Representations -- examples -(Queue [9 2 4]) -- a queue with three elements Conceptual Representations -- examples -(Queue [9 2 4]) -- a queue with three elements](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-12.jpg)
Conceptual Representations -- examples -(Queue [9 2 4]) -- a queue with three elements (Queue [8 !r]) – a queue with first element being 8 (Queue [!r 8]) – a queue with last element being 8 (Cons-cell (car: 1)(cdr: 7)) – a Lisp cons-cell (Semaphor (counter: 1)(waiting-processes: [!wps])) – a semaphor with processes suspended (Collection {… 9 … 7 …}) – a collection containing 9 and 7 12

Separation of Identity and State • a CO has mutable states and is shared and referenced to by more than one CO. – formal specifications need to describe CO’s state and identity separately!! – e. g. , (q is-a (Queue [9 11 7])) in Situation-1, (q is-a (Queue [9 11 7 13])) in Situation-2 13
![Notations for Event/Interaction Specifications <event: [T <= M] <pre-cond: … assertions on local states Notations for Event/Interaction Specifications <event: [T <= M] <pre-cond: … assertions on local states](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-14.jpg)
Notations for Event/Interaction Specifications
![Formal Specification of a Queue <event: [queue-class <= (new: (reply-to: customer. CO))] ; ; Formal Specification of a Queue <event: [queue-class <= (new: (reply-to: customer. CO))] ; ;](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-15.jpg)
Formal Specification of a Queue
![Pure/Functional Queue <event: [Q <= (en-q: a)] ; ; enqueuing <pre-cond: (Q is-a (Pure-Queue Pure/Functional Queue <event: [Q <= (en-q: a)] ; ; enqueuing <pre-cond: (Q is-a (Pure-Queue](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-16.jpg)
Pure/Functional Queue

Interaction between Vender and Customer Vendor’s state -- (VENDER (bills: {…}) (goods: {…})) Customer’s state -- (CUSTOMER (bills: {…}) (belongings: {…}))
![Semaphor with P/V-ops Semaphor’s state -- (SEMAPHOR (counter: N) (waiting-q: [!ps]) <event: [S <= Semaphor with P/V-ops Semaphor’s state -- (SEMAPHOR (counter: N) (waiting-q: [!ps]) <event: [S <=](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-18.jpg)
Semaphor with P/V-ops Semaphor’s state -- (SEMAPHOR (counter: N) (waiting-q: [!ps])

A Good Convincing Example • Advisor suggested me to find a Good example. – intuitively clear, yet reasonably complex – high internal concurrency • Cambridge Post Office (CPO) is chosen: – a number of customers visit a post office. – each customer comes to a post office counter if necessary. – buys stamps or do registration – puts stamps on envelops – put them into the mail box, and leave the post office – mail collectors come to collects mail … 19

Cambridge Post Office counter-section mailbox door 20

How to Model CPO with COs • Let door CO represents the building of Post Office. • customer’s entering/exiting the PO is modeled by transmission of customer CO to/from the door CO. • the state of Post Office is represented by that of the door CO. 21

State of the PO (door CO) • We define the state of the PO at the time of message arrival by – a set of all customers inside the post office, – a set of all collectors inside the post office, and – a set of all mail inside the post office. (POST-OFFICE (mail: {…})(customers: {…})(collectors: {…}) (door is-a (POST-OFFICE … (customers: {!cs})(collectors: {!cls}))) 22

Messages/COs sent to door CO Four kinds: (customer-entering:

States of Customer and Collector (CUSTOMER (letters: {…})(#-of-stamps-needed: n)) (COLLECTOR (collected-mail: {…})) 24

Interactions between the door CO and a customer CO See next slide. 25
![<event: [ door <= (customer-entering: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (door <event: [ door <= (customer-entering: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (door](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-26.jpg)

Interactions between the door CO and a collector CO similar to the previous side 27

States of Mail Box CO / Interactions at Mail Box CO (MAIL-BOX (posted-mail: {!m})) See next slide for interaction specs. 28
![<event: [ mail-box <= (customer: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (mail-box <event: [ mail-box <= (customer: C)] <pre-cond: (C is-a (CUSTOMER (letters: {!l})(#-of-stamps-needed: N))) (mail-box](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-29.jpg)

Ambient Calculi -- L. Cardelli & A. Gordon -- • a great work of formalizing mobile and concurrent objects!! 30

Is the PO an Ambient? • PO building can be viewed as an ambient of Cardelli & Gordon’s calculus. po[MAILBOX | COUNTER | …CUSTOMERi…] | in po CUSTOMERj po[MAILBOX | COUNTER | … out po I-CUSTOMERm…] 31
![Task Specifications [1977] • Specifications of overall functions of a distributed system (e. g. Task Specifications [1977] • Specifications of overall functions of a distributed system (e. g.](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-32.jpg)
Task Specifications [1977] • Specifications of overall functions of a distributed system (e. g. , OS, the Post Office) • Task spec. needs to be derived/verified through specs of individual CO’s behavior and their interactions. 32

Task Spec. 1 • Customer eventually leaves the PO. • When the customer leaves, he carries no letter and needs no stamp.

Task Spec. 2 • Collectors eventually leaves the PO. • When a collector leaves, he always carries the letters that he carried in.

Task Spec. 3 • Let {!m} be a set of letters brought into the PO by a customer C. If there is a collector CL who enters the PO after the customer C leaves, then there exits a collector who brings the set {!m} of letters out of the PO to the street. a more formal version is written in our spec. language with the ordering of the events specified. (see next slide) 35
![For an event Ec-enter = [door <= (customer-entering: C)] where (C is-a (CUSTOMER (letters: For an event Ec-enter = [door <= (customer-entering: C)] where (C is-a (CUSTOMER (letters:](https://slidetodoc.com/presentation_image_h/c21f8b09c2cd9079c6eaf123106b8f66/image-36.jpg)
For an event Ec-enter = [door <= (customer-entering: C)] where (C is-a (CUSTOMER (letters: {!m})(#-of-stamps-needed: N)))), if there exits an event Ecl-enter = [door <= (collector-entering: CL)] such that Ec-enter --> Ec-exit -arr->door Ecl-enter where Ec-exit = [door <= (customer-exiting: C)], then there must exit an event Ecll-street = [street <= CLL] such that (CLL is-a (COLLECTOR (collected-mail: {…!m…}))). -arr->door : order of message arrival at door CO 36

Assumptions of No Implicit Interactions for verifying task specs • Assumption-1: customers and collectors do not receive any message except those explicitly stated in the event specifications. • Assumption-2: the counter and the mail box interact with only the customers and collectors which are in the PO. 37

Comments on Ambient Calculi • a great series of work!! • what kinds of properties to describe and prove? – The above “task specifications” can be stated? • in case where local states of ambients need to be referred to. • Eventuality with state descriptions? – “Assumptions of No Implicit Interactions” are taken care of in Ambient Caluculi. – What about security proof of implementation code? 38

I am now working on Autonomous Mobile Objects • Used to think about eliminating artificial dichotomy of objects and messages. – messages can be objects. – object can be messages. – both can move and be transmitted and persistent. • Now working on AMOs (Autonomous Mobile Objects), which move on their initiative. 39

Our Mobile Object Languages • Java. GO • Mobile. ML 40

Java. GO – Allows to put go

Java. GO (cont. ) • The language system is available: http: //www. yl. is. s. u-tokyo. ac. jp/amo/ • Using the language, we are implementing network games a la “Pokemon” and “Magic, the Gathering. ” 42

Mobile. ML – Has an ML-style type system. – Code migrates to a program context in other site. context k withhole X = let name = “HAL” in X; ; ; at site “hal: : 2001” – Allows to put go expressions anywhere in ML code. – An agent expression agent (e) containing go

Mobile. ML (cont. ) – Based on A Typed Context Calculus (M. Hashimoto and A. Ohori, to appear in TCS) A Calculus with Code Mobility (T. Sekiguchi and A. Yonezawa, FMOODS’ 97) 44
Display Object Display Object Display Object Display Object
Origin of Life Origin of Universe Origin of
Record Message Play Message Delete Message Set Clock
Object Recognizing Object Classes Individual Recognition Object parts
Indirect Object Pronouns Indirect Object Pronouns Indirect object
Properties18 xls Object VBA VBA Object Property Object
Future perfect X Future continuous Future continuous Future
Origin and Objective of the Kano Model Origin