#11309: Sage sees -x +y > 0, -y + x >= 0,  and  x -y > 0 as equivalent
-------------------------+--------------------------------------------------
   Reporter:  tnv        |          Owner:  burcin              
       Type:  defect     |         Status:  new                 
   Priority:  major      |      Milestone:  sage-4.7.1          
  Component:  symbolics  |       Keywords:  inequality, equality
Work_issues:             |       Upstream:  N/A                 
   Reviewer:             |         Author:                      
     Merged:             |   Dependencies:                      
-------------------------+--------------------------------------------------
Description changed by kini:

Old description:

> -x + y > 0 and x - y > 0  are treated the same in Sage.
>
> {{{
> sage: version()
> 'Sage Version 4.6.2, Release Date: 2011-02-25'
>
> sage: (-x +y < 0) in [x -y < 0]
> True
>
> Set([-x +y >= 0,x -y >= 0])
> {-x + y >= 0}
> }}}
>
> and they have the same Hash
>
> {{{
> sage: var('x,y')
> (x, y)
> sage: hash(-x + y > 0 )
> 1221566266
> sage: hash(-x + y >= 0 )
> 1221566266
> sage: hash(x - y >= 0 )
> 1221566266
> sage: hash(-y + x >= 0 )
> 1221566266
> sage: hash(x - y > 0 )
> 1221566266
> }}}
>
> It seems to me that Sage treats > , >= ,  ==  the same (see
> http://trac.sagemath.org/sage_trac/ticket/7660).    If this is true then
> it's a serious problem and needs to be addressed.

New description:

 -x + y > 0 and x - y > 0  are treated the same in Sage.

 {{{
 #!python
 sage: version()
 'Sage Version 4.6.2, Release Date: 2011-02-25'

 sage: (-x +y < 0) in [x -y < 0]
 True

 Set([-x +y >= 0,x -y >= 0])
 {-x + y >= 0}
 }}}

 and they have the same Hash

 {{{
 #!python
 sage: var('x,y')
 (x, y)
 sage: hash(-x + y > 0 )
 1221566266
 sage: hash(-x + y >= 0 )
 1221566266
 sage: hash(x - y >= 0 )
 1221566266
 sage: hash(-y + x >= 0 )
 1221566266
 sage: hash(x - y > 0 )
 1221566266
 }}}

 It seems to me that Sage treats `>`, `>=`, and `==` the same (see #7660).
 If this is true then it's a serious problem and needs to be addressed.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11309#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to