Matt B. Pedersen & Matthew Sowders University of Nevada, Las Vegas
1
Matt B. Pedersen & Matthew Sowders University of Nevada, Las - - PowerPoint PPT Presentation
Matt B. Pedersen & Matthew Sowders University of Nevada, Las Vegas 1 Added mobile processes to ProcessJ With polymorphic interfaces Multiple interfaces to the same process Different set of formal parameters per interface
1
mobile void foo (int x, int y) { ... while (...) { ... suspend resume with (int z) ... } }
2
mobile void foo (int x, int y) { ... while (...) { ... suspend resume with (int z) ... } }
3
MOBILE PROC reindelf (CHAN AGENT.INITIALIZE initialize?, SHARED CHAN AGENT.MESSAGE report!, SHARED CHAN INT santa.a!, santa.b!) IMPLEMENTS AGENT ... local state declarations SEQ ... in station compound (initialise local state) WHILE TRUE SEQ ... in station compound SUSPEND -- move to gathering place ... in the gathering place SUSPEND -- move to santa’s grotto ... in santa’s grotto SUSPEND -- move to compound : From: Santa Claus – with mobile reindeer and elves, CPA Fringe presentation 2008
4
MOBILE PROC reindelf (CHAN AGENT.INITIALIZE initialize?, SHARED CHAN AGENT.MESSAGE report!, SHARED CHAN INT santa.a!, santa.b!) IMPLEMENTS AGENT ... local state declarations SEQ ... in station compound (initialise local state) WHILE TRUE SEQ ... in station compound SUSPEND -- move to gathering place ... in the gathering place SUSPEND -- move to santa’s grotto ... in santa’s grotto SUSPEND -- move to compound : These are all the same interface:
(CHAN AGENT.INITIALIZE initialize?, SHARED CHAN AGENT.MESSAGE report!, SHARED CHAN INT santa.a!, santa.b!)
5
MOBILE PROC reindelf (CHAN AGENT.INITIALIZE initialize?, SHARED CHAN AGENT.MESSAGE report!, SHARED CHAN INT santa.a!, santa.b!) IMPLEMENTS AGENT ... local state declarations SEQ ... in station compound (initialise local state) WHILE TRUE SEQ ... in station compound SUSPEND -- move to gathering place ... in the gathering place SUSPEND -- move to santa’s grotto ... in santa’s grotto SUSPEND -- move to compound :
The Initialize channel is only used in ... local state declaration Subsequent re-animations of reindelf must thus provide ‘dummy’ values for this channel.
6
7
mobile void foo (int x, int y) { B1 while (B2) { B3 suspend resume with (int z) B4 } B5 }
8
mobile void foo (int x, int y) { B1 while (B2) { B3 suspend resume with (int z) B4 } B5 }
9
mobile void foo (int x, int y) { B1 while (B2) { B3 suspend resume with (int z) B4 } B5 }
10
mobile void foo (int x, int y) { B1 while (B2) { B3 suspend resume with (int z) B4 } B5 }
11
12
13
14
mobile void foo (int x, int y) { B1 while (B2) { B3 suspend resume with (int z) B4 } B5 }
foo (int x, int y)
foo (int z)
15
16
mobile void foo (int x, int y) { B1 while (B2) { B3 suspend resume with (int z) B4 } B5 }
17
18
19
20
21
22
mobile void foo (int x, int y) { B1 while (B2) { B3 suspend resume with (int z) B4 } B5 }
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
mobile void foo {+T0 (int x, int y) {+T1
}-T1 }-T0
42
43
44
{1,2,3,4,5} {1,2,3,4,5} {1,2,3,4,5}
45
46
N V int x int y { 1 } T0
47
N V int x int y { 1 } T0 N V int a { 1, 2, 3, 4, 5 } T1
48
N V int x int y { 1 } T0 N V int a { 1, 2, 3, 4, 5 } T1 N V int q { 1, 2, 3, 4, 5 } T2
49
N V int x int y { 1 } T0 N V int a { 1, 2, 3, 4, 5 } T1 N V int q { 1, 2, 3, 4, 5 } T2 N V int z { 4 } T3
50
N V int x int y { 1 } T0 N V int a { 1, 2, 3, 4, 5 } T1 N V int q { 1, 2, 3, 4, 5 } T2 N V int z { 4 } T3 N V int w int z { 1, 2, 3, 4, 5 } T4
51
N V int x int y { 1 } T0 N V int a { 1, 2, 3, 4, 5 } T1 N V int q { 1, 2, 3, 4, 5 } T2 N V int z { 4 } T3 N V int w int z { 1, 2, 3, 4, 5 } T4
52
Errata: Table 4 Parameter for B4 should read z ∈ T3 and not z ∈ T4
53
54
55
56