next up previous contents
Next: Expansion of Macro COSY Up: Macro COSY Previous: 2.3.3.6 Left and Right

2.3.3.6 The Distributors

Consider the following macro path involving a concatenator:

displaymath5507

As we said earlier, concatenators of the form used above are so regular and occur so frequently that they might be represented by another simpler mechanism, called distributors. The distributor equivalent to the above concatenator is simply:

displaymath5508

assuming that the collective name deposit has been previously declared, for example by the collectivisor tex2html_wrap_inline5551 . The distributors do not generate indices explicitly, like the concatenators, but generate indices defined by the corresponding collectivisors.

The syntax for the distributor is:

displaymath5509

Recall that every collectivisor defines not only a set of indexed events but also a total order between them. For example the collectivisor:

displaymath5510

states that the collective name c corresponds to the ordered indexed events set

displaymath5511

and the collective name b corresponds to the ordered indexed events set

displaymath5512

For every collective name a declared by a collectivisor, let tex2html_wrap_inline5559 denote the total order of indexed events corresponding to a. More formally tex2html_wrap_inline5563 where tex2html_wrap_inline5565 is a set of corresponding indexed events, and tex2html_wrap_inline5567 is a sharp total order (i.e. tex2html_wrap_inline5569 is a total order). For instance, for the collective name c declared by the collectivisor C4 we have tex2html_wrap_inline5573 , and tex2html_wrap_inline5575 .

Suppose that a collective name a has k dimensions, i.e., every indexed event defined by a is of the form tex2html_wrap_inline5583 , for some tex2html_wrap_inline5585 .

A total order tex2html_wrap_inline5587 is called an array-slice of a if and only if either tex2html_wrap_inline5591 , or tex2html_wrap_inline5593 satisfies the following conditions

(1)
tex2html_wrap_inline5595
tex2html_wrap_inline5597
(2)
tex2html_wrap_inline5599
In other words, S is either tex2html_wrap_inline5565 or a subset of tex2html_wrap_inline5565 consisting of indexed events, the indices of which are identical for some dimensions. For instance the total order:

displaymath5513

is an array slice of b from the collectivisor C4. In this case we have r=1, tex2html_wrap_inline5611 , tex2html_wrap_inline5613 .

Array slices will be represented by slice events. Slice events will be represented like indexed events, but leaving blank the index fields corresponding to the indices which are not the same for all elements of the corresponding array slice.

In particular, the slice event corresponding to the whole set of indexed events defined by a collective name a, will be represented by either a, or tex2html_wrap_inline5619 , or tex2html_wrap_inline5621 .

In the case of the collective name c defined by the collectivisor C4 we have only one array slice, the whole set of indexed events:

displaymath5511

which may be represented either by slice event c or by slice event tex2html_wrap_inline5627 . The collective name b defined by the same collectivisor C4 has 3 dimensions, and we may define 19 array slices and corresponding slice events in this case. For example tex2html_wrap_inline5631 or b correspond to: tex2html_wrap_inline5635

tex2html_wrap_inline5637 corresponds to tex2html_wrap_inline5639

tex2html_wrap_inline5641 corresponds to tex2html_wrap_inline5643 (in this case r=2, tex2html_wrap_inline5647 , tex2html_wrap_inline5649 , tex2html_wrap_inline5651 , tex2html_wrap_inline5653 ), etc.

The dimensions corresponding to blank fields of a slice event are called the distributable dimensions of the corresponding array slice. For instance tex2html_wrap_inline5637 has 2 distributable dimensions: first and third.

In principle, the slice events are strings of the form tex2html_wrap_inline5657 where some tex2html_wrap_inline5659 's are blank. In particular a alone may be regarded as a shorthand for tex2html_wrap_inline5663 . If tex2html_wrap_inline5659 is blank we shall write tex2html_wrap_inline5667 . Let tex2html_wrap_inline5657 be a slice event with tex2html_wrap_inline5671 . Hence j is a distributable dimension of tex2html_wrap_inline5657 .

A slice event or indexed event tex2html_wrap_inline5677 is called a section of slice event tex2html_wrap_inline5657 generated by the distributable dimension j if tex2html_wrap_inline5683 .

If a slice event has only one distributable dimension then all its sections are indexed events, otherwise they are slice events with one distributable dimension less. A distributable dimension j of a slice event tex2html_wrap_inline5657 may, and usually does, generate more than one section, for instance, for the collective name b of the collectivisor C4, the distributable dimension number 1 of tex2html_wrap_inline5637 generates two sections: tex2html_wrap_inline5693 and tex2html_wrap_inline5695 .

A distributor operates on a specific distributable dimension of each slice event in its macro sequence, which after the expansion of the distributor ceases to be distributable. We shall refer to them as the current distributable dimensions of slice events. The slice events will be replaced upon the expansion of the distributor by corresponding sections of slice events.

The simplest distributor, called the simple distributor, has the form:

displaymath5515

In this case it is assumed that for every slice event occurring in msequence, the current distributable dimension is that distributable dimension which is furthest to the right, For instance in the distributor D1

displaymath5516

the 3rd dimension of b is the current distributable dimension.

The general syntax for distributors (see M.9) is tex2html_wrap_inline5701 . So far we considered the case where both dim and range are blanks. Let us now consider the case where range is not blank. This case extends the class of regularities which the distributors may generate by permitting them to distribute not only over the whole range of array-slices but over a subrange of them as well.

So now we have:

displaymath5517

in which tex2html_wrap_inline5709 , tex2html_wrap_inline5711 , tex2html_wrap_inline5713 denote integer expressions, representing the subrange over which msequence is to be distributed.

Suppose that the distributor: tex2html_wrap_inline5717 , where sep and msequence are the same as in D2 expands to:

displaymath5518

where msequence(i) results from msequence by replacing all slice events by the appropriate ith sections of current distributable dimensions. Then distributor D2 will expand to:

displaymath5519

where tex2html_wrap_inline5729 , i.e., m is the greatest integer such that tex2html_wrap_inline5733 , where n is the number of copies to be selected.

For example, the distributor D3:

displaymath5520

where c is declared by C4 would expand to:

displaymath5521

selecting out of all copies of c in the string generated by the expansion of ;[c] only the first, second and third. The distributor D4:

displaymath5522

would expand to:

displaymath5523

selecting the first and the third copies of c in the expansion of ;[c].

We must specify which of the nested distributors applies to which of the distributable dimensions of array slices. The rule adopted so far is that the outermost distributor will apply to the rightmost distributable dimension of each slice; the second outermost to the rightmost not allocated distributable dimension, etc. A possible relaxation of the above rule would be to consider it as the default rule, and specify explicitly which separator applies to which distributable dimension, which is the case when dim of rule M9 is not a blank. The distributor D5, for example:

displaymath5524

where b is defined by C5, where tex2html_wrap_inline5751 , would expand according to either rules to:

displaymath5525

with ``,'' applying to the first dimension of b and ``;'' to the second. But D6:

displaymath5526

would expand to :

displaymath5527

since it is explicitly specified that ``;'' applies to the first dimension of b, and implicitly that ``,'' applies to the rightmost unallocated dimension of b, according to the default rule.

Similar to the other rules, the distributors must satisfy their own restrictions Drest1, Drest2.1, Drest2.2, Drest3, Drest4, Drest5.1 and Drest5.2 which are given as follows:

(Drest1)
p contains at least one slice event.
(Drest2.1)
If both range and dim are blank then the number of sections generated by the rightmost distributable (current) dimension must be the same for all slice events occurring in p.
(Drest2.2)
If range is blank and dim=j and j is an integer, then the number of sections generated by the jth dimension must be the same for all slice events occurring in p and having the jth dimension distributable.
(Drest3)
Inside a k-nested distributor there must be at least one slice event with k distributable dimensions, and no array slices with more than k distributable dimensions.
(Drest4)
If dim=j then every slice event with maximal number of distributable dimensions must have the jth dimension as a distributable dimension.
(Drest5.1)
If tex2html_wrap_inline5795 , dim is blank and tex2html_wrap_inline5799 are integers, then tex2html_wrap_inline5801 , tex2html_wrap_inline5803 and tex2html_wrap_inline5711 must be smaller than or equal to the number of sections generated by the rightmost distributable (current) dimension of any array slice event occurring in p.
(Drest5.2)
If tex2html_wrap_inline5795 , dim=j and tex2html_wrap_inline5799 are integers, then tex2html_wrap_inline5801 , tex2html_wrap_inline5803 and tex2html_wrap_inline5711 must be smaller than or equal to the number of sections generated by the jth dimension of any slice event occurring in p which has the jth dimension distributable.


next up previous contents
Next: Expansion of Macro COSY Up: Macro COSY Previous: 2.3.3.6 Left and Right

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