I'm just working on "fixing the old model", i.e. correctly implement some base extension stuff with recursion that fixes at least 90% of the examples which were broken.
Additionally, I'm not touching any of the has_coerce_map_from() and _coerce_() stuff at all, my new code uses these to decide on things, so improvements on those will be useful. I'm not using change_ring() at all. base_extend() is very well defined. My new functions, for lack of a better name, are: - base_extend_recursive() do a base_extend() but recursively try to extend inside (e.g. Z[x][y] extends by Q by a base_extend() of its base() ) - base_extend_canonical() does a base_extend_recursive() but only if it is canonical; effectively it means that it also tries base_extend_recursive() in the opposite direction and it fails if that one succeeds. Gonzalo On 6/21/07, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > > 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/ -~----------~----~----~----~------~----~------~--~---