-
Notifications
You must be signed in to change notification settings - Fork 162
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
call GroupByGenerators
, GroupWithGenerators
with domain
#3091
Conversation
change the default methods for `GroupByGenerators` and `GroupWithGenerators` such that the problem gets fixed that had been introduced with pull request gap-system#2522 and discussed in issue gap-system#2703
elif HasGeneratorsOfMagmaWithOne( gens ) then | ||
gens:= GeneratorsOfMagmaWithOne( gens ); | ||
elif HasGeneratorsOfMagma( gens ) then | ||
gens:= GeneratorsOfMagma( gens ); |
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.
Hmm. If we do this for GroupByGenerators, shouldn't we also add similar methods to all other *ByGenerators*
functions? But there are dozens of these. So I am rather inclined to go the other direction, and say we shouldn't do this at all...
I found these *ByGenerator operations:
AdditiveGroupByGenerators
AdditiveMagmaByGenerators
AdditiveMagmaWithInversesByGenerators
AdditiveMagmaWithZeroByGenerators
AlgebraByGenerators
AlgebraWithOneByGenerators
BiAlgebraModuleByGenerators
DefaultFieldByGenerators
DefaultRingByGenerators
DivisionRingByGenerators
DomainByGenerators
FLMLORByGenerators
FLMLORWithOneByGenerators
FieldByGenerators
FieldOverItselfByGenerators
GroupByGenerators
IdealByGenerators
InducedPcgsByGenerators
InducedPcgsByGeneratorsNC
InverseMonoidByGenerators
InverseSemigroupByGenerators
IsomorphismFpGroupByGenerators
IsomorphismFpGroupByGeneratorsNC
LeftAlgebraModuleByGenerators
LeftIdealByGenerators
LeftMagmaIdealByGenerators
LeftModuleByGenerators
MagmaByGenerators
MagmaIdealByGenerators
MagmaWithInversesByGenerators
MagmaWithOneByGenerators
MonoidByGenerators
NaturalHomomorphismByGenerators
NearAdditiveGroupByGenerators
NearAdditiveMagmaByGenerators
NearAdditiveMagmaWithInversesByGenerators
NearAdditiveMagmaWithZeroByGenerators
OrbitStabilizerListByGenerators
RepresentativeTomByGenerators
RepresentativeTomByGeneratorsNC
RightAlgebraModuleByGenerators
RightIdealByGenerators
RightMagmaIdealByGenerators
RingByGenerators
RingWithOneByGenerators
SemigroupByGenerators
SemigroupIdealByGenerators
SemiringByGenerators
SemiringWithOneAndZeroByGenerators
SemiringWithOneByGenerators
SemiringWithZeroByGenerators
TwoSidedIdealByGenerators
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.
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.
But the old code never did something like this. It just took the set of elements of the given domain / collection as generators.
|
||
return G; | ||
return ObjectifyWithAttributes( rec(), typ, | ||
GeneratorsOfMagmaWithInverses, gens ); | ||
end ); |
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.
This completely changes formatting, but (as far as I could tell) really only inserts a single, line, gens:= AsList( gens );
, and then replaces one AsList(gens)
later by gens
.
I'd really prefer if this changes was kept to the minimum, for ease of reviewing.
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.
Note that gens
is used by MakeGroupyType
.
This is where the error happens in the old version.
|
||
return G; | ||
return ObjectifyWithAttributes( rec(), typ, | ||
GeneratorsOfMagmaWithInverses, gens, One, id ); | ||
end ); |
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.
Same as above.
|
||
return G; | ||
return ObjectifyWithAttributes( rec(), typ, | ||
GeneratorsOfMagmaWithInverses, empty, One, id ); | ||
end ); |
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 am not even sure what has changed in this function. Was anything changed, other than rearranging the code and reformatting it?
I am thinking whether it will be easier and more consistent to adapt CTblLib to call First of all, as we can see from the list collected by @fingolfin, doing this consistently would require changing more methods. Second, while it seemed a good idea to me initially, it's not any more. The meaning of the names |
@alex-konovalov I disagree completely. |
@ThomasBreuer resolving this problem was classified as highly desirable, but not critical in #2804, therefore it was not considered as blocking the release. Moreover, from time to time we are making changes that break backwards compatibility, and we are permitting this to happen in major releases. Sometimes this happens due to introducing stricter checks of arguments, like e.g. in #2107, #2756, so breaking things results in a more robust and efficient code. Consider the following example that was possible before in GAP 4.9 but will not happen in GAP 4.10:
Note that the new behaviour of |
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 explained in the recent comment my arguments against accepting this PR. In addition, it changes the behaviour of GroupByGenerators
and GroupWithGenerators
by allowing them to accept domains as arguments, but does not document that, and that makes this pull request incomplete.
@alex-konovalov I disagree completely.
|
@ThomasBreuer I agree that both of us may disagree. I for example disagree with calling this a bug in GAP - IMHO it's a side effect of another change, which happen to reveal some inefficiencies in some other code. Nevertheless, I agree to go for #3095 which has lesser scope than this PR, just restoring the previous behaviour, and still keeping it undocumented. I hope that this will fix several diffs in CTblLib package for now, but not all of them - can I just remind you since you may not have seen updates in #1619 that a new release of CTblLib with cleanly passing tests (as well as a new release of AtlasRep) will be most welcomed! I intend to add a warning (for master branch, to appear in GAP 4.11) to be displayed when GroupWithGenerators is called on something which is not a list - if that will be accepted, it will cause warnings for CTblLib tests in their current state. |
change the default methods for
GroupByGenerators
and
GroupWithGenerators
such that the problem gets fixedthat had been introduced with pull request #2522
and discussed in issue #2703