How to define commutative and linear



How to define   f(u+b*v,x+a*y)=f(u,x)+a*f(v,x)+b*f(u,y)+a*b*f(v,z)     ?

Declare commutative and linear does not achieve.

(%i1) matchdeclare([xx,yy,zz],true);
(%i3) declare(f,commutative);
(%i4) declare(f,linear);
(%i5) f(5*x,2*y+z);
(%o5)                           5 f(x, z + 2 y)



Then define rule myself .

(%i1) matchdeclare([xx,yy,zz],true);

(%i2) matchdeclare(cc,scalarp);

(%i3) tellsimp(f(xx,cc*yy),cc*f(xx,yy));

(%i5) f(5*x,2*y);

*** - Program stack overflow. RESET

[/build/buildd/clisp-2.44.1/src/eval.d:527] reset() found no driver
frame (sp=0x72ad28b0-0x72acc4e0)
Exiting on signal 6

Process maxima aborted