Opened 6 years ago

Closed 2 years ago

#17908 closed defect (fixed)

Sage doesn't grok unsolved integral results from fricas

Reported by: rws Owned by:
Priority: major Milestone: sage-8.8
Component: interfaces: optional Keywords: FriCAS
Cc: Merged in:
Authors: Martin Rubey Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 62131cb (Commits, GitHub, GitLab) Commit: 62131cb2f3213bd06155d21b73711525952331e1
Dependencies: Stopgaps:

Status badges

Description

In cases where Fricas gives back an unsolved integral:

sage: integrate(abs(x), x, algorithm='fricas')
...
ValueError: Unable to parse: integral(abs(x),x::Symbol)

Change History (18)

comment:1 Changed 6 years ago by jdemeyer

  • Component changed from interfaces to interfaces: optional

comment:2 Changed 2 years ago by mantepse

  • Keywords FriCAS added

comment:3 Changed 2 years ago by mantepse

In current develop, this almost works:

sage: r = integrate(abs(x), x, algorithm='fricas'); r
integral(abs(x), x)
sage: r.operands()
[abs(x), x]
sage: r.operands()[0].subs(x=-1)
abs(-1)

The cure is, as observed by @slelievre, to do register_symbol for abs.

comment:4 Changed 2 years ago by mantepse

  • Branch set to u/mantepse/sage_doesn_t_grok_unsolved_integral_results_from_fricas

comment:5 Changed 2 years ago by mantepse

  • Authors set to Martin Rubey
  • Commit set to f7d1552aca84777a83dccacc6338ec22f2d596d5
  • Dependencies set to #27268, #26068
  • Status changed from new to needs_review

New commits:

253d6edMerge branch 'u/mantepse/conversion_of_fricas_sums_and_products' of git://trac.sagemath.org/sage into t/26068/add_fricas_as_algorithm_to_limit
c42b3e2add support for fricas limit
e4c4947Merge branch 'u/mantepse/conversion_of_fricas_sums_and_products' of git://trac.sagemath.org/sage into t/26068/add_fricas_as_algorithm_to_limit
a91cc09fix merge
65ea0fbcleanup and add doctests
7070cddMerge branch 'u/mantepse/add_fricas_as_algorithm_to_limit' of git://trac.sagemath.org/sage into t/17908/sage_doesn_t_grok_unsolved_integral_results_from_fricas
ec66106fix treatment of rootOf expressions for python3
9a6ec3dMerge branch 'develop' of git://trac.sagemath.org/sage into t/27268/py3__fix_fricas_interface
143afd2Merge branch 'u/mantepse/py3__fix_fricas_interface' of git://trac.sagemath.org/sage into t/17908/sage_doesn_t_grok_unsolved_integral_results_from_fricas
f7d1552provide translation of FriCAS abs

comment:6 Changed 2 years ago by git

  • Commit changed from f7d1552aca84777a83dccacc6338ec22f2d596d5 to 18e2a4961ad0ade33d0bb8082fbf0400763b7574

Branch pushed to git repo; I updated commit sha1. New commits:

18e2a49add forgotten tag

comment:7 Changed 2 years ago by vdelecroix

there are merge commits than actual commits on your branch... which makes it very hard to read. You would better rewrite the branch.

comment:8 Changed 2 years ago by kcrisman

My develop version is currently bombed but the code and fix look exactly correct, nice fix. Does green patchbot mean anything since this is an optional test?

comment:9 Changed 2 years ago by mantepse

green patchbot means little, however, you can check the result by arando (which has unrelated failures, though). It does work on my computer, too :-)

comment:10 Changed 2 years ago by chapoton

The doctest seems to work (in 8.8.b7) without the changes..

comment:11 Changed 2 years ago by chapoton

  • Dependencies #27268, #26068 deleted

comment:12 Changed 2 years ago by mantepse

Indeed, in sage.functions.other we have:

2c7174fed (Eviatar Bach         2014-08-12 15:06:19 +0200  122)         GinacFunction.__init__(self, "abs", latex_name=r"\mathrm{abs}",
017571be1 (Marcelo Forets       2017-05-14 21:10:12 +0200  123)                                conversions=dict(sympy='Abs',
666c2f36f (Marcelo Forets       2017-05-25 23:03:03 +0200  124)                                                 mathematica='Abs',
2b35b3b2f (Frédéric Chapoton    2019-03-30 21:01:43 +0100  125)                                                 giac='abs',
2b35b3b2f (Frédéric Chapoton    2019-03-30 21:01:43 +0100  126)                                                 fricas='abs'))

comment:13 Changed 2 years ago by chapoton

So we need a clean branch just adding the doctest and not the other changes. Will you do that ?

comment:14 Changed 2 years ago by mantepse

  • Branch changed from u/mantepse/sage_doesn_t_grok_unsolved_integral_results_from_fricas to public/add_fricas_abs_doctest
  • Commit 18e2a4961ad0ade33d0bb8082fbf0400763b7574 deleted

comment:15 Changed 2 years ago by git

  • Commit set to 62131cb2f3213bd06155d21b73711525952331e1

Branch pushed to git repo; I updated commit sha1. New commits:

62131cbadd a doctest demonstrating that #17908 is fixed

comment:16 Changed 2 years ago by chapoton

  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

ok, thx

comment:17 Changed 2 years ago by chapoton

  • Milestone changed from sage-6.6 to sage-8.8

comment:18 Changed 2 years ago by vbraun

  • Branch changed from public/add_fricas_abs_doctest to 62131cb2f3213bd06155d21b73711525952331e1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.