From f56c5e3451d4fe90f96c7100bdb5f9b909c65f28 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Tue, 5 Jan 2016 20:39:02 +0000 Subject: [PATCH] Add another ViewString method for inverse semigroups This commit introduces a method for ViewString for semigroups satisfying IsInverseSemigroup and HasGeneratorsOfSemigroup. The rank of the filter IsSemigroup and HasGeneratorsOfSemigroup is 14, whereas the rank of IsInverseSemigroup is 21. Previously, if a semigroup learned that it was inverse but did not have GeneratorsOfInverseSemigroup, then the default ViewString method for IsInverseSemigroup was used. With this commit the more elaborate _ViewStringForSemigroups is used instead. --- lib/semigrp.gi | 7 ++++++- tst/testinstall/semigrp.tst | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/semigrp.gi b/lib/semigrp.gi index 509f37b601..ab837827bd 100644 --- a/lib/semigrp.gi +++ b/lib/semigrp.gi @@ -113,7 +113,12 @@ InstallMethod(ViewString, "for a semigroup with generators", InstallMethod(ViewString, "for a monoid with generators", [IsMonoid and HasGeneratorsOfMonoid], _ViewStringForSemigroups); -InstallMethod(ViewString, "for an inverse semigroup with generators", +InstallMethod(ViewString, "for an inverse semigroup with semigroup generators", +[IsInverseSemigroup and HasGeneratorsOfSemigroup], +_ViewStringForSemigroups); + +InstallMethod(ViewString, +"for an inverse semigroup with inverse semigroup generators", [IsInverseSemigroup and HasGeneratorsOfInverseSemigroup], _ViewStringForSemigroups); diff --git a/tst/testinstall/semigrp.tst b/tst/testinstall/semigrp.tst index fe48046fc7..ddb3014b4c 100644 --- a/tst/testinstall/semigrp.tst +++ b/tst/testinstall/semigrp.tst @@ -431,6 +431,19 @@ false gap> IsEmpty(T); true +# Check for correct ViewString method for IsInverseSemigroup and +# HasGeneratorsOfSemigroup +gap> S := Semigroup(Transformation([4, 3, 5, 5, 5]), +> Transformation([4, 1, 5, 2, 5]), +> Transformation([5, 5, 2, 1, 5])); + +gap> IsInverseSemigroup(S); +true +gap> Size(S); +36 +gap> S; + + # gap> STOP_TEST( "semigrp.tst", 1060000);