On 18 lis, 23:54, "ma...@mendelu.cz" <ma...@mendelu.cz> wrote: > On 18 lis, 21:49, Harald Schilly <harald.schi...@gmail.com> wrote: > > > I got this from the "report a problem" form, confirmed in 4.2.1 > > > sage: solve([x==x],x) > > gives an exception. > > > Maxima says this: > > $ maxima -q > > (%i1) solve([x=x],x); > > (%o1) all > > (%i2) > > Similar problem is > solve(SR(0),x) > > and another problem is > solve(0,x) > - but both these cases are highly improbable. Should be the second one > fixed or no? > > I think that it is easy to catch the answer 'all' in the maxima output > and change into anything we want on output, but the question is, what > should be the output of solve([x==x],x) and solve([x==x],x, > solution_dict=True) in Sage > > btw: > > sage: y=var('y') > sage: solve([x==x,y==y],[x,y]) > [[x == r2, y == r1]] > sage: > > I did not look to the Maxima code (can look tomorow, we have a > midnight in five minutes), but from the test like above it seems that > the answer 'all' appears only for equations in one variable.
Related Maxima code is at http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/src/solve.lisp?revision=1.25&view=markup 146 ;; Deal with special cases. 147 (cond 148 ;; Trivially true equations for any set of variables. 149 ((equal eql '(0)) 150 (return '$all)) 151 152 ;; Trivially false equations: return [] 153 ((or (null varl) (null eql)) 154 (return (make-mlist-simp))) Another fast solution is to patch maxima file solve.lisp and replace line 150 by something which is more resonable in Sage, but this may break some maxima tests. Btw: is maxima build tested? (I mean the test suite which comes with maxima, not the tests within Sage.) R. > > Robert -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org