Comment #5 on issue 2852 by asmeu...@gmail.com: is_constant(wrt) is needed
http://code.google.com/p/sympy/issues/detail?id=2852

Yes, I've more than once wondered if we should separate is_number and some kind of is_evalfable. For the most part, they are equivalent, but it's always possible to have some function that doesn't have evalf implemented for which it won't be, and then some algorithms will break with it.

is_constant would be useful regardless, I think, because it allows to consider symbolic constants (e.g., y is constant with respect to x, f(x) is not). This also could tie in with issue 1336.

But I don't think it should be separated from is_number regarding evalf. If you want to separate that, let's create a property is_evalfable.

And even if we can't prove that something is zero at least we can know if it's constant (see last example):

I'm not sure about this. expr.is_constant(x) is equivalent to expr.diff(x).is_zero. And anyway, zero is a constant, so if we could prove something is a constant, and then determine the value at one point, and that one point evaluate to zero, then we will have proved that it is zero.

But anyway, this isn't really the issue here. The point is that is_constant would be an assumption, which means that it's something that we try to compute (and in general this is something that we might not be able to do) But is_number (and is_evalfable if we get that) is different. We want (sin(x)**2 + cos(x)**2)).is_number to return False, because in that form, it's not a number (and so, for example evalf won't be able to do anything with it). But we do want (sin(x)**2 + cos(x)**2).is_constant(x) to return True.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to