Skip to content

Commit

Permalink
semigrp.gi: add One to GeneratorsOfMagma if needed
Browse files Browse the repository at this point in the history
Resolves #371
  • Loading branch information
wilfwilson committed Sep 14, 2017
1 parent f105fe3 commit 91eed4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gap/semigroups/semigrp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function(gens, opts)

S := Objectify(NewType(FamilyObj(gens), filts), rec(opts := opts));

if CanEasilyCompareElements(gens) and not One(gens) in gens then
if not CanEasilyCompareElements(gens) or not One(gens) in gens then
SetGeneratorsOfMagma(S, Concatenation([One(gens)], gens));
else
SetGeneratorsOfMagma(S, AsList(gens));
Expand Down
11 changes: 11 additions & 0 deletions tst/testinstall.tst
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,17 @@ gap> S := Semigroup([
gap> IsInverseSemigroup(S);
false

#T# Issue 371: GeneratorsOfSemigroup for a monoid
gap> R := ReesMatrixSemigroup(Group(()), [[()]]);;
gap> S := MonoidByAdjoiningIdentity(R);
<commutative monoid with 1 generator>
gap> GeneratorsOfSemigroup(S);
[ ONE, (1,(),1) ]
gap> Size(S);
2
gap> Elements(S);
[ ONE, (1,(),1) ]

#T# SEMIGROUPS_UnbindVariables
gap> Unbind(B);
gap> Unbind(D);
Expand Down

0 comments on commit 91eed4b

Please sign in to comment.