-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
equality is broken for Posets #14019
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
Oh, yeah. And this patch also fixes this :
Combinat-Style. Nathann |
comment:3
fixed by removing the useless keyword (it is useless, as it cannot be used and hence has never been). Casting the And also because for some reason, up to now, a call to Nathann |
comment:4
Yeahhhhhhhhhhhhh.....
Result :
Categories strike again. Nathann |
comment:5
Same result. |
comment:6
Ok guys, you did it, I have no way to write a new If I want to actually compare the data of the posets (hasse diagram, vertices), then comparing the data will raise a call to compare their parents, and I'm gone for another loop. Now what ? Nathann |
comment:7
Attachment: trac_14019.patch.gz We discussed this at the Sage Days last week (unfortunately you were not there). The best way might be to have an option in Posets which would allow to create posets with and without an attached linear extension. Your use case would be in the new default case of no linear extension attached. Best, Anne |
comment:9
I'm pretty sure that I was, but I admittedly have a very poor memory.
And the one without fancy stuff would be the default Poset.
My use case is the definition of what a Poset is. In any book. Also, do we overlook the fact that this is a conceptual problem of categories, and equalities, an parents, and all that stuff ? Nathann |
This comment has been minimized.
This comment has been minimized.
comment:11
Quotes from posets.py
Nathann |
comment:12
Hi Nathann, Replying to @nathanncohen:
The discussion continued later.
Obviously. We all agree that this is the rationale for the new default
This has nothing to do with categories. This is a consequence of the Now if you would not mind stopping spreading FUD on unrelated things Cheers, |
comment:13
Just to make sure everybody accepts that code will be broken.
Nice. Now, if I have a class that I define myself which contains elements which belong to the category framework : does it mean that this class has to be
Fix the bugs you introduce and we have a deal. How do I break out of this infinite loop ? Nathann |
comment:14
Replying to @nathanncohen:
Please reread. The new default is what we both agree on and is correct.
No. Some parents don't have unique representation.
I did not introduce this bug. And anyway it's Chet's fault.
I know it's frustrating when one can't have an influence to improve the world. But in the case at hand the only step you can take is to stop wasting our time repeating the same things over and over. |
comment:15
Helloooooooooooooo !!! Okayyyyyyyyyy, I just had a nice evening with Florent which had begun with a conversation about this patch, and he said that he'd have a patch for this one month from now. This being said, I still have no answer for a problem with categories : you say that some parents do not have a unique representation, but here is the reason behind the infinite loop I got today :
That's why I asked whether Parents need to be UniqueRepresentation. Because if they aren't, they sure cannot compare their elements ! Nathann |
comment:16
Generally, Any two objects that satisfy If you want "isomorphic with possibly non-unique isomorphism" then just implement a |
comment:17
There's nothing related to isomorphism in what I said. The same way that you expect that int(1) == Integer(1) is True, I would like that two posets that represent the very same partially ordered set be equal. This is totally linear, and consists in checking that i<j in one poset if and only if i<j in the other one. That's not an isomorphism, there is no relabeling involved. This being said, I would like to have an answer to my question above. Not being able to define an Nathann |
comment:18
And surely we don't want all Sage objects to be UniqueRepresentation. Nathann |
comment:19
(Answer from Nicolas Thiery, because trac is in a bad mood) Replying to @nathanncohen:
Excellent :-)
Ok, I get your point now. That's a situation we never met before; parents not often compare To break the loop, one could thus compare that data. In the case at Even if this occurred from time to time, I guess I would not see this Cheers, |
comment:20
What is the expected output of the following:
|
Stopgaps: #14185 |
Branch: u/andrew.mathas/ticket/14019 |
comment:24
Hi Nathann, I moved your patch over to git and I found a hack which stops the infinite loop: it turns out that posets have an attribute
I guess that the failing equality tests are bad, but I am happy that the infinite loop is gone. Florent, Nicolas: it would be good if you could take some time to look at this too as this has been sitting around unloved for quite awhile. Andrew New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:102
I've handled the conflict from #16933, so we're back to positive review. |
Changed author from Travis Scrimshaw, Anne Schilling to Nathann Cohen, John Palmieri, Travis Scrimshaw, Anne Schilling |
comment:104
Breaks docbuild after #16933 is applied. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:106
Fixed. What had happened is we removed a reference (because it was a duplicate), but without deleting the doc first, there was still a reference for sphinx, which is why we didn't catch it before when we checked that the doc builds. |
Changed reviewer from Travis Scrimshaw, Anne Schilling to Travis Scrimshaw, Anne Schilling, John Palmieri |
Changed author from Nathann Cohen, John Palmieri, Travis Scrimshaw, Anne Schilling to Nathann Cohen, Travis Scrimshaw, Anne Schilling |
Changed author from Nathann Cohen, Travis Scrimshaw, Anne Schilling to Travis Scrimshaw, Anne Schilling |
Changed reviewer from Travis Scrimshaw, Anne Schilling, John Palmieri to Travis Scrimshaw, Anne Schilling, John Palmieri, Nathann Cohen |
Changed branch from public/combinat/poset/fix_equality-14019 to |
Changed commit from |
Changed reviewer from Travis Scrimshaw, Anne Schilling, John Palmieri, Nathann Cohen to Travis Scrimshaw, Anne Schilling, John Palmieri, Nathann Cohen, Nicolas M. Thiéry |
comment:109
Thanks Anne for finalizing! |
Plain and simple :
This can be fixed by saying that two posets are equal if their hasse diagrams are equal, as it should have been since the beginning.
This will probably make poset equality much slower. On the bright side it will work correctly.
Of course this patch could have been almost trivial, but there is in the FinitePoset class a "key" argument, whose purpose is to make two posets different if they have different keys. So this patch checks that too.
And the next time that somebody will need to store pairs "(a poset, a key)", the best will be to store pairs "(a poset, a key)". And not "A poset with a key included inside, which is useful just for my own code" as one could easily believe.
Oh. And the same with linear orderings, of course.
Nathann
Depends on #17059
Depends on #16933
CC: @hivert @nthiery @sagetrac-nborie @VivianePons @fchapoton @anneschilling @stumpc5 @jm58660
Component: combinatorics
Keywords: posets
Stopgaps: #14185
Author: Travis Scrimshaw, Anne Schilling
Branch:
23de9f5
Reviewer: Travis Scrimshaw, Anne Schilling, John Palmieri, Nathann Cohen, Nicolas M. Thiéry
Issue created by migration from https://trac.sagemath.org/ticket/14019
The text was updated successfully, but these errors were encountered: