-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Symbolic cmp #16397
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:3
I can see how that might be surprising. :) IIRC, that was a conscious decision to expose the print order from Pynac to !Python/Sage to be used for sorting lists, etc. where symbolic expressions occur. I guess many places in the code call We would need to get rid of this design for Python 3 compatibility anyway. Shall we remove support for |
comment:4
Yes, thats what I'm thinking as well. I'll write a |
Branch: u/vbraun/symbolic_cmp |
Commit: |
New commits:
|
Changed branch from u/vbraun/symbolic_cmp to u/rws/symbolic_cmp |
comment:9
Trying to push this ticket a bit. I also found this
Do I understand it right that this should call New commits:
|
comment:10
The problem is IMHO what to do with Python 3. Sure we can play the two different comparisons (cmp vs. rich) in Python 2 against each other, but in Py3 there will be only one comparison. So either
|
comment:11
Yes, it's a bit over my head. |
comment:12
Was there ever any consensus on sage-devel on this? I'm leaning toward the first option, but not strongly. |
comment:13
Replying to @kcrisman:
You probably mean https://groups.google.com/forum/?hl=en#!searchin/sage-devel/cmp/sage-devel/092yBmHfXQo/4qfS_JHLJdwJ and #16537, #17175. The newsgroup thread is mainly about equality/hashing and a bit of richcmp, not the two choices above. I am just starting to read about this. |
This comment has been minimized.
This comment has been minimized.
comment:19
When #19040 is done |
Stopgaps: #19465 |
Changed branch from u/rws/symbolic_cmp to none |
Changed commit from |
comment:20
The newest verson of #19040 is in the So, the way to resolve this IMO would be to
|
comment:34
hmm, patchbots are still not happy... |
comment:35
That was a blind merge of develop, sigh. |
comment:37
It is interesting to see from the remaining fail in |
comment:38
Effectively the only way to refine comparison then is by introducing a |
comment:39
perhaps someone should have a look at interfaces/mathematica.py where one has |
comment:42
This restores transitivity by moving all expressions with variables to the right of all the numbers in a sorted list: |
comment:43
Isn't it dangerous to compare constants by float, this will go wrong because of rounding when you have equal or near equal numbers. |
comment:44
How about extending constants with an Isn't this quite hypothetical, compared to the concretely buggy behaviour now? |
comment:45
Its perhaps not that hypothetical, the old joke (aka Heegner number)
comes to mind. But I agree that this could be tackled on a future ticket. |
comment:46
I don't understand what you are trying to do here, can someone please explain? (In my understanding, calling |
comment:47
At the moment there is one total order (print, mathematically wrong both in expressions with and without variables). Total math order OTOH is slow because of proving and undecidable. It is possible to have two total orders side-by-side where one half (within the set of expressions without variables) is fast, correct, and meaningful; and print order (within and with the set of expressions with variables) is fast as usual. It is needed because |
comment:48
Replying to @rwst:
I'm not saying that it is not used that way, I am saying that, as far as I understand, when it is used that way, the bug is there. |
comment:49
Replying to @rwst:
It will never be correct in the sense that you can rely on it in mathematical algorithms, since the zero test for constant symbolic expressions is undecidable. At best it will be a nice and natural print order. Which is not a bad thing, but I don't understand if that's the goal of this ticket (and, if not, what the goal is). |
comment:50
Look at the ticket description. The goal is to fix those errors. If that means to remove the usage of |
comment:51
Replying to @rwst:
I don't know. I tried to explain what I believe is the convention used in sage (or perhaps the most reasonable of several incompatible conventions currently in use), but I'm genuinely interested in knowing if other people agree. |
comment:52
Better than what we currently have... |
Changed reviewer from Ralf Stephan to Ralf Stephan, Volker Braun |
Changed branch from public/16397-1 to |
In the symbolic ring, cmp implements the print comparison which is probably not what you envisioned:
Everybody who coerces to same parents internally before comparing trips over this, for example the real lazy field:
This also makes
RealSet
unusable with symbolics:CC: @videlec @mezzarobba @jpflori
Component: symbolics
Author: Volker Braun, Ralf Stephan
Branch/Commit:
07f12cd
Reviewer: Ralf Stephan, Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/16397
The text was updated successfully, but these errors were encountered: