#14019: equality is broken for Posets
---------------------------------+------------------------------------------
Reporter: ncohen | Owner: sage-combinat
Type: defect | Status: needs_info
Priority: major | Milestone: sage-5.7
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Nathann Cohen | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Comment (by ncohen):
(Answer from Nicolas Thiery, because trac is in a bad mood)
Replying to [comment:15 ncohen]:
> 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.
Excellent :-)
> 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 :
>
> 1) My Poset parent implements `__eq__` by first comparing the hasse
diagrams, which leads to check that the elements of the digraph are equal.
> 2) In order to know whether the elements are equal, the category
mechanism makes them check that they have the same parents
> 3) I check that the parents are equal again, and loop ...
>
> That's why I asked whether Parents need to be UniqueRepresentation.
Because if they aren't, they sure cannot compare their elements !
Ok, I get your point now.
That's a situation we never met before; parents not often compare
themselves by comparing (some of) their elements. When this is the
case, this probably means that those elements were part of the
definition of the parent, and thus constructed from some data that
preexisted the parent.
To break the loop, one could thus compare that data. In the case at
hand, that would amount to compare the digraph that was use as input
to the Poset constructor.
Even if this occurred from time to time, I guess I would not see this
as a recurrent problem of elements/parent, but of data structures with
loops in general.
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14019#comment:19>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.