semigroups / Semigroups

The GAP package Semigroups
https://semigroups.github.io/Semigroups/
Other
23 stars 35 forks source link

Fix bug in `IrredundantGeneratingSubset` #999

Closed reiniscirpons closed 6 months ago

reiniscirpons commented 6 months ago

Running IrredundantGeneratingSubset with a set of 2 generators of a cyclic semigroup currently causes issues, e.g.

gap> IrredundantGeneratingSubset([Transformation([2, 1]), IdentityTransformation]);
Error, Usage: cannot create a semigroup with no generators ...
gap> IrredundantGeneratingSubset([Transformation([ 1, 1, 3, 1 ]), Transformation([3, 3, 1, 3 ])]);
Error, Usage: cannot create a semigroup with no generators ...

What seems to happen is that the generating set gets reduced to only have 1 generator, but for some reason the check for irredundancy still gets carried out, meaning that we attempt to generate a semigroup with empty generating set, hence the error.

My fix adds a condition in the if statement that causes the error. Not sure this addresses the underlying issue with the stopping logic of the function, but it does fix the error for the two examples above, happy for any further suggestions for fixes.

james-d-mitchell commented 6 months ago

Nice one thanks @reiniscirpons