??? A Delete symbol that takes a string as an argument.
??? A Lookup Start symbol that takes a string as an argument, and a Lookup Finish
symbol that takes an integer as an argument. The action Lookup Start(e) represents
the invocation of the bag implementation??™s Lookup method with input
parameter e, and the action Lookup Finish(k) represents the return value k of the
invocation.
??? ACount Start symbol and a Count Finish symbol that take an integer as an argument.
The action Count Start() represents the invocation of the bag implementation??™s
implicit get Count method, and the action Count Finish(k) represents
the return value k of the invocation.
A stepper for BagImpl is shown in Figure 12.4. In order to map the stepper??™s input
actions to concrete inputs for the bag implementation, the stepper must extract the
first argument of the input action a, using the indexer expression a[0] and a cast
to string. The modeling library provides action arguments through a C# indexer,
which accesses elements by subscripts. In order to construct the output actions that
correspond to the return values of the lookup and count operations, the stepper uses
the utility function Action.Create to create an output action from a given action
name and arguments given as .NET values. (Appendix A.3 explains these and other
facilities for working with action terms.)
12.
Pages:
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