# [Maxima] matchdeclare syntax

Edwin Woollett woollett at charter.net
Sat Feb 2 17:39:07 CST 2008

```is there a way to use matchdeclare() to require that a pattern parameter is
both an integer and greater than some value?
I am trying to learn how to use tellsimp() and tellsimpafter().

As a simple exercise, try to define rules so that the symbol i has the
properties, i^2 = -1, i^3 = -i, and i^4 = 1.
I get as far as these and then try to use the mod function for all higher
value of n, but run into some kind of error msg.
==
(%i1) tellsimp(i^2,-1);
(%o1)                         [^rule1, simpexpt]
(%i2) tellsimp(i^3, -i);
(%o2)                     [^rule2, ^rule1, simpexpt]
(%i3) tellsimp(i^4,1);
(%o3)                 [^rule3, ^rule2, ^rule1, simpexpt]
(%i4) [i,i^2,i^3,i^4];
(%o4)                          [i, - 1, - i, 1]
(%i5) matchdeclare(m,integerp);
(%o5)                                done
(%i6) matchdeclare(m,is(m>4) );
(%o6)                                done
(%i7) tellsimp(i^m, i^mod(m,4) );
(%o7)             [^rule4, ^rule3, ^rule2, ^rule1, simpexpt]
(%i8) i^4;
Maxima encountered a Lisp error:

Error in DEFINITELY-SO [or a callee]: DEFINITELY-SO [or a callee] requires
less than two arguments.

Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
(%i9)
TIA
Ted Woollett
ps. thanks for the help with the incorrect math operation diff(
conjugate(f) ) = conjugate( diff(f) ).
```