Hi! On Sat, Jan 01, 2011 at 05:31:13PM -0500, Sébastien Labbé wrote: > > De Bruijn sequences are finite words. It would seem logical to include > > De Bruijn sequences as finite words, since they do fit the definition. > > Amongst the method of the class WordGenerator, most return infinite > words but some return finite words (like PalindromicDefectWord, > RandomWord and fibonacci_tile). > > So if it is a finite word, then it could be represented as a python > list, tuple, str, a function {0,1,2...n} -> or a finite iterator.
Thanks Sébastien for the feedback! > > What is the reason for not including necklaces and Lyndon Words there, > > for example? Are they not also words? They point is that, for necklaces, Lyndon words, dyck words, and the like, the main mathematical object is not a word, but a set of words. And the main operations are to count them, to iterate through them, etc. So everything revolves around the corresponding enumerated sets of words: Necklaces([2,1,1]), DyckWords(n), ... Granted, there is still some merging and cleanup to do. For example, the elements of DyckWords(n) could possibly be returned as words, etc. Comming back to DeBruijn sequences, I see two options: - Either we clearly foresee that people will eventually be interested in operations like counting or iterating through all DeBruijn sequences for a given alphabet/n. And then the entry point for the user shall be: sage: DeBruijnSequences(alphabet, n) The set all de Bruijn sequences over ... with a 's', even if for the moment an_element is the only implemented feature: sage: DeBruijnSequences(alphabet, n).an_element() [ .... ] - Or all we really care about is to construct one De Bruijn sequence for that alphabet and n, and then it should be: sage: words.DeBruijnSequence(alphabet,n) [ ... ] An independent question is to decide whether the result shall be a tuple, a word, or ... It is perfectly fine to leave this not specified to leave our hands free for the future; e.g. just say that the result is an iterable l which also supports random access (i.e. l[i]), and possibly len(l). I let you choose whatever feels more appropriate! Cheers, 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-de...@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.