Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

syntaxError exception using integrate with fricas

This seems to be another Sagemath<-->Fricas interface issue. I am not sure if it is reported or not.

Using sagemath 9.3 with fricas 1.3.6 on Linux

var('x')
integrate(2*x+x^2*2^(1/2),x, algorithm="fricas")
....
  File "sage/misc/parser.pyx", line 1019, in sage.misc.parser.Parser.parse_error (build/cythonized/sage/misc/parser.c:10208)
    raise SyntaxError(msg, tokens.s, tokens.pos)

  File "<string>", line unknown
SyntaxError: Malformed expression

Using fricas directly

(2) -> ii:=integrate(2*x+x^2*2^(1/2),x)

         +-+
        \|2   3    2
   (2)  ---- x  + x
          3
                                            Type: Polynomial(AlgebraicNumber)
(3) -> unparse(ii::InputForm)  

   (3)  "((2^(1/2))/3)::AlgebraicNumber()*x^3+1::AlgebraicNumber()*x^2"
                                                                 Type: String
(4) ->

Is the syntax error coming due to Fricas using those ::AlgebraicNumber() in there? I looked at my older report for this one using Fricas 1.3.6 on Linux (via sagemath 9.0) and the error then was

   Exception raised: UnboundLocalError

So the exception seem to have changed, but both still fail.

Any idea why the above gives syntax error on the sagemath side?

syntaxError exception using integrate with fricas

This seems to be another Sagemath<-->Fricas interface issue. I am not sure if it is reported or not.

Using sagemath 9.3 with fricas 1.3.6 on Linux

var('x')
integrate(2*x+x^2*2^(1/2),x, algorithm="fricas")
....
  File "sage/misc/parser.pyx", line 1019, in sage.misc.parser.Parser.parse_error (build/cythonized/sage/misc/parser.c:10208)
    raise SyntaxError(msg, tokens.s, tokens.pos)

  File "<string>", line unknown
SyntaxError: Malformed expression

Using fricas directly

(2) -> ii:=integrate(2*x+x^2*2^(1/2),x)

         +-+
        \|2   3    2
   (2)  ---- x  + x
          3
                                            Type: Polynomial(AlgebraicNumber)
(3) -> unparse(ii::InputForm)  

   (3)  "((2^(1/2))/3)::AlgebraicNumber()*x^3+1::AlgebraicNumber()*x^2"
                                                                 Type: String
(4) ->

Is the syntax error coming due to Fricas using those ::AlgebraicNumber() in there? I looked at my older report for this one using Fricas 1.3.6 on Linux (via sagemath 9.0) and the error then was

   Exception raised: UnboundLocalError

So the exception seem to have changed, but both still fail.

Any idea why the above gives syntax error on the sagemath side?side? Currently this is flagged as failed, when it should really be valid result.