Most reduction optimisations require the operand to be associative, meaning that adjacent elements can be combined in any order.
For our purposes we will also need it to be commutative, so that even non-adjacent elements can be combined.