open
nobody
5
2006-07-07
2003-07-11
No

assume(a*b&gt;0)
assume(a+b&gt;0)

Is a b positive,negative, or zero?

But it just answered that correctly!

I *am* surprised, I must say, that it doesn't even get is
(equal(a,0)) =&gt; false since a*b&gt;0 immediately gives you
a#0 and b#0. For that matter, assume(not equal
(c*d,0)) *does* get is(equal(c,0)) =&gt; false.

By the way, with those facts, you can deduce that a&gt;0
and b&gt;0, but that would be a feature request, not a bug
report.

Transcript below.

(C1) assume(a*b&gt;0,a+b&gt;0);
(D1) [a b &gt; 0, b + a &gt; 0]
(D2) POS
(D3) POS
Is a b positive, negative, or zero?
pos;
(D4) POS
(C5) is(equal(a,0));
MACSYMA was unable to evaluate the predicate:
EQUAL(a, 0)
-- an error. Quitting. To debug this try DEBUGMODE
(TRUE);)
(C6) assume(not equal(c*d,0));
(D6) [NOT EQUAL(C d, 0)]
(C7) is(equal(c,0));
(D7) FALSE
(C8) facts();
(D8) [a b &gt; 0, b + a &gt; 0, NOT EQUAL(C, 0), NOT
EQUAL(d, 0)]
&lt;&lt; note how it recorded not equal(c*d,0) &gt;&gt;

Maxima 5.9.0 gcl 2.5.0

## Discussion

• Stavros Macrakis - 2003-07-12

Logged In: YES
user_id=588346

Hmm. Further experimentation shows that with assume(a*b):

and most surprisingly

This one is actually easy to fix: in sign-oddinc, use sign1
rather than sign.

The first two cases can be explained by assuming that it
doesn't check the sign of the a*b subexpression, since it
doesn't &quot;notice&quot; it as a subexpression. It's not clear how
you'd fix that: do you really want sign-mtimes to check all
2^n-n-2 subproducts of a length-n product to see if they're
in the database? This will rarely be useful and is expensive.
Perhaps the database needs to keep a list of &quot;terms included
in products&quot;....

There are similar issues with sums. Consider assume
(m&gt;n,n&gt;0); sign(m-n)=&gt;pos, but sign(m-n+1)=&gt;pnz.

The original problem can probably be solved by re-checking
the sign of the product of the odds before returning from
sign1, but you have to be careful to avoid an infinite
recursion here.

• Robert Dodier - 2006-07-07
• labels: --> Lisp Core - Assume