On Wed, May 11, 2011 at 04:23:31AM -0700, Bruce wrote:
>    O.K. I think I am getting there slowly. I will expose my ignorance
> 
>    I found the file examples/semigroups.py more useful than
>    examples/monoids.py as the latter just calls the former and adds the unit.

Yup! I knew you would do this step by yourself, and wanted to
illustrate that if you want to implement a Blah, then the first place
to look for is Blahs().example().

>    When I read that the product is a * b = a I thought this was a
>    rather disturbing typo. However when I read
>    examples/semigroups.py I found that the first example actually
>    means this. I think the FreeMonoid documentation also says this
>    and also says that it constructs a free abelian monoid.

I am confused: where do you read this?


>    I now understand that the FreeMonoid in examples/monoids.py has
>    nothing to do with the FreeMonoid in the distribution. I think
>    this is confusing for a novice. In a tutorial a better name would
>    be something different such as NewMonoid or ExampleMonoid.

Hmm. That's what the semigroup tutorial does:

    sage: Semigroups().example()
    An example of a semigroup: the left zero semigroup

and for Monoids, one still gets some visual feedback:

    sage: Monoids().example()
    An example of a monoid: the free monoid generated by ('a', 'b', 'c', 'd')

to compare with:

    sage: FreeMonoid(1, 'a')
    Free monoid on 1 generators (a,)

See also:

    sage: Category.example?

Now, I very much see how one can miss those pieces of
documentations. Suggestions for where to insert the appropriate
pointers are welcome, as you have a better view than us about what a
newcomer will find or not.

I have just added a link so that now the top of:

    sage: M = Monoids.example()
    sage: M?

reads as:

       An example of a monoid: the free monoid

       This class illustrates a minimal implementation of a monoid.
       For a full featured implementation of free monoids, see
       :func:`FreeMonoid`.


>    What I now understand and I assume no-one actually said as it is too
>    obvious (or maybe I was told and did not get it) is:
>    To implement a new monoid I define a new class which inherits from Parent.
>    The class definition has to include the line
>    Parent.__init__(self,category=Monoids())
>    Then I also have to implement class methods which are listed by
>    Monoids.ParentMethods

Correct. This is far from obvious! I usually take some time to explain
the example when running this tutorial live. A written tutorial is
always harder because one has to find the right balance in how much
detail is given. There is a description of those facts in
``Category?'', but it is too technical. I would very much welcome a
concise yet informative explanation of the semigroup example code, to
be inserted just before ``Rename the class to ShiftSemigroup, and
modify ...'' in:

    http://combinat.sagemath.org/doc/reference/sage/categories/tutorial.htm

>    Then reading these files I have some further questions: What is
>    the rationale for Family?

I'll return the question: what is the rationale of the concept of
family in mathematics? The purpose of Family in Sage is precisely to
model this concept. Suggestions to improve the top of the
documentation of ``Family?'' along those lines are welcome.

> and what is ElementWrapper all about?

Implementing quickly new elements whose data structure consists of a
single preexisting object. An instance of ElementWrapper is an Element
which Wraps some other object (e.g. a poset for your purposes).

Here also, appropriate wording to improve ``ElementWrapper?'' is
welcome.

And we really should remove the warning on top of ElementWrapper; it
is simply wrong.

Best,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

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

Reply via email to