Skip to content

Commit

Permalink
Fix ViewString method for inverse monoids
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
james-d-mitchell committed Aug 17, 2016
1 parent b8d862d commit dae6c75
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/semigrp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 12 additions & 0 deletions tst/testinstall/semigrp.tst
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,18 @@ gap> Size(S);
gap> S;
<inverse transformation semigroup of size 36, degree 5 with 3 generators>

# 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;
<inverse transformation monoid of size 18, degree 9 with 5 generators>

#
gap> STOP_TEST( "semigrp.tst", 1090000);

Expand Down

0 comments on commit dae6c75

Please sign in to comment.