# Ticket #8969: trac_8969_allow_neq_maxima_strings_v2.patch

File trac_8969_allow_neq_maxima_strings_v2.patch, 1.2 KB (added by dsm, 9 years ago)

revised version

• ## sage/calculus/calculus.py

# HG changeset patch
# User D. S. McNeil <dsm054@gmail.com>
# Date 1337989349 25200
# Node ID 8555de83ba1dd56b4daecab6fd8b3ff1f4708929
# Parent  5299aa8232d7acb68d37162f5bef2068c8a68d54
Trac #8969: allow conversion of != from maxima strings

diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
 a \overline{x} sage: latex(t._maxima_()._sage_()) \overline{x} Check that we can understand maxima's not-equals (:trac:8969):: sage: from sage.calculus.calculus import symbolic_expression_from_maxima_string as sefms sage: sefms("x != 3") == SR(x != 3) True sage: sefms("x # 3") == SR(x != 3) True sage: solve([x != 5], x) [[x - 5 != 0]] sage: solve([2*x==3, x != 5], x) [[x == (3/2), (-7/2) != 0]] """ syms = sage.symbolic.pynac.symbol_table.get('maxima', {}).copy() if equals_sub: s = s.replace('=','==') # unfortunately, this will turn != into !==, which we correct s = s.replace("!==", "!=") #replace %union from to_poly_solve with a list if s[0:5]=='union':