# [Maxima] probleme with rule

Richard Fateman fateman
Sun Oct 8 10:40:03 CDT 2006

```It seems to me that since "a" is not binary, a^2 is transformed to a^2.
Then tellsimp is called again on a^2, indefinitely.

Maybe tellsimpafter would be better than tellsimp.

I think though that you should not do it this way, but introduce a
function, say, binpower, and use it instead of "^" for binary variables.

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of laurent couraud
> Sent: Sunday, October 08, 2006 8:14 AM
> To: maxima at math.utexas.edu
> Subject: [Maxima] probleme with rule
>
> Hello with all,
>
> I try to solve a system of equations including binary
> variables and non binary variables. To this end I wish to say
> to Maxima that:
> For all binary variable b and for any integer n > 0 b^n = b I
> test this following but that causes the Bind stack overflow error.
>
> put(a, Binary, true);
> matchdeclare(b, atom, n, integerp);
> BinaryPowerRule(b, n):=if ((n > 0) and get(b, Binary)) then b
> else b^n; tellsimp(b^n, BinaryPowerRule(b, n));
>
> a^2 => Bind stack overflow
>
> Is it possible to circumvent the problem?
>
> PS: i noticed that the documentation for the function "get"
> is under "list" subject while the one for function "put" is
> under "Miscellaneous Options" subject.
>
> Laurent.
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>

```