On Jan 19, 2009, at 3:41 PM, slabbe wrote:

> Hi!
>
> I would like to know if the following is a bug or if I have to work
> with it.
>
> It is related to this conversation :
> Finding a duplicated vector in a list of vectors
> http://groups.google.com/group/sage-support/browse_thread/thread/ 
> 714bd13c9b36f683#
>
> Thank you,
>
> Sébastien Labbé
>
> *********
>
> sage: hash(0)
> 0
> sage: hash(SR(0))
> 0
> sage: hash(x-x)
> 1849051185
> sage: hash(sqrt(2)-sqrt(2))
> 1849051185
> sage: hash(RR(0))
> 0
> sage: hash(ZZ(0))
> 0
> sage: hash(4-4)
> 0
> sage: hash(sqrt(2)^2-1)
> 1977051568

I assume that last one was meant to be

sage: hash(sqrt(2)^2 - 2)
1849051185

In general the problem of representing symbolic expressions in a  
canonical form is unsolved (or may be undecidable in some cases), but  
all of these are trivially equal to 0.

In general, I might evaluate the symbolic expressions at a random  
point, sort, and compare ones that looked "close enough" symbolically  
trying to prove equality.

- Robert



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

Reply via email to