WMA link
Flat
A symbol with the Flat attribute represents an associative mathematical operation:
SetAttributes[f, Flat]
f[a, f[b, c]]
Flat is taken into account in pattern matching:
f[a, b, c] /. f[a, b] -> d