defining simplification rules



Hi,

I am very new to maxima and CAS in general, and also to this list.  So
I hope you will excuse me if my question happens to be trivial.

I am trying to define some new simplification rules for gamma
functions.  After looking at the help files and some sources in
maxima's share directory (and not quite understanding what was going
on), I came up with the following definitions:

(%i1) matchdeclare(z,true)$
(%i2) defrule(gammarule0,z!,gamma(z+1))$
(%i3) defrule(gammarule1,gamma(1-z)*gamma(z),%pi/sin(%pi*z))$
(%i4) defrule(gammarule2,gamma(z)*gamma(z+1/2),2^(1-2*z)*sqrt(%pi)*gamma(2*z))$
(%i5) defrule(gammarule3,z*gamma(z),gamma(z+1))$
(%i6) gammasimp(f) :=
apply1(expand(f),gammarule0,gammarule1,gammarule2,gammarule3)$

Now, when I try to simplify, say, n!*(-1-n)!, I get

(%i7) gammasimp(n!*(-1-n)!);
                                      %pi
(%o7)                            - ----------
                                   sin(%pi n)

which is what I want.  On the other hand, if I try something like

(%i8) gammasimp(gamma(n)*gamma(n+1/2));
                                                1
(%o8)                        gamma(n) gamma(n + -)
                                                2
(which, I imagine, should be matched by gammarule2), there is no
simplification in the output.

What am I doing wrong?

Thanks, and happy new year too,
Pouya