Declaration
lassociative
declare (g, lassociative) tells the Maxima simplifier that g is left-associative. E.g., g (g (a, b), g (c, d)) will simplify to g (g (g (a, b), c), d).
declare (g, lassociative)
g
g (g (a, b), g (c, d))
g (g (g (a, b), c), d)