From 0918d9756392fe76a055a27cccc5b5b789429d19 Mon Sep 17 00:00:00 2001 From: Wilf Wilson Date: Wed, 13 Sep 2017 16:56:58 +0100 Subject: [PATCH] semigrp.gi: add One to GeneratorsOfMagma if needed Resolves #371 --- gap/semigroups/semigrp.gi | 4 ++-- tst/testinstall.tst | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gap/semigroups/semigrp.gi b/gap/semigroups/semigrp.gi index b2a13dc415..a4fa578ac6 100644 --- a/gap/semigroups/semigrp.gi +++ b/gap/semigroups/semigrp.gi @@ -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 + if not CanEasilyCompareElements(gens) or not One(gens) in gens then SetGeneratorsOfMagma(S, Concatenation([One(gens)], gens)); else - SetGeneratorsOfMagma(S, AsList(gens)); + SetGeneratorsOfMagma(S, gens); fi; SetGeneratorsOfMagmaWithOne(S, AsList(mgens)); diff --git a/tst/testinstall.tst b/tst/testinstall.tst index 41d4dc8db7..9c8e9ce5b6 100644 --- a/tst/testinstall.tst +++ b/tst/testinstall.tst @@ -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); + +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);