Declaration
rassociative
declare (g, rassociative) tells the Maxima simplifier that g is right-associative. E.g., g(g(a, b), g(c, d)) simplifies to g(a, g(b, g(c, d))).
declare (g, rassociative)
g
g(g(a, b), g(c, d))
g(a, g(b, g(c, d)))