[Maxima] RE : probleme with rule
Sun Oct 8 15:16:16 CDT 2006
Thank you very much.
It work perfectly as I want.
In fact I tried to use tellsimp because I thought that built-in simplifier was not called after
Then if I understand well, the sequence of the call is:
2) built-in simplifier
4) built-in simplifier
I saw that you had already done a large work on documentation
Big improvement from 5.9.1
Many thank to all Maxima contributors.
> -----Message d'origine-----
> De : maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] De la part de Robert Dodier
> Envoy? : dimanche 8 octobre 2006 19:53
> ? : laurent couraud
> Cc : maxima at math.utexas.edu
> Objet : Re: [Maxima] probleme with rule
> > 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
> An interesting problem, thanks for suggesting it. Here is a
> possible solution.
> declare (binary, feature);
> matchdeclare (b, atom, n, integerp);
> binary_power (b, n) := if n > 0 and featurep (b, binary) then
> b else b ^ n; tellsimpafter (b ^ n, binary_power (b, n));
> declare (a1, binary);
> a1 ^ 2;
> => a1
> a1 ^ 3 + a2 ^ 3;
> => a2^3 + a1
> I didn't try other examples.
> (1) Use declare/featurep instead of put/get here.
> (2) write_long_names_with_underscores. CamelCaseIsMoreDifficultToRead.
> Minuscule letters + underscore is customary in the existing
> Maxima scripts.
> (3) Probably the right way to solve this problem is to define a
> group with elements 0 and 1 and then declare a to be an element
> of that group. I hope Maxima will be able to handle that in the
> future (to the best of my knowledge, it is not possible now).
> > 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.
> Agreed, the documentation is disorganized. I want to organize
> it by introducing a category system. I will propose an
> implementation in the near future.
> All the best
> Robert Dodier
> Maxima mailing list
> Maxima at math.utexas.edu
More information about the Maxima