Skip to content

Commit

Permalink
semigrp.gi: add One to GeneratorsOfMagma if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Sep 13, 2017
1 parent 74b64e2 commit 6a28c68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gap/semigroups/semigrp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ function(gens, opts)

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

if CanEasilyCompareElements(gens) and not One(gens) in gens then
SetGeneratorsOfMagma(S, Concatenation([One(gens)], gens));
else
if One(gens) in gens then
SetGeneratorsOfMagma(S, AsList(gens));
else
SetGeneratorsOfMagma(S, Concatenation([One(gens)], gens));
fi;
SetGeneratorsOfMagmaWithOne(S, AsList(mgens));

Expand Down
11 changes: 11 additions & 0 deletions tst/testinstall.tst
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,17 @@ gap> S := SingularFactorisableDualSymmetricInverseMonoid(3);
gap> IsMonoidAsSemigroup(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 6a28c68

Please sign in to comment.