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

Print trivial groups with 0 or >=1 generators differently? #2036

Open
fingolfin opened this issue Dec 19, 2017 · 2 comments
Open

Print trivial groups with 0 or >=1 generators differently? #2036

fingolfin opened this issue Dec 19, 2017 · 2 comments
Labels
good first issue Issues that can be understood and addressed by newcomers to GAP development kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements

Comments

@fingolfin
Copy link
Member

fingolfin commented Dec 19, 2017

This was suggested on issue #1239 by @laurentbartholdi

Right now, trivial groups with zero generators are printed/viewed/displayed just like those with >= 1 generators:

gap> g:=Group(());
Group(())
gap> h:=Group([],());
Group(())
gap> Print(h);
Group( () )
gap> Display(h);
Group( () )

The first suggestion then is to print them differently: The output of Print and PrintString (and possibly also String, Display, DisplayString could/should be so that reading it back into GAP recreates the original group. So the two groups in the examples would be different.

The second suggestion is to have ViewObj and ViewString show both groups as Group().

@fingolfin fingolfin added the kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements label Dec 19, 2017
@fingolfin
Copy link
Member Author

My personal thoughts are that the first suggestion is fine. I am not so keen on the second one: With Group(()) I see at a glance that this is a trivial permutation group (as opposed to a trivial pc group, fp group, etc.:

gap> FreeGroup(0);
<free group on the generators [  ]>
gap> TrivialGroup(IsPcGroup);
<pc group of size 1 with 0 generators>

@fingolfin
Copy link
Member Author

Of course one could also print those trivial permutation groups as <perm group of size 1 with 0 generators> resp. <permutation group of size 1 with 1 generators> etc.

Or, if one wants code that "can be read back into GAP", then perhaps TrivialGroup(IsPermGroup) or Group([], ()); for the zero generator version...

@fingolfin fingolfin added the good first issue Issues that can be understood and addressed by newcomers to GAP development label Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that can be understood and addressed by newcomers to GAP development kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements
Projects
None yet
Development

No branches or pull requests

1 participant