I've started working on the new model for coercion too. I believe base extension was only one of the many functors that was going to be implemented.
A note on your code, base_extends() is always supposed to be canonical. change_ring() is for possibly non-canonical "base- extensions," so I'm not sure why you have the two separate functions. If there was any more development the last couple days of SD4, could someone update the wiki? I added a diagram of the current rules for a small group of rings. - Robert On Jun 19, 2007, at 9:03 PM, Gonzalo Tornaria wrote: > Here is a prototype for the tricky part of the coercion (recursive > base extension). > It seems to catch all the examples I came up with. Please test, and > add more examples if needed. I will be rewriting this in py > > Note that this doesn't work for multivariate polynomials (the tests > use recursive univariate polys), but it should work as soon as > canonical coercions from ZZ[x] to ZZ[x,y] are implemented and > ZZ[x,y].has_coerce_map_from(ZZ[x]) returns true. > > I've also got bin_op_c mostly worked out for add/sub/mul/div, this > recursive base extend is a requirement, so I'll be having a patch > soon. The patch essentially adds a step of trying recursive base > extension in both directions, and use the result if exactly one of the > two work. There is some other stuff with division as well (try > "ZZ[x](x) / Mod(2,5)" to see what I mean), but I think I also have > this sorted out. > > Best, Gonzalo > > > > <bext.py> --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---