Is there a way to suppress messages from tellsimp?
Subject: Is there a way to suppress messages from tellsimp?
From: Richard Hennessy
Date: Fri, 12 Dec 2008 20:13:48 -0500
I don't know what is going on here. What is the correct way to code this rule? This is the same rule but I changed simp to false
before doing the tellsimp. Now I do not get the warning and I get the informational message. Is my rule now correct because I
changed simp to false first?
My rule works as is shown below.
(%i1) kill(all); /* kill all is to remove the other rules in effect */
(%o0) done
(%i1) matchdeclare([aa,bb],constantp, xx, lambda([z],not constantp(z)))$
(%i2) matchdeclare([uu,uv], lambda(
[z,[v]],
freeof('unit_step,z)
and freeof('kron_delta,z)
and freeof('diracdelta,z)
and freeof('signum,z))
)$
(%i3) simp:false;
(%o3) false
(%i4)
tellsimp('integrate(uu*unit_step(xx+aa),xx),(at(integrate(at(uu,[xx=xx-aa]),xx),[xx=xx+aa])-at(integrate(at(uu,[xx=xx-aa]),xx),[xx=0]))*unit_step(xx+aa))$
aa+xx partitions `sum'
(%i5) simp:true;
(%o5) true
(%i6) integrate(x^2*unit_step(x+9),x);
(%o6) ((x+9)^3/3-9*(x+9)^2+81*(x+9))*unit_step(x+9)
Wierd, no warnng!! Just the informational message, very wierd. I am not very happy with the way tellsimp and tellsimpafter work.
I think a rewrite is better. Anyway, the last line is correct, so the rule kicked in and it did in fact work, but my entire
collection of rules which are all like this are not very fast when very complex expressions are involved.
Rich
----- Original Message -----
From: "Richard Hennessy" <rvh2007 at comcast.net>
To: "Robert Dodier" <robert.dodier at gmail.com>; "Richard Fateman" <fateman at cs.berkeley.edu>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Friday, December 12, 2008 7:35 PM
Subject: Re: [Maxima] Is there a way to suppress messages from tellsimp?
I did not give enough information for this to be a useful comment on the issue.
I was wrong This is the real life example
(%i1) matchdeclare([aa,bb,cc],constantp, xx, lambda([z],not constantp(z)))$
(%i2) matchdeclare([uu,uv], lambda(
[z,[v]],
freeof('unit_step,z)
and freeof('kron_delta,z)
and freeof('diracdelta,z)
and freeof('signum,z))
)$
(%i3)
tellsimp('integrate(uu*unit_step(xx+aa),xx),(at(integrate(at(uu,[xx=xx-aa]),xx),[xx=xx+aa])-at(integrate(at(uu,[xx=xx-aa]),xx),[xx=0]))*unit_step(xx+aa))$
Warning: Putting rules on '+' or '*' is inefficient, and may not work.
xx+aa partitions `sum'
I did not see the warning when I do a load(pw). I only get the message
xx+aa partitions `sum'
It seems to work anyway but the warning is in fact quite true, my rules are very slow and that is my problem which I was going to
solve by rewriting pw.mac to not even using tellsimp.
Rich
----- Original Message -----
From: "Richard Hennessy" <rvh2007 at comcast.net>
To: "Robert Dodier" <robert.dodier at gmail.com>; "Richard Fateman" <fateman at cs.berkeley.edu>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Friday, December 12, 2008 3:03 AM
Subject: Re: [Maxima] Is there a way to suppress messages from tellsimp?
I don't think it is a warning at all. It is an informational message stating that you are breaking a sum into two mutually
exclusive terms. In this case constant terms from nonconstant terms like
declare([a,b,c],constant);
(a+b+c+5*a) + (x)
aa gets the first term and xx gets x. But I noticed they do not have to be always mutually exclusive, either way you get the
message.
Rich
----- Original Message -----
From: "Robert Dodier" <robert.dodier at gmail.com>
To: "Richard Fateman" <fateman at cs.berkeley.edu>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Friday, December 12, 2008 12:44 AM
Subject: Re: [Maxima] Is there a way to suppress messages from tellsimp?
On Thu, Dec 11, 2008 at 5:46 PM, Richard Fateman
<fateman at cs.berkeley.edu> wrote:
> A properly constructed pattern will almost never get such a message. I can
> see that perhaps in a collection of 25 carefully written rules, you might have
> one that validly partitions a sum or product. If you have 25 such warnings,
> I would be very suspicious.
The "foo partitions bar" message is triggered by constructs like this:
matchdeclare (xx, foo_p, yy, not_foo_p);
foo_p (e) := not atom(e) and op(e) = 'foo;
not_foo_p (e) := not foo_p (e);
tellsimpafter (xx*yy, FOO (xx, yy));
=> yy xx partitions `product'
Since the predicates foo_p and not_foo_p are exhaustive and
mutually exclusive, this is really a best-case scenario.
The rules I write usually have such predicates (because they make
life easier) so they usually get the warning message.
FWIW
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
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima