Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chair of Software Engineering 1 Concurrent Object-Oriented Programming Arnaud Bailly, Bertrand Meyer and Volkan Arslan.

Similar presentations


Presentation on theme: "Chair of Software Engineering 1 Concurrent Object-Oriented Programming Arnaud Bailly, Bertrand Meyer and Volkan Arslan."— Presentation transcript:

1 Chair of Software Engineering 1 Concurrent Object-Oriented Programming Arnaud Bailly, Bertrand Meyer and Volkan Arslan

2 Chair of Software Engineering 2 Lecture 7: Modeling with the Pi-Calculus.

3 Chair of Software Engineering 3 The Pi-calculus  Super-set of CCS.  Allows monadic name communication.  Scope extrusion is fundamental.  Well-developed theory.  Programming languages: PICT, Join, TyCO, …

4 Chair of Software Engineering 4 Pi-Calculus Syntax  We shall omit trailing ’s, as usual.

5 Chair of Software Engineering 5 Free and Bound Names  Free names are names that are not bound.

6 Chair of Software Engineering 6 Substitution  Behaves similarly to the Lambda-Calculus substitution:  replaces the free occurrences of names,  many names can be substituted simultaneously,  substitution may involve renaming of bound names to avoid incidental capture.  Examples:

7 Chair of Software Engineering 7 Pi-Calculus Semantics (1)

8 Chair of Software Engineering 8 Pi-Calculus Semantics (2)

9 Chair of Software Engineering 9 Example: Scope Extrusion

10 Chair of Software Engineering 10 Encoding Polyadic Interactions  We can use these shortcuts transparently.  We introduce notations:

11 Chair of Software Engineering 11 Encoding Named Processes  Defining named processes by adding a context to (plain) terms.

12 Chair of Software Engineering 12 Named Process Example

13 Chair of Software Engineering 13 The Mobile Phone Example  Borrowed from Milner(1991).

14 Chair of Software Engineering 14 The Mobile Phone Example (2)

15 Chair of Software Engineering 15  What happens when the CENTRE give the switching order? The Mobile Phone Example (3)

16 Chair of Software Engineering 16 Encoding Booleans  Now a process has to provide a port, in order to receive an answer!

17 Chair of Software Engineering 17 Encoding Numerals  Define Copy so that:  Solution:  Define Successor so that:  Solution:

18 Chair of Software Engineering 18 Addition and Multiplication

19 Chair of Software Engineering 19 Duplication & Zero Test

20 Chair of Software Engineering 20 Encoding Lists  Define “Pattern Matching”:  Define Concatenation:

21 Chair of Software Engineering 21 Encoding The Lambda-Calculus (!)

22 Chair of Software Engineering 22 Encoding State  A cell with read and write methods can be implemented in many ways. First one:  Second solution with exclusive access:

23 Chair of Software Engineering 23 Synchrony & Asynchrony  Pi-Calculus communication is synchronous:  But a message can be represented by:  Example:

24 Chair of Software Engineering 24 Encoding Objects and Classes  Both objects and classes correspond to processes.  A class is an object with method new:  On the self name is first sent the list of method names.  An object is very much like a mutable cell.  Example:

25 Chair of Software Engineering 25 BBuffer using ACT++ Primitives class BBUFFER is public interface: … // as before behavior: empty= {put} partial= {put, get} full= {get} implementation: Boolean isFull, isEmpty; put (t: OBJECT) is … if (isFull) then become full; else become partial; end; OBJECT: get () is … if (isEmpty) then become empty; else become partial; end; end BBUFFER;

26 Chair of Software Engineering 26 Example: The Bounded Buffer (1)

27 Chair of Software Engineering 27 Example: The Bounded Buffer (2)

28 Chair of Software Engineering 28 Problems  “Faithful” encodings, preserving types.  Complexity of checking properties.

29 Chair of Software Engineering 29 Next  Some specific encodings.  Verifying properties…


Download ppt "Chair of Software Engineering 1 Concurrent Object-Oriented Programming Arnaud Bailly, Bertrand Meyer and Volkan Arslan."

Similar presentations


Ads by Google