-
Notifications
You must be signed in to change notification settings - Fork 161
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
Not all finitely generated magmas are groups #2276
Not all finitely generated magmas are groups #2276
Conversation
... hence we should not set IsFinitelyGeneratedGroup for them. Instead, only set IsFinitelyGeneratedGroup if the family indicates that its elements are associative. Note that this all is only done to avoid a call to the default immediate method for IsFinitelyGeneratedGroup.
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.
The point is whether the result knows that it is associative.
The proposed code checks one possibility why this can be the case.
Wouldn't it be simpler and more general to check the result whether IsAssociative
is set in it, and then to set IsFinitelyGeneratedGroup
?
(I had proposed this already in a comment to #2252.)
Sure, that would be simpler, but it would also be redundant, as by that time, the immediate method would have been triggered anyway. So, this would be equivalent to simply not setting |
Just one remark about immediate methods: |
Of course that's what it says -- and I consider this claim of the manual to be rather unrealistic, because I am pretty sure nobody ever tests GAP with But anyway, I understand this remark in the manual as saying that correctness of code should not rely on immediate methods -- which we wouldn't be here, would we? But not running immediate methods certainly can result in changes in the method selection, and in possibly selecting worse methods. This is what would happen for all kinds of objects and properties already now, e.g. |
Anyway, I'll prepare an alternative PR introducing |
Codecov Report
@@ Coverage Diff @@
## master #2276 +/- ##
==========================================
+ Coverage 70.85% 70.85% +<.01%
==========================================
Files 480 480
Lines 253195 253198 +3
==========================================
+ Hits 179413 179416 +3
Misses 73782 73782
|
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 this should be merged, rather the simpler approach of letting the immediate method for IsFinitelyGeneratedGroup
fire, and avoid the extra complication that this approach.
@james-d-mitchell I'd be fine with this, I still plan to prepare that alternate PR using In any case, it would be very good if @hulpke could chime in, as this code is by him. Also, to underline my conjecture that nobody tests with
There are lots of similar examples, this was just the first. Of course an existing bug does not justify adding another one; but a rule that is already violated in many places perhaps should be re-evaluated? |
... hence we should not set IsFinitelyGeneratedGroup for them. Instead, only set IsFinitelyGeneratedGroup if the family indicates that its elements are associative.
Note that this all is only done to avoid a call to the default immediate method for IsFinitelyGeneratedGroup. I am not really sure whether this is worth the hassle... Perhaps it is when one creates thousands and thousands of groups in a tight loop?
Fixes #2252