Changes between Initial Version and Version 1 of Ticket #8969


Ignore:
Timestamp:
05/14/10 20:44:49 (11 years ago)
Author:
dsm
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8969 – Description

    initial v1  
    77all work as expected, but:
    88
    9 sage: solve([2*x==3, x != 5], x)[[BR]]---------------------------------------------------------------------------[[BR]]!TypeError                                 Traceback (most recent call last)[[BR]][[BR]]/Applications/sage/devel/sage-main/build/sage/<ipython console> in <module>()[[BR]][[BR]]/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/relation.pyc in solve(f, *args, **kwds)[[BR]]    670                 s = [][[BR]]    671 [[BR]]--> 672         sol_list = string_to_list_of_solutions(repr(s))[[BR]]    673         if 'solution_dict' in kwds and kwds!['solution_dict']==True:[[BR]]    674             if isinstance(sol_list![0], list):[[BR]][[BR]]/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/relation.pyc in string_to_list_of_solutions(s)[[BR]]    455     from sage.structure.sequence import Sequence[[BR]]    456     from sage.calculus.calculus import symbolic_expression_from_maxima_string[[BR]]--> 457     v = symbolic_expression_from_maxima_string(s, equals_sub=True)[[BR]]    458     return Sequence(v, universe=Objects(), cr_str=True)[[BR]]    459 [[BR]][[BR]]/Applications/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py in symbolic_expression_from_maxima_string(x, equals_sub, maxima)[[BR]]   1527         return symbolic_expression_from_string(s, syms, accept_sequence=True)[[BR]]   1528     except !!!SyntaxError:[[BR]]-> 1529         raise !TypeError, "unable to make sense of Maxima expression '%s' in Sage"%s[[BR]]   1530     finally:[[BR]]   1531         is_simplified = False[[BR]][[BR]]!TypeError: unable to make sense of Maxima expression '[[x==3/2,-7/2!==0]]' in Sage
     9sage: solve([2*x==3, x != 5], x)[[BR]]---------------------------------------------------------------------------[[BR]]!TypeError                                 Traceback (most recent call last)[[BR]][[BR]]/Applications/sage/devel/sage-main/build/sage/<ipython console> in <module>()[[BR]][[BR]]/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/relation.pyc in solve(f, *args, **kwds)[[BR]]    670                 s = [][[BR]]    671 [[BR]]--> 672         sol_list = string_to_list_of_solutions(repr(s))[[BR]]    673         if 'solution_dict' in kwds and kwds!['solution_dict']==True:[[BR]]    674             if isinstance(sol_list![0], list):[[BR]][[BR]]/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/relation.pyc in string_to_list_of_solutions(s)[[BR]]    455     from sage.structure.sequence import Sequence[[BR]]    456     from sage.calculus.calculus import symbolic_expression_from_maxima_string[[BR]]--> 457     v = symbolic_expression_from_maxima_string(s, equals_sub=True)[[BR]]    458     return Sequence(v, universe=Objects(), cr_str=True)[[BR]]    459 [[BR]][[BR]]/Applications/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.py in symbolic_expression_from_maxima_string(x, equals_sub, maxima)[[BR]]   1527         return symbolic_expression_from_string(s, syms, accept_sequence=True)[[BR]]   1528     except !!!!SyntaxError:[[BR]]-> 1529         raise !TypeError, "unable to make sense of Maxima expression '%s' in Sage"%s[[BR]]   1530     finally:[[BR]]   1531         is_simplified = False[[BR]][[BR]]!TypeError: unable to make sense of Maxima expression '[[x==3/2,-7/2!==0]]' in Sage
    1010
    1111--
     
    1313The "!==" which is causing trouble is due to the
    1414
    15 if equals_sub:[[BR]]            s = s.replace('=','==')
     15if equals_sub:[[BR]]            s = s.replace('=','==')
    1616
    1717lines in  symbolic_expression_from_maxima_string.  This could be fixed by changing the replace to a regexp, or adding a hack s = s.replace('!==', '!=') afterwards.
    1818
    19 This deals with the obvious problem but not the underlying one, which is that the result is still IMHO underprocessed: 
     19This deals with the obvious problem but not the underlying one, which is that the result is still IMHO underprocessed:
    2020
    2121MODIFIED_sage: solve([2*x==3, x != 4], x)[[BR]][[x == (3/2), (-5/2) != 0]]
     
    2727when I wanted [].
    2828
    29 In fact, even in cases not involving "!=", it's possible for maxima output -- %union([x = 3/2,  -5/2 # 0]) --  to be insufficiently processed,IMHO:
     29In fact, even in cases not involving "!=", it's possible for maxima output -- %union([x = 3/2,  -5/2 # 0]) -- to be insufficiently processed,IMHO:
    3030
    31 sage: solve([2*x==3, (x-4)!^2 > 0], x)[[BR]][[x == (3/2), (-5/2) != 0]]
     31MODIFIED_sage: solve([2*x==3, (x-4)!^2 > 0], x)[[BR]][[x == (3/2), (-5/2) != 0]]
    3232
    3333ISTM the extra information about what condition maxima used isn't worth the inconvenience of having to postprocess the solutions to see if one exists.