#15223: Let the `TestSuite` test that the construction of a parent returns the
parent
-----------------------------+-------------------------
       Reporter:  SimonKing  |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-5.12
      Component:  coercion   |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+-------------------------

Comment (by SimonKing):

 I did not run the full test suite yet, but I already detected several bugs
 in `.construction()`. So, introducing this test really is a good idea.

 Until now, I found:

 1. Boolean polynomial rings:
    {{{
 sage: P.<x0, x1, x2, x3> =
 BooleanPolynomialRing(4,order='degrevlex(2),degrevlex(2)')
 sage: P.construction()
 (MPoly[x0,x1,x2,x3], Finite Field of size 2)
 sage: F, O = P.construction()
 sage: F(O)
 Multivariate Polynomial Ring in x0, x1, x2, x3 over Finite Field of size 2
 sage: P
 Boolean PolynomialRing in x0, x1, x2, x3
    }}}
    Suggested solution: A boolean polynomial ring is, after all, a quotient
 of a polynomial ring. So, it should be constructed as such, but the
 `QuotientFunctor` should be provided with an additional attribute making
 it notice that a boolean polynomial ring shall be returned.

 2. Integer mod rings that are initialised in a non-default category:
    {{{
 sage: P = IntegerModRing(19, category = Fields())
 sage: F,O = P.construction()
 sage: F(O)
 Ring of integers modulo 19
 sage: P
 Ring of integers modulo 19
 sage: F(O) == P
 False
    }}}
    Why is this? Well, providing a different category changes the class of
 P (this is how the category framework works), and the `__cmp__` method of
 integer mod rings checks for the class. And the construction functor `F`
 is not aware of the category of `P`.

    Suggested solutions: Change `__cmp__` such that `F(O)` evaluates equal
 to `P`, even though `F(O)` is not in the category of fields, or
 alternatively make the construction functor aware of the category, so that
 `F(O)` actually ''is'' in the category of fields.

--
Ticket URL: <http://trac.sagemath.org/ticket/15223#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 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/groups/opt_out.

Reply via email to