From 8db6c8b7bb0b20dea459173e6496c64081488827 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Tue, 1 Mar 2016 14:17:54 +0000 Subject: [PATCH] Fix ViewString method for inverse monoids Specifically for inverse monoids with GeneratorsOfSemigroup but not with GeneratorsOfInverseSemigroup. Before this commit, the method for ViewString of an inverse monoid (with no generators) had higher priority than the intended method. --- lib/semigrp.gi | 11 ++++++++--- tst/testinstall/semigrp.tst | 12 ++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/semigrp.gi b/lib/semigrp.gi index 92e649648b..40382af249 100644 --- a/lib/semigrp.gi +++ b/lib/semigrp.gi @@ -119,22 +119,27 @@ end); # ViewString -InstallMethod(ViewString, "for a semigroup with generators", +InstallMethod(ViewString, "for a semigroup with semigroup generators", [IsSemigroup and HasGeneratorsOfSemigroup], _ViewStringForSemigroups); -InstallMethod(ViewString, "for a monoid with generators", +InstallMethod(ViewString, "for a monoid with monoid generators", [IsMonoid and HasGeneratorsOfMonoid], _ViewStringForSemigroups); InstallMethod(ViewString, "for an inverse semigroup with semigroup generators", [IsInverseSemigroup and HasGeneratorsOfSemigroup], _ViewStringForSemigroups); +InstallMethod(ViewString, "for an inverse monoid with semigroup generators", +[IsInverseMonoid and HasGeneratorsOfSemigroup], +_ViewStringForSemigroups); + InstallMethod(ViewString, "for an inverse semigroup with inverse semigroup generators", [IsInverseSemigroup and HasGeneratorsOfInverseSemigroup], _ViewStringForSemigroups); -InstallMethod(ViewString, "for an inverse monoid with generators", +InstallMethod(ViewString, +"for an inverse monoid with inverse monoid generators", [IsInverseMonoid and HasGeneratorsOfInverseMonoid], _ViewStringForSemigroups); diff --git a/tst/testinstall/semigrp.tst b/tst/testinstall/semigrp.tst index 61fce1c5a3..07c7f0f31d 100644 --- a/tst/testinstall/semigrp.tst +++ b/tst/testinstall/semigrp.tst @@ -444,6 +444,18 @@ gap> Size(S); gap> S; +# Check correct view method is used for inverse monoids without +# GeneratorsOfInverseSemigroup +gap> S := Monoid(Transformation([1, 2, 3, 4, 5, 6, 7, 7, 7]), +> Transformation([4, 6, 3, 6, 6, 6, 7, 7, 7]), +> Transformation([4, 5, 6, 1, 6, 6, 7, 7, 7]), +> Transformation([6, 6, 3, 1, 6, 6, 7, 7, 7]), +> Transformation([4, 6, 6, 1, 2, 6, 7, 7, 7]));; +gap> IsInverseSemigroup(S); +true +gap> S; + + # gap> STOP_TEST( "semigrp.tst", 1090000);