-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathTransfers.kerml
More file actions
281 lines (236 loc) · 10.6 KB
/
Copy pathTransfers.kerml
File metadata and controls
281 lines (236 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
standard library package Transfers {
doc
/*
* This package defines the transfer interactions used to type flows.
*/
private import Base::Anything;
private import Occurrences::*;
private import Links::*;
private import Objects::BinaryLinkObject;
private import Performances::Performance;
private import Performances::performances;
private import ScalarValues::Boolean;
private import ScalarValues::Natural;
private import SequenceFunctions::*;
interaction Transfer specializes Performance, BinaryLink {
doc
/*
* A Transfer represents the transfer of a payload from the source of the interaction
* to the target of the interaction.
*/
end feature source: Occurrence redefines BinaryLink::source {
doc
/*
* The entity whose output is the source of the payload to be transferred.
*/
feature sourceOutput: Anything[0..*];
}
end feature target: Occurrence redefines BinaryLink::target {
doc
/*
* The entity whose input is the target of the payload to be transferred.
*/
feature targetInput: Anything[0..*];
}
feature isInstant: Boolean[1] {
doc
/*
* If isInstant is true, then the transfer is instantaneous.
*/
}
feature payload: Anything[1..*] {
doc
/*
* The things that are to be transferred.
*/
}
feature payloadNum: Natural [1] = size(payload);
private instantNum: Natural[1] = if isInstant? 1 else 0;
private binding instant[instantNum] of [0..1] startShot = [0..1] endShot {
doc
/*
* If isInstant is true, then the start and end of the transfer happen at the same time.
*/
}
}
interaction MessageTransfer specializes Transfer {
doc
/*
* A MessageTransfer is a Transfer that does not specify where the payload is picked
* up and dropped off (see FlowTransfer). They are sent by SendPerformances and
* accepted by AcceptPerformances.
*/
}
interaction FlowTransfer specializes Transfer disjoint from MessageTransfer {
doc
/*
* A FlowTransfer is a Transfer identifying an output feature of the source from which
* to pick up a payload and an input feature of the target to which to drop it off. They can
* start when the payload is available at the source and move or copy it to the target.
*/
feature isMove: Boolean[1] default true {
doc
/*
* If isMove is true, then the entire payload leaves the source at the start
* of the transfer.
*/
}
feature isPush: Boolean[1] default true {
doc
/*
* If isPush is true, then the transfer begins when the payload is available
* at the source.
*/
}
connector sourceOutputLink: BinaryLinkObject[payloadNum] {
doc
/*
* The output of the payloads from the sourceOutput.
*/
end [1] feature transferSource references source;
end [payloadNum] feature transferPayload references payload subsets transferSource.sourceOutput;
}
connector targetInputLink: BinaryLinkObject[payloadNum] {
doc
/*
* The input of the payload to the targetInput.
*/
end [1] feature transferTarget references target;
end [payloadNum] feature transferPayload references payload subsets transferTarget.targetInput;
}
private connector sending: HappensDuring[payloadNum] from [1] startShot to [payloadNum] sourceOutputLink {
doc
/*
* The start of the transfer happens during the output of each of the payloads from the
* source.
*/
}
private connector moving: HappensWhile[0..*] from [0..*] sourceOutputLink.endShot to [0..1] startShot {
doc
/*
* If isMove is true, then all payloads leave the source at the start
* of the transfer.
*/
}
private inv { isMove implies size(moving) == size(sourceOutputLink) }
private connector pushing: HappensWhile[0..*] from [0..*] sourceOutputLink.startShot to [0..1] startShot {
doc
/*
* If isPush is true, then the transfer begins when the payloads are available
* at the source.
*/
}
private inv { isPush implies size(pushing) == size(sourceOutputLink) }
private connector delivering: HappensWhile[payloadNum] from [payloadNum] targetInputLink.startShot to [1] endShot {
doc
/*
* The input of each of the payloads to the target starts at the end of the transfer.
*/
}
}
interaction TransferBefore specializes Transfer, HappensBefore intersects Transfer, HappensBefore {
doc
/*
* TransferBefore is a specialization of Transfer in which the source happens before
* the transfer, which happens before the target.
*/
end feature source: Occurrence redefines Transfer::source, HappensBefore::earlierOccurrence;
end feature target: Occurrence redefines Transfer::target, HappensBefore::laterOccurrence;
feature self: TransferBefore redefines Performance::self;
private succession source then self;
private succession self then target;
}
interaction FlowTransferBefore specializes TransferBefore, FlowTransfer intersects FlowTransfer, TransferBefore {
doc
/*
* FlowTransferBefore is a FlowTransfer that is also a TransferBefore.
*/
end feature source: Occurrence redefines Transfer::source, TransferBefore::source;
end feature target: Occurrence redefines Transfer::target, TransferBefore::target;
}
abstract step transfers: Transfer[0..*] nonunique subsets performances, binaryLinks {
doc
/*
* transfers is a specialization of performances and binaryLinks restricted to type
* Transfer.
*/
end feature source: Occurrence redefines Transfer::source, binaryLinks::source;
end feature target: Occurrence redefines Transfer::target, binaryLinks::target;
}
abstract step messageTransfers: MessageTransfer[0..*] nonunique subsets transfers {
doc
/*
* messageTransfers is a specialization of transfers restricted to type MessageTransfers.
*/
end feature source: Occurrence redefines MessageTransfer::source, transfers::source;
end feature target: Occurrence redefines MessageTransfer::target, transfers::target;
}
abstract flow flowTransfers: FlowTransfer[0..*] nonunique subsets transfers {
doc
/*
* flowTransfers is a specialization of transfers restricted to type FlowTransfers.
* It is the default subsetting for non-succession flows.
*/
end feature source: Occurrence redefines FlowTransfer::source, transfers::source;
end feature target: Occurrence redefines FlowTransfer::target, transfers::target;
}
abstract flow transfersBefore: TransferBefore[0..*] nonunique subsets transfers, happensBeforeLinks
intersects transfers, happensBeforeLinks {
doc
/*
* transfersBefore is a specialization of transfers and happensBeforeLinks restricted to
* type TransferBefore.
*/
end feature source: Occurrence redefines TransferBefore::source, transfers::source, happensBeforeLinks::earlierOccurrence;
end feature target: Occurrence redefines TransferBefore::target, transfers::target, happensBeforeLinks::laterOccurrence;
}
abstract flow flowTransfersBefore: FlowTransferBefore[0..*] nonunique subsets flowTransfers, transfersBefore
intersects flowTransfers, transfersBefore {
doc
/*
* flowTransfersBefore is a specialization of flowTransfers and transfersBefore that is restricted
* to type FlowTransferBefore. IT is the default subsetting for succession flows.
*/
end feature source: Occurrence redefines FlowTransferBefore::source, flowTransfers::source, transfersBefore::source;
end feature target: Occurrence redefines FlowTransferBefore::target, flowTransfers::target, transfersBefore::target;
}
behavior SendPerformance specializes Performance {
doc
/*
* SendPerformances are Performance that require an outgoingTransferFromSelf
* from a designated sender Occurrence carrying a given payload, optionally to a designated receiver.
*/
in feature payload [0..*];
in feature sender: Occurrence[1] default this;
in feature receiver: Occurrence[0..1];
feature sentTransfer: MessageTransfer [1] subsets sender.outgoingTransfersFromSelf {
feature redefines payload = SendPerformance::payload;
}
binding [0..1] receiver.incomingTransfersToSelf = [1] sentTransfer;
succession self then sentTransfer;
}
behavior AcceptPerformance specializes Performance {
doc
/*
* AcceptPerformance is a performance that requires an incomingTransferToSelf
* of a desigated receiver Occurrence, providing its payload as output.
*/
inout feature payload[0..*];
in feature receiver: Occurrence[1] default this;
feature acceptedTransfer: MessageTransfer[1] subsets receiver.incomingTransfersToSelf;
succession acceptedTransfer then self.endShot;
binding payload = acceptedTransfer.payload;
}
abstract step sendPerformances: SendPerformance[0..*] nonunique subsets performances {
doc
/*
* sendPerformances is a specialization of performances for SendPerformances.
*/
}
abstract step acceptPerformances: AcceptPerformance[0..*] nonunique subsets performances {
doc
/*
* acceptPerformances is a specialization of performances for AcceptPerformances.
*/
}
}