Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Upstream] Integration error? (cannot parse unusual output format) #19

Open
kirtsar opened this issue Aug 25, 2018 · 1 comment
Open

Comments

@kirtsar
Copy link

kirtsar commented Aug 25, 2018

My use-case is:

x = :x
int(log(x)/x, x, 0, 1)  # works fine
int(log(x)/(x - 1), x, 0, 1) # error

ERROR: Reduce: 
*hold(limit)$$$$
at line 1

***** Too few right parentheses 


 - 2*limit!+(( - 2*int(log(x)/(2*x**2 + x),x) + log(x)**2)/4,x,0) - sub(x=1,int(
log(x)/(2*x**2 + x),x)) - 2*pi**2
@chakravala
Copy link
Owner

chakravala commented Aug 25, 2018

Thanks for pointing this scenario out, I have not encountered this specific use case before.

By the looks of it, this result is not currently supported. You can observe it from the REDUCE code

julia> int(RExpr(log(x)/(x-1)),x,0,1)

                  log(x)             2
           2*int(--------,x) + log(x)
                   2
                  x  - x                                    log(x)            2
 - limit+(-----------------------------,x,0) + sub(x=1,int(--------,x)) - 2*pi
                        2                                    2
                                                            x  - x

julia> int(RExpr(log(x)/(x-1)),x,0,1) |> string
" - limit!+((2*int(log(x)/(x**2 - x),x) + log(x)**2)/2,x,0) + sub(x=1,int(log(x)/(x**2 - x),x)) - 2*pi**2"

The string that is read back into the REDUCE parser contains syntax that is not currently supported by the parser generator. The syntax is not currently part of the parser generator.

Since the output is returned in this format, I'm not immediately sure yet how to handle the parsing, but I will think some more about this and how it might be handled in the future.

As of now, reading back an output of that format and parsing it into Julia is not currently possible.

@chakravala chakravala changed the title Integration error? Integration error? (cannot parse limit! output statement format) Aug 25, 2018
@chakravala chakravala changed the title Integration error? (cannot parse limit! output statement format) Integration error? (cannot parse limit! output format) Aug 25, 2018
@chakravala chakravala changed the title Integration error? (cannot parse limit! output format) Integration error? (cannot parse unusual output format) Aug 25, 2018
@chakravala chakravala added this to To do in Implement Reduce via automation Aug 25, 2018
@chakravala chakravala changed the title Integration error? (cannot parse unusual output format) [Upstream] Integration error? (cannot parse unusual output format) Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants