#11539: Sage incorrectly interprets factorials in equations.
-------------------------+--------------------------------------------------
   Reporter:  mhansen    |          Owner:  burcin    
       Type:  defect     |         Status:  new       
   Priority:  major      |      Milestone:  sage-4.7.2
  Component:  symbolics  |       Keywords:            
Work_issues:             |       Upstream:  N/A       
   Reviewer:             |         Author:            
     Merged:             |   Dependencies:            
-------------------------+--------------------------------------------------

Comment(by kcrisman):

 Hmm, not sure I agree with this solution.   Also, a reference to why this
 works would be nice :)  I am impressed!

 ----

 But wouldn't it be better to figure out a way to improve our interface
 rather than mess with Maxima?    After all, '!' only occurs in Maxima for
 factorial, so it should be possible to parse this correctly.  We'd have to
 grab whatever expression came before it, either in parentheses (which
 could have several levels) or a numeric type.   Hmm.

 {{{
     def _equality_symbol(self):
         """
         Returns the equality symbol in Maxima.

         INPUT: none

         OUTPUT: string

         EXAMPLES::

              sage: maxima._equality_symbol()
              '='
              sage: var('x y')
              (x, y)
              sage: maxima(x == y)
              x=y
         """
         return '='

     def _inequality_symbol(self):
         """
         Returns the inequality symbol in Maxima.

         INPUT: none

         OUTPUT: string

         EXAMPLES::

              sage: maxima._inequality_symbol()
              '#'
              sage: maxima((x != 1))
              x#1
         """
         return '#'

 }}}

 Also, this is another good excuse to think about moving the Maxima parsing
 stuff out of the calculus file into one of the Maxima files where it
 belongs... like, it would make more sense to use the above code than do
 {{{

     s = s.replace("#","!=") # a lot of this code should be refactored
 somewhere...
 }}}
 like we currently do.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11539#comment:1>
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