On 2012-11-11, Nathann Cohen <nathann.co...@gmail.com> wrote:
> --14dae9340db323c21304ce3faaf8
> Content-Type: text/plain; charset=ISO-8859-1
>
> Helloooooooooooooo everybody !!!
>
> I spent many hours fighting with Posets under Sage. I enjoyed it a lot, but
> I can already tell that it gets on Florent's and Nicolas' nerves, and so I
> was thinking of whether I should put an end to it. For their sake.
>
> Here's the problem. With comments.
>
> -------------------------------
> Building the poset from a DiGraph defined on integers :
> sage: g = DiGraph([(1,2),(1,3),(2,4),(3,4)])
> sage: p = Poset(g)
>
> Is 3 in the poset ?
>
> sage: 3 in p
> True
>
> Of course it is !
>
> sage: list(p)
> [1, 2, 3, 4]
> sage: 3 in list(p)
> False
>
> Not it is not ! So what the hell is this list [1,2,3,4] that we get as a
> result to list(p) ?
>
> sage: map(type,list(p))
> [<class
> 'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>,
><class
> 'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>,
><class
> 'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>,
><class
> 'sage.combinat.posets.elements.FinitePoset_with_category.element_class'>]
>
> O_O;;;
>
> sage: p.cover_relations()
> [[1, 2], [1, 3], [2, 4], [3, 4]]
> sage: [1,3] in p.cover_relations()
> False
> sage: (1,3) in p.cover_relations()
> False
>
> And of course :
>
> sage: p.hasse_diagraph() == g
> False
> ------------------------
>
> WELL. I personally consider that this behaviour is totally crazy, and I
> often say so (very loud, and very frequently. Just come eat with us anyday
> at lunch and I will probably complain about that, or about LaTeX). This
> being said, I also heard that it may possibly make sense in a very sick
> logic, and that the correction of some code may actually depend on that.
>
> I personally think that having this as the default behaviour of Poset is
> *madness*. I personally *ONLY* use Posets with he flag "facade = True" when
> I do not forget it, and lose half an hour when I do forget it. What would
> you think of making it the default behaviour of Poset ? This way, normal
> people could use a Poset without having to know what a facade is. Without
> having to hear about parents, elements, the .value() method and all.
> I mean. Why the hell should this stay the default behaviour ?

I agree that this looks very odd. A poset is a pair (set, binary
relation), and one would fully expect that list() will produce
the list of the elements in the set ordered in a way preserving
the partial order...
Actually, I tried googling poset+facade, and all the maths hits are
Sage, with an exception of a dissertation on posets, where the only
place the word "facade" is used is the following quote:
 
  It turns out that an eerie type of chaos
  can lurk just behind a facade of order
  and yet, deep inside the chaos
  lurks an even eerier type of order.
                                  D. Hofstadter

Thus indeed, we should not show "an eerie type of chaos",
unless a user expicitly asks for it...

Best,
Dima


>
> Thank you for listening. Very soon, I hope to convince you that the way
> Poset.relabel is written is an insult to computer science. I think I may
> already have convinced Florent Hivert of the sin this method is.
>
> Nathann
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to