How can I use Sage to determine if an expression is a sum - i.e. if
the last operation performed is either addition or subtraction?

Thus, I would like to identify "a*(b+c)" as a product but "a*b+a*c" as
a sum.

It would be nice to also identify the number of summands in an
addition - or multiplicands in a product - i.e. "a*b+a*c" should be a
sum with two summands, as opposed to "a*b+a*c+a*d" having three
summands.

Thanks!

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to