#12649: Bug in initialisation of species
-----------------------------+----------------------------------------------
   Reporter:  hivert         |          Owner:  sage-combinat
       Type:  defect         |         Status:  new          
   Priority:  major          |      Milestone:  sage-5.0     
  Component:  combinatorics  |       Keywords:  Species      
Work_issues:                 |       Upstream:  N/A          
   Reviewer:                 |         Author:               
     Merged:                 |   Dependencies:               
-----------------------------+----------------------------------------------
 The following specification is valid:
 {{{
 sage: Set0  = species.SetSpecies()
 sage: Set1  = species.SetSpecies(min=1)
 sage: Set2  = species.SetSpecies(min=2)
 sage: Four = species.CombinatorialSpecies()
 sage: Four.define(Set2(Four) + Set1*Set0(Four))
 }}}
 However, the following code breaks
 {{{
 sage: Four.generating_series()[1]
 [...]
 ValueError: generator already executing
 }}}
 Strangely enough, adding some seemingly unrelated instruction work
 around it::
 {{{
 sage: Set0  = species.SetSpecies()
 sage: Set1  = species.SetSpecies(min=1)
 sage: Set2  = species.SetSpecies(min=2)

 sage: Set2(Set1).generating_series()[1]
 0

 sage: Four = species.CombinatorialSpecies()
 sage: Four.define(Set2(Four) + Set1*Set0(Four))
 sage: Four.generating_series()[1]
 1
 sage: Four.generating_series()[4]
 52/3
 sage: Four.generating_series()
 x + 2*x^2 + 16/3*x^3 + 52/3*x^4 + O(x^5)
 }}}

 Florent

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12649>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to