Opened 4 years ago

Last modified 17 months ago

#18883 needs_work defect

use Pynac for some symbolic comparisons instead of Maxima

Reported by: rws Owned by:
Priority: major Milestone: sage-8.2
Component: symbolics Keywords:
Cc: Merged in:
Authors: Ralf Stephan Reviewers:
Report Upstream: N/A Work issues:
Branch: u/rws/use_pynac_for_some_symbolic_comparisons_instead_of_maxima (Commits) Commit: 18c27680eace1c3ac6933a912817a8822d4311d7
Dependencies: #22219 Stopgaps:

Description

This:

sage: bool(exp(x)>=0)
True

unexpectedly uses Maxima, and gets it wrong, too (the already known complex domain problem, see e.g. #14305).

Since Pynac can now assign info flags to function expressions the possible cases for abs, factorial, binomial, real, imag, step should be implemented in Pynac (this is https://github.com/pynac/pynac/issues/78) and the cases like above handled in Pynac.

The repercussions are not limited to such comparisons. The more expressions have info flags set the more expressions with more complicated structure can be decided and more questions answered.

Change History (14)

comment:1 Changed 4 years ago by rws

Turns out that, additionally, an explicit nonzero info flag is needed in Pynac because without a nonzero flag the above test in the reals is always delegated to Maxima, as well. https://github.com/pynac/pynac/issues/79

EDIT: remove nonsense

Last edited 4 years ago by rws (previous) (diff)

comment:2 Changed 4 years ago by rws

  • Summary changed from use Pynac for symbolic comparison instead of Maxima to use Pynac for some symbolic comparisons instead of Maxima

comment:3 Changed 4 years ago by rws

  • Branch set to pynac-0.4.3
  • Report Upstream changed from N/A to Fixed upstream, in a later stable release.

comment:4 Changed 3 years ago by chapoton

  • Branch pynac-0.4.3 deleted

pynac-0.4.3 is not a git branch

comment:5 Changed 3 years ago by rws

  • Report Upstream changed from Fixed upstream, in a later stable release. to Reported upstream. Developers acknowledge bug.

This was NOT fixed as claimed in the ticket field.

comment:6 Changed 2 years ago by rws

  • Branch set to u/rws/use_pynac_for_some_symbolic_comparisons_instead_of_maxima

comment:7 Changed 2 years ago by rws

  • Commit set to 5abe68e0989b84c6ddb46dd5209aa53307279266
  • Dependencies set to pynac-0.7.4

This commit enables all Pynac relational logic improvements and only falls back on Maxima if Pynac returns Not Implemented.


New commits:

5abe68e18883: take advantage of more fine-grained logic results from Pynac

comment:8 Changed 2 years ago by rws

To fix the Maxima-related problem, as a solution to the complex/real domain issue is not expected it might be possible to use only Pynac with relations, and use both with equality questions.

comment:9 Changed 2 years ago by rws

If Pynac should take over all questions on relations then it must be able to also answer this:

            sage: (x > 2).assume()
            sage: bool(x > 0)
            True

because it's impossible do separate domain-only questions from more general ones. That means the workaround mentioned in comment:8 depends on https://github.com/pynac/pynac/issues/227

comment:10 Changed 2 years ago by git

  • Commit changed from 5abe68e0989b84c6ddb46dd5209aa53307279266 to 18c27680eace1c3ac6933a912817a8822d4311d7

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

18c276818883: depend on Pynac handling all inequalities

comment:11 Changed 2 years ago by rws

  • Dependencies changed from pynac-0.7.4 to #22219
  • Milestone changed from sage-6.8 to sage-7.6
  • Report Upstream changed from Reported upstream. Developers acknowledge bug. to N/A
  • Status changed from new to needs_review

comment:12 Changed 19 months ago by rws

  • Authors set to Ralf Stephan
  • Milestone changed from sage-7.6 to sage-8.2

comment:13 Changed 17 months ago by rws

  • Status changed from needs_review to needs_work

comment:14 Changed 17 months ago by rws

Lots of doctest errors. Back to the drawing board.

Note: See TracTickets for help on using tickets.