next up previous contents
Next: 2.3.3.3 The Body-Replicators Up: Macro COSY Previous: 2.3.3.1 The Macro Program

2.3.3.2 The Collectivisors

The macro notation permits declarations of collective names corresponding to rectangular arrays and to arrays of other shapes.

When declaring rectangular arrays two conventions have been followed: either the lower bound of indices in their dimensions are implicitly considered as having the value one, or the lower bound is explicitly specified.

To shorten some otherwise lengthy expressions in our macro grammar we shall adopt the following convention:

displaymath5327

The syntax for collectivisors is given by:

displaymath5328

In the syntax rules given above, simpleardecl stands for a list of collective names which correspond to simple rectangular arrays together with their bounds, and replardecl stands for the replicator generating admissible sets of subscripted events. The non-terminal tex2html_wrap_inline5347 stands for the range specification part of a replicator, iexpr for an integer expression, and subsevents for a sequence of subscripted events.

When subscripts in the dimensions of arrays are consecutive positive integers starting from 1, the lower bound in these dimensions may be implicitly assumed to have the value one and only the upper bound has to be specified. We permit collective names with a different number of dimensions and/or different bounds in their dimensions to be declared by the same collectivisor.

For example the two simple array declarations in C1:

displaymath5329

declare the subscripted events:

displaymath5330

Furthermore the following total orderings are defined:

displaymath5331

If the lower bound in some dimensions of collective names is not 1 but some other fixed integer n we may specify it explicitly. To specify for example that the single dimension of collective name e has lower bound n and upperbound k, and that the first dimension of the two dimensional collective name f has lower bound m and upper bound n and its second dimension lower bound 1 and upper bound k, we write the simple array declarations:

displaymath5332

We also permit declaration of subscripted events the indices of which are not consecutive integers, or depend on the index of some other dimension, by means of replicator array declarations. For example, the index in the first dimension of the subscripted events:

displaymath5333

takes values 1,3,5 and the index in their second dimension takes consecutive values from 1 to the current value of the index of their first dimension. We shall use replicators to generate the set of admissible subscripted events. The subscripted events corresponding to s may be declared by the collectivisor C3:

displaymath5334

using replicators.

All the declarations of the collectivisors must satisfy the restrictions Crest1, Crest2 and Crest3 which are given as follows:

(Crest1)
If the upperbound and lowerbound of dimensions of the collective names are integers then the upperbound has to be greater than or equal to their corresponding implicit or explicit lowerbound.

(Crest2)
An array identifier may only occur once in collectivisors.

(Crest3)
Each replicator without range variables must specify a non empty range for its index.

All the Identifiers used for replicator indices must satisfy the index restrictions Irest1 and Irest2 which are given as follows:

(Irest1)
Identifiers for replicator indices and range variables should be distinct from any identifiers used for simple events. Identifiers for replicator indices and range variables should also be distinct.

(Irest2)
Replicator index variables are only defined inside the tex2html_wrap_inline5381 of the replicators with which they are associated. In the scope of a replicator index variable no other replicator index variable having the same name is permitted.


next up previous contents
Next: 2.3.3.3 The Body-Replicators Up: Macro COSY Previous: 2.3.3.1 The Macro Program

Peter Lauer
Mon Jul 22 17:29:46 EDT 1996