#16447: do not use identical var names when constructing rings
-----------------------------------+----------------------------
   Reporter:  rws                  |            Owner:
       Type:  defect               |           Status:  new
   Priority:  major                |        Milestone:  sage-6.3
  Component:  commutative algebra  |         Keywords:
  Merged in:                       |          Authors:
  Reviewers:                       |  Report Upstream:  N/A
Work issues:                       |           Branch:
     Commit:                       |     Dependencies:
   Stopgaps:                       |
-----------------------------------+----------------------------
 novoselt in comment 17 of #13360:
 > By the way, I think that this is a bug:
 > {{{
 > sage: QQ["t"]["t"]
 > Univariate Polynomial Ring in t over Univariate Polynomial Ring in t
 over Rational Field
 > }}}
 > Nobody in mathematics uses the same variable in the same expression with
 the same meaning, so there is no reason to support it. Moreover, this may
 indicate a logical error and a user would appreciate catching it. So I
 think that constructions that "add names" should check that they are
 absent in the base ring. This way it would be prohibited to create
 `SR["t"]`, but all polynomials can remain coercible to `SR`.
 >
 > I suppose adding such a check is also not extremely difficult, but care
 should be taken when constructing polynomials "for internal purposes".
 There should be some standard way to get from a ring a name that can work
 as a "new name". And it should raise an exception for SR.
 >
 > I also think that for any element of any ring we should have `R(str(f))
 == f` which is impossible to hope for if we do not insist on distinct
 names for generators.

 I think it's not the worst solution to silently change `["t"]["t"]` to
 `["t1"]["t2"]` automatically.

--
Ticket URL: <http://trac.sagemath.org/ticket/16447>
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