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

Provide TrivialGroupCons for IsFpGroup #2037

Merged
merged 4 commits into from
Jan 10, 2018

Conversation

fingolfin
Copy link
Member

No description provided.

@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: library labels Dec 19, 2017
Copy link
Contributor

@hulpke hulpke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, but why is there an IsFinite filter?

@codecov
Copy link

codecov bot commented Dec 19, 2017

Codecov Report

Merging #2037 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #2037      +/-   ##
==========================================
- Coverage   66.03%   66.02%   -0.01%     
==========================================
  Files         898      898              
  Lines      273398   273399       +1     
  Branches    12792    12792              
==========================================
- Hits       180528   180525       -3     
- Misses      90039    90042       +3     
- Partials     2831     2832       +1
Impacted Files Coverage Δ
grp/basicfp.gi 89.1% <0%> (-0.9%) ⬇️
lib/queue.g 66.4% <0%> (-3.2%) ⬇️
src/hpc/traverse.c 77.99% <0%> (-0.78%) ⬇️
src/hpc/thread.c 45.81% <0%> (-0.2%) ⬇️
src/hpc/threadapi.c 34.74% <0%> (+0.09%) ⬆️
src/funcs.c 76.37% <0%> (+0.13%) ⬆️
src/stats.c 79.43% <0%> (+0.13%) ⬆️
hpcgap/lib/hpc/stdtasks.g 38.87% <0%> (+0.25%) ⬆️

@fingolfin
Copy link
Member Author

To be honest: simply because it's there in the other TrivialGroupCons installations.

But I am not sure why it is there. I mean, in theory it affects the rank of this constructor (which is -1 times the rank of the first filter, i.e. of IsFpGroup and IsFinite); the IsFinite thus makes the method more special; in theory that would leave room for a constructor with just the filter IsFpGroup. But I can't think of any plausible reason why that would ever be useful or otherwise relevant...

Perhaps @stevelinton has some insight?

@fingolfin
Copy link
Member Author

Would be nice to get feedback from @stevelinton

Other than that, I wonder if I should target this at stable-4.9 instead of master? It's not a bug fix, but OTOH it's a rather trivial change that shouldn't cause any bad regressions. I am happy either way, just wanted to mention the possibility for completeness.

@stevelinton
Copy link
Contributor

For a constructor it makes sense to put every filter that the returned object is guaranteed to have in that position. With the method as is, we get:

gap> TrivialGroupCons(IsFpGroup and IsAbelian);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `TrivialGroupCons' on 1 arguments at /
.....

So having IsFinite here means that if the caller asks for their trivial group to be finite, this method will still apply, arguably IsTrivial should be there instead.

In fact, what seems to make sense is for each constructor to have a set of flags that should apply to any object produced by any method for that constructor (possibly not OtherMethods) and to silently include them in the first requirement. So all methods for TrivialGroupCons would know that they produced a trivial (and so finite, abelian, etc.) group.

@olexandr-konovalov
Copy link
Member

I'm inclined to say yes for going into stable-4.9 branch. Perhaps after 4.9.0 will be published, I'd be more conservative, but for now yes. @fingolfin could you please switch this PR to stable-4.9 branch?

@fingolfin fingolfin changed the base branch from master to stable-4.9 January 9, 2018 11:42
In particular, indicate if the groups are trivial / cyclic /
abelian / elementary abelian.

Also fix a bug in AbelianGroupCons for fp groups, which indicated
that it always returns a finite group, which is not true (just pass
in 0 resp. infinity as abelian invariant).
@fingolfin
Copy link
Member Author

Updated:

  • switched to stable-4.9
  • added IsTrivial filter as suggested by @stevelinton, and also adjusted filters of several other constructors
  • fixed at least one incorrect constructor filter
  • documented that AbelianGroup and CyclicGroup actually allow creating infinite groups (this has been possible for several years now)
  • while add it, also added (and documented) support for DihedralGroup(infinity)

Of course with these changes the PR becomes bigger. If people are concerned about this, I can also move some or all of the additional changes to a different PR.

@stevelinton With this PR, TrivialGroupCons(IsFpGroup and IsTrivial); works, but TrivialGroupCons(IsFpGroup and IsAbelian); still does not; it seems implications are not taken into account. Of course I can manually add IsAbelian, and any other implied filters, but I wonder if this should be done automatically after all? I.e. for a constructor, replace the first argument filter by its implications? An enhancement for another PR?

@stevelinton
Copy link
Contributor

@fingolfin my issue crossed with your PR update. I'd suggest making this change in stable-4.9 if checks pass and trying to get this properly sorted out in 4.10.

@fingolfin fingolfin modified the milestone: GAP 4.9.0 Jan 9, 2018
@fingolfin fingolfin merged commit d8566ae into gap-system:stable-4.9 Jan 10, 2018
@fingolfin fingolfin deleted the mh/trivial-fp-groups branch January 10, 2018 09:31
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.9.0 milestone Jan 21, 2018
@olexandr-konovalov olexandr-konovalov added the release notes: added PRs introducing changes that have since been mentioned in the release notes label Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: added PRs introducing changes that have since been mentioned in the release notes topic: library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants