#12924: SchubertPolynomialRing causes symmetrica and Sage to crash on bad input
------------------------------------------------+---------------------------
       Reporter:  VivianePons                   |         Owner:  VivianePons 
           Type:  defect                        |        Status:  needs_review
       Priority:  major                         |     Milestone:  sage-5.1    
      Component:  combinatorics                 |    Resolution:              
       Keywords:  days38, Schubert polynomials  |   Work issues:              
Report Upstream:  N/A                           |     Reviewers:              
        Authors:  Viviane Pons                  |     Merged in:              
   Dependencies:                                |      Stopgaps:              
------------------------------------------------+---------------------------
Changes (by {'newvalue': u'Viviane Pons', 'oldvalue': ''}):

  * status:  new => needs_review
  * author:  => Viviane Pons


Old description:

> The SchubertPolynomialRing expects a permutation as an index. When a list
> is given which is not a permutation, the object is created anyway. The
> problem comes when one tries to expand the polynomial, if the index is
> not a valid permutation, it makes symmetrica crash which makes Sage crash
> !
>
> {{{
> sage: S = SchubertPolynomialRing(ZZ)
> sage: pol = S([2,1,3])
> sage: pol.expand()
> x0
> sage: pol = S([2,1,1])
> sage: pol.expand()
> function: mult_apply_integer(2)
> python: function: mult_apply_integer(2)
> : Operation not permitted
> }}}
> So the idea would be to check when the polynomial is created that the
> input is correct and raise an exception at this point if it's not. [[BR]]

New description:

 The SchubertPolynomialRing expects a permutation as an index. When a list
 is given which is not a permutation, the object is created anyway. The
 problem comes when one tries to expand the polynomial, if the index is not
 a valid permutation, it makes symmetrica crash which makes Sage crash !

 {{{
 sage: S = SchubertPolynomialRing(ZZ)
 sage: pol = S([2,1,3])
 sage: pol.expand()
 x0
 sage: pol = S([2,1,1])
 sage: pol.expand()
 function: mult_apply_integer(2)
 python: function: mult_apply_integer(2)
 : Operation not permitted
 }}}
 So the idea would be to check when the polynomial is created that the
 input is correct and raise an exception at this point if it's not.

 New behaviour is now :

 {{{
 sage: X = SchubertPolynomialRing(QQ)
 sage: X._element_constructor_([1,2,1])
 Traceback (most recent call last):
 ...
 ValueError: The input [1, 2, 1] is not a valid permutation
 sage: X._element_constructor_(Permutation([1,2,1]))
 Traceback (most recent call last):
 ...
 ValueError: The input [1, 2, 1] is not a valid permutation

 }}}
 Tests have been added into the documentation.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12924#comment:1>
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