Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to revert category initialisation #15234

Closed
simon-king-jena opened this issue Sep 27, 2013 · 5 comments
Closed

Make it possible to revert category initialisation #15234

simon-king-jena opened this issue Sep 27, 2013 · 5 comments

Comments

@simon-king-jena
Copy link
Member

I am introdicing a method sage.structure.parent.Parent._unset_category() that changes the class into the "category-free" base class and resets the ._category cdef attribute to None.

In this way, it is possible to redo a wrong initialisation or refinement of category.

The idea for creating this method arose in #15229: It is possible to do R = IntegerModRing(15, category=Fields()), and then R will believe that it is a field, and will actually be initialised in a sub-category of Fields(). With the new method, it would be possible to revert the wrong category initialisation and re-initialise it correctly.

Disclaimer:

  • I do not think that we should automatically apply this method, e.g., if R.is_field(proof=True) finds out that the modulus actually isn't prime. Its use should be reserved to expert users.
  • It is certainly impossible to erase all bad consequences of an originally wrong choice of a category. E.g., if one wrongly initialises/refines some ring R in the category of integral domains, then one can construct the fraction field, and after R._unset_category() the wrong fraction field would still exist, and would still be accessible from R. Hence, unsetting the category may help to cope with some mistakes, but it can of course not be a global eraser.

Component: categories

Keywords: category initialisation, sd53

Author: Simon King

Branch/Commit: u/SimonKing/ticket/15234 @ 4f77364

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/15234

@simon-king-jena
Copy link
Member Author

Branch: u/SimonKing/ticket/15234

@simon-king-jena
Copy link
Member Author

Author: Simon King

@vbraun
Copy link
Member

vbraun commented Dec 23, 2013

New commits:

4f77364A method to unset category initialisation

@vbraun
Copy link
Member

vbraun commented Dec 23, 2013

Commit: 4f77364

@vbraun
Copy link
Member

vbraun commented Dec 23, 2013

Reviewer: Volker Braun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants