2
$\begingroup$

Operator precedence is documented. Operators without built-in meanings are documented. The word "associative" apparently does not appear in either page. It's easy enough to do an experiment to observe the associativity of an operator. For example, \[CircleMinus] is left-associative and \[CirclePlus] is not:

ClearAll[CirclePlus, CircleMinus];
CircleMinus[a_, b_] := a[b];
CirclePlus[a_, b_] := a[b];

a⊖b⊖c
a⊕b⊕c
(a⊕b)⊕c
a[b][c]
a⊕b⊕c
a[b][c]

But it would be nicer to discover associativity without an experiment. Neither operator has Attributes, let alone attributes that reveal associativity.

In[534]:= ClearAll[CirclePlus, CircleMinus];
Attributes[CircleMinus]
Attributes[CirclePlus]
{}
{}
$\endgroup$

1 Answer 1

1
$\begingroup$

There is some relevant documentation here:

http://reference.wolframcloud.com/language/tutorial/OperatorInputForms.html

enter image description here

What we see is that a difference between CirclePlus and CircleMinus is that CirclePlus takes multiple inputs while CircleMinus takes only two. For example:

CirclePlus[f1, f2, f3, f4]

evaluates nicely while

CircleMinus[f1, f2, f3]

does not (the third argument is red and the command is ignored). So I suspect that what you are perceiving as associativity is a result of the difference in the allowable inputs to the two expressions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.