linguistic:voice_change, structural:scholar_edition
Notation for non-associative operations

In general, parentheses must be used to indicate the order of evaluation if a non-associative operation appears more than once in an expression (unless the notation specifies the order in another way, like 2 3 / 4 {\displaystyle {\dfrac {2}{3/4}}}). However, mathematicians agree on a particular order of evaluation for several common non-associative operations. This is simply a notational convention to avoid parentheses.

A left-associative operation is a non-associative operation that is conventionally evaluated from left to right, i.e.,

a ∗ b ∗ c = (a ∗ b) ∗ c a ∗ b ∗ c ∗ d = ((a ∗ b) ∗ c) ∗ d a ∗ b ∗ c ∗ d ∗ e = (((a ∗ b) ∗ c) ∗ d) ∗ e etc. } for all a, b, c, d, e ∈ S {\displaystyle \left.{\begin{array}{l}a*b*c=(a*b)*c\\a*b*c*d=((a*b)*c)*d\\a*b*c*d*e=(((a*b)*c)*d)*e\quad \\{\mbox{etc.}}\end{array}}\right\}{\mbox{for all }}a,b,c,d,e\in S}

while a right-associative operation is conventionally evaluated from right to left:

x ∗ y ∗ z = x ∗ (y ∗ z) w ∗ x ∗ y ∗ z = w ∗ (x ∗ (y ∗ z)) v ∗ w ∗ x ∗ y ∗ z = v ∗ (w ∗ (x ∗ (y ∗ z))) etc. } for all z, y, x, w, v ∈ S {\displaystyle \left.{\begin{array}{l}x*y*z=x*(y*z)\\w*x*y*z=w*(x*(y*z))\quad \\v*w*x*y*z=v*(w*(x*(y*z)))\quad \\{\mbox{etc.}}\end{array}}\right\}{\mbox{for all }}z,y,x,w,v\in S}

Both left-associative and right-associative operations occur. Left-associative operations include the following:

This notation can be motivated by the currying isomorphism, which enables partial application.

Right-associative operations include the following:

Exponentiation is commonly used with brackets or right-associatively because a repeated left-associative exponentiation operation is of little use. Repeated powers would mostly be rewritten with multiplication:

Formatted correctly, the superscript inherently behaves as a set of parentheses; e.g. in the expression 2 x + 3 {\displaystyle 2^{x+3}} the addition is performed before the exponentiation despite there being no explicit parentheses 2 (x + 3) {\displaystyle 2^{(x+3)}} wrapped around it. Thus given an expression such as x y z {\displaystyle x^{y^{z}}}, the full exponent y z {\displaystyle y^{z}} of the base x {\displaystyle x} is evaluated first. However, in some contexts, especially in handwriting, the difference between x y z = (x y) z {\displaystyle {x^{y}}^{z}=(x^{y})^{z}}, x y z = x (y z) {\displaystyle x^{yz}=x^{(yz)}} and x y z = x (y z) {\displaystyle x^{y^{z}}=x^{(y^{z})}} can be hard to see. In such a case, right-associativity is usually implied.

Using right-associative notation for these operations can be motivated by the Curry–Howard correspondence and by the currying isomorphism.

Non-associative operations for which no conventional evaluation order is defined include the following.

(Compare material nonimplication in logic.)