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

Different Monoids share the same name #39144

Open
2 tasks done
tobiasdiez opened this issue Dec 16, 2024 · 4 comments
Open
2 tasks done

Different Monoids share the same name #39144

tobiasdiez opened this issue Dec 16, 2024 · 4 comments
Labels

Comments

@tobiasdiez
Copy link
Contributor

Steps To Reproduce

sage: F = FreeMonoid(3,'x')
sage: F
Free monoid on 3 generators (x0, x1, x2)
sage: F.rename("F")
sage: F
F
sage: G = FreeMonoid(3,'x')
sage: G
F

Expected Behavior

Last call should return Free monoid on 3 generators (x0, x1, x2)

Actual Behavior

Gives the name F

Additional Information

Is this the expected behavior?

Environment

Latest

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
tobiasdiez added a commit to tobiasdiez/sage that referenced this issue Dec 16, 2024
@fchapoton
Copy link
Contributor

And

sage: F is G
True

@mantepse
Copy link
Collaborator

I would exactly this behavior, because F and G are the same monoid.

@user202729
Copy link
Contributor

user202729 commented Dec 17, 2024

Isn't this just because of the unique parent condition? In practice most people don't rename things around like this.

On the other hand… yes, this just reinforces why things with mutable states are not a particularly good idea. Maybe we can make M = RenamedParent(M, "M") and somehow elements of the new parent is a wrapper around elements of the old parent, with .parent() changed…? Would require a massive refactor though.

@tobiasdiez
Copy link
Contributor Author

My

And

sage: F is G
True

I guess this is where my confusion came from: if they have different names, then I wouldn't consider F and G to be the same anymore.

But if it's by design, then we can close this issue.

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

No branches or pull requests

4 participants