-
Notifications
You must be signed in to change notification settings - Fork 73
Introduce upgrade! for universal polynomials
#2211
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
Conversation
498f600 to
cf410ff
Compare
|
I see where the problem is but I'm not sure if it is a problem with the change or if |
|
Some opinions on this:
It would be great if @fingolfin could also have a look at this. |
Then this should work for multivariate polynomials too. I mean evaluating multivariate polynomials at univariate polynomials. The line you referenced fails if we take |
|
I am just talking about the evaluate cases, where we substitute all variables. If we just substitute a proper subset of variables, then it should remain in the Univ poly ring (i.e. univariate polys are not allowed). |
Ok, so in contrast to multivariate polynomials you think we should allow evaluating universal polynomials at the first |
|
I'd say we should also allow evaluating multivariate polynomials in this way. So, things like this should actually work: I think this should simply return |
|
So, I've removed the test which failed. This test depended on the creation time of the constant universal polynomial |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2211 +/- ##
==========================================
- Coverage 88.01% 87.97% -0.04%
==========================================
Files 127 127
Lines 31765 31749 -16
==========================================
- Hits 27957 27932 -25
- Misses 3808 3817 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I don't like to always say "no", but I would prefer for this to still error. Edit: There is no need to be "consistent" with universal polynomials. I think they don't have a well-defined notion of "number of variables" anyway. |
With #2214 this still errors, even for universal polynomials. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is good as it is and should be merged so that we can progress with other work. The situation with evaluate(f, ...) vs subst(f, ...) vs f(...) is something we should also tackle, but IMHO it is not very relevant for this PR. For it just makes an existing issue with evaluate for universal polynomial rings more prominent -- after all, one can make a slightly different version of the removed test which will trigger the issue also in the current version of the code.
I'll wait a bit with merging in case @thofma or @lgoettgens (or anyone else for that matter) has some final concerns -- but my impression from the discussion so far was that nobody really objected to this PR, the discussion was more focused on how to "fix" evaluate (here by "fix" I include the option "make sure it keeps erroring, but more consistently")
As discussed in #2206 I've added a new
upgrade!method which is better suited for the use in the universal polynomial code thanupgradewas before.Now one can even argue that the original
upgrademethod could be removed. I'm fine with that or leaving it as is. In #2198 things will change anyway.