[J3] Commutativity of co_reduce

Brad Richardson everythingfunctional at protonmail.com
Wed Oct 23 00:46:36 UTC 2024


Hi all,

The LBL group has encountered another question, this time with respect
to co_reduce. At present the description of OPERATION argument states
"OPERATION shall implement a mathematically associative operation." The
subsequent description of how OPERATION is applied:

The computed value of a reduction operation over a set of values is the
result of an iterative process. Each iteration involves the evaluation
of OPERATION (x, y) for x and y in the set, the removal of x and y from
the set, and the addition of the value of OPERATION (x, y) to the set.
The process terminates when the set has only one element; this is the
computed value.

Of note is that the word "set" implies that there is no ordering of the
values. The description also does not imply an order in which the
values are combined nor does it specify what subsequent iteration
consumes the result of a given combination. Thus the reduction only has
a deterministic answer if OPERATION is both associative *and*
commutative. We believe that it would be clearer if this requirement
was stated explicitly. The edits for this would be quite simple. I.e.

[383:5] Add "and commutative" after "associative" so that the
sentence reads:

    OPERATION shall implement a mathematically associative and 
    commutative operation.

[383:29+] Delete the NOTE

Do others have opinions? Would it be reasonable to submit this change
as an edits paper as just a clarifying change?

Regards,
Brad Richardson




More information about the J3 mailing list