> -----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 1:16 PM
> To: 'Robert Dodier'
> Cc: maxima at math.utexas.edu
> Subject: RE : probleme with rule
>
> Robert,
>
> Thank you very much.
> It work perfectly as I want.
>
> About tellsimpafter:
> In fact I tried to use tellsimp because I thought that built-in simplifier
> was not called after
> tellsimpafter
> Then if I understand well, the sequence of the call is:
> 1) tellsimp
> 2) built-in simplifier
> 3) tellsimpafter
> 4) built-in simplifier
>
Not exactly. The tellsimp rules for ^ are applied in reverse order of their
input. Then the built-in simplifier, only if ^ is still the main function.
Then the tellsimpafter rules, in order of definition if ^ is still the main
function. The built-in simplifier is not called on the main function ^ but
only called on subexpressions generated during the application of rules.
It is usually a good idea to define simplifications so that if they are
attempted repeatedly, they give you the same answer, and that they
terminate. Tellsimp rules which leave the target unchanged in some
circumstances are almost always wrong.
RJf
>
> About documentation:
> Good project
> I saw that you had already done a large work on documentation
> Big improvement from 5.9.1
>
> Many thank to all Maxima contributors.
>
>
> Laurent.
>
> > -----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
> >
> >
> > Laurent,
> >
> > > 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.
> >
> > Notes:
> > (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
> > http://www.math.utexas.edu/mailman/listinfo/maxima
> >
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima