On Mon, Nov 12, 2012 at 05:03:58AM +0000, Dima Pasechnik wrote:
> On 2012-11-11, Nathann Cohen <
nathan...@gmail.com> wrote:
> > 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'>,
> > ...
First thing: for those who want to know more on what a facade is:
sage: S = Sets()
sage: S.Facade?
Now, just to put this in perspective. I think many people would find
the following madness if the end result was 3 and not 0:
sage: G = IntegerModRing(3)
sage: G.list()
[0, 1, 2]
sage: a,b,c=G.list()
sage: b+c
0
In the above use case, you want the element of G, as returned by G, to
be aware that they live in G, so that arithmetic get done
accordingly. Similarly, for posets, there are use cases where one
wants a<b to compare a and b in the poset.
All of this to say that both facade and non facade posets are useful.
Now there is the question of the default value for this option. I
think we all agree (including the original poset authors; facades did
not exist back then), that facade=True is the natural default as this
is the most common use case.
The single remaining question is whether the issue is important enough
to break backward compatibility (with an appropriate transition period
of course).
> 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...
:-)
Cheers,
Nicolas
--
Nicolas M. Thi�ry "Isil" <
nth...@users.sf.net>
http://Nicolas.Thiery.name/