-
Notifications
You must be signed in to change notification settings - Fork 33
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
rename variables by default to avoid execute()
clashes in linked libs
#672
Closed
Closed
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d115c79
rename variables by default to avoid `execute()` clashes in linked libs
mjrodgers c83b707
Some formatting cleanup
mjrodgers c6b6c61
rename now maps x => "@OSCAR@"*x*"@"*<number>
mjrodgers e255f31
Fix doctests
mjrodgers 6d68273
Fix messy regex
mjrodgers 661f4cb
Treat all variable names as bad.
mjrodgers d47ac43
fix doctests
mjrodgers 4e47b99
Fix (almost) all tests
mjrodgers 991ec56
fix some messed up tests
mjrodgers aada99e
Merge remote-tracking branch 'upstream/master' into MessyHackFix
mjrodgers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think we should update the variable names here. Instead I would perform this kind of renaming in Oscar.jl
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.
Here in the docstring? Or altogether?
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 at least agree that if I am renaming the variables in Singular.jl, then prepending
@OSCAR@
is not the right approach. I went with this because Singular.jl already had a helper function to rename "bad" variable names. I can create one in Oscar.jl, but when to call it becomes an issue. Because this issue is not just with computing primary decomposition from Singular, we could potentially run into these name clashes any time we call the Singular library.Unrelated, at the moment this renaming is causing a segfault in the tests, during one of the calls to
libSingular.algExt_GetMinpoly
, trying to figure out what is going on with that.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.
Looking into this more, the renaming is sort of a fundamental part of Singular.jl. The type constructors convert to a "good" list of variable names and write them to the Singular objects that they wrap, while maintaining a vector of the corresponding symbols used for the variable names in Julia. I think it would probably break some things to remove this from Singular.jl, and would require some type piracy to handle all of this from the Oscar.jl side.
I think Hans has helped identify the source of the segfault, but regardless, I would honestly vote for just considering every variable name bad, and replace it by
def*<number>
wheredef
is the (already implemented) default taken byrename_symbol
. The reasons being,There are only 3 times when we might see these Singular variable names, and it will always be I think an issue that should be fixed:
Related to 2. above, the Singular.jl polynomial rings have a bad print routine that shows the wrapped variable names (and is in general unintelligeable):
This is in my version that renames all variables, though this occured previously whenever a variable was renamed; we see that the original symbols are properly saved, but the print routine gives us... I'm not even sure what. (But this occurs in Singular.jl, Oscar.jl does not have this problem).