#17979: Reimplementation of IntegerListsLex
-------------------------------------+-------------------------------------
       Reporter:  aschilling         |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  blocker            |    Milestone:  sage-6.6
      Component:  combinatorics      |   Resolution:
       Keywords:  days64             |    Merged in:
        Authors:  Bryan Gillespie,   |    Reviewers:
  Anne Schilling, Nicolas M. Thiery  |  Work issues:  support n in an
Report Upstream:  N/A                |  iterable
         Branch:                     |       Commit:
  public/ticket/17979                |  cb18ced22db714063e744bb907a035b4fe3afa24
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by bgillespie):

 Replying to [comment:39 jdemeyer]:
 > There is still this bug:
 > {{{
 > sage: it = iter(IntegerListsLex(4))
 > sage: for _ in range(20): print next(it)
 > [4]
 > [3, 1]
 > [3, 0, 1]
 > [3, 0, 0, 1]
 > [3, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
 > }}}
 > It seems that `[1,3]` will never appear in the output!

 Not a bug, but an issue that's worth discussing.  The premise of
 IntegerListsLex, as I understand it, is that it should return integer
 lists satisfying certain constraints, in lexicographic ordering, starting
 with the largest.  The lists returned in your example are exactly what
 they should be for this specification--none of them is smaller than
 `[1,3]` in lex ordering, since the `4` or `3` in the first position is
 larger than the corresponding `1`.

 The issue is in specifying a priori a total ordering on the set that may
 not be isomorphic with that on NN (in fact, may not even be well-ordered).
 Does it even make sense to call an object which iterates through a proper
 countable subset of a set an iterator?  On the other hand, the iteration
 itself might still be useful in this case.

 At the very least, this behavior is shared with that of the old
 implementation.

--
Ticket URL: <http://trac.sagemath.org/ticket/17979#comment:70>
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to