Skip to content

Commit

Permalink
semirel: fix FroidurePinExtended for pperm monoids
Browse files Browse the repository at this point in the history
Resolves #1674
  • Loading branch information
wilfwilson authored and markuspf committed Sep 9, 2017
1 parent e6c5462 commit a8867a9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/semirel.gi
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ function(m)
local gens, k, free, freegens, actualelts, fpelts, rules, i, u, v, Last,
currentlength, b, s, r, newelt, j, p, new, length, newword, first,
final, prefix, suffix, next, postmult, reducedflags, premult, fpsemi,
old, sortedelts, pos, semi, perm, free2;
old, sortedelts, pos, semi, perm, free2, one;

if not IsFinite(m) then
return fail;
Expand All @@ -972,13 +972,14 @@ function(m)
fi;

#gens:=Set(GeneratorsOfMonoid(semi));
gens:=Set(Filtered(GeneratorsOfMonoid(semi), x-> not IsOne(x)));
one:=One(semi);
gens:=Set(Filtered(GeneratorsOfMonoid(semi), x -> x <> one));
k:=Length(gens);
free:=FreeMonoid(k);
freegens:=GeneratorsOfMonoid(free);
actualelts:=Concatenation([One(semi)], gens);
actualelts:=Concatenation([one], gens);
fpelts:=Concatenation([One(free)], freegens);
sortedelts:=List(Concatenation([One(semi)], gens));
sortedelts:=List(Concatenation([one], gens));

#output

Expand Down
48 changes: 48 additions & 0 deletions tst/testbugfix/2017-09-07-FroidurePinExtendedAlg.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Issue related to FroidurePinExtendedAlg
# Examples reported on issue #1674 on github.com/gap-system/gap
#
gap> sort := function(x, y)
> local rx, ry;
> rx := RankOfPartialPerm(Representative(x));
> ry := RankOfPartialPerm(Representative(y));
> return rx < ry;
> end;;
gap> x := PartialPerm([1]);
<identity partial perm on [ 1 ]>
gap> y := PartialPerm([0]);
<empty partial perm>
gap> S := Semigroup(x, y);
<partial perm monoid of rank 1 with 2 generators>
gap> D := ShallowCopy(GreensDClasses(S));;
gap> Sort(D, sort);
gap> D;
[ <Green's D-class: <empty partial perm>>,
<Green's D-class: <identity partial perm on [ 1 ]>> ]
gap> Elements(S);
[ <empty partial perm>, <identity partial perm on [ 1 ]> ]
gap> S := Semigroup(x, y);
<partial perm monoid of rank 1 with 2 generators>
gap> Elements(S);
[ <empty partial perm>, <identity partial perm on [ 1 ]> ]
gap> D := ShallowCopy(GreensDClasses(S));;
gap> Sort(D, sort);
gap> D;
[ <Green's D-class: <empty partial perm>>,
<Green's D-class: <identity partial perm on [ 1 ]>> ]

#
gap> SymmetricInverseMonoid(2);
<symmetric inverse monoid of degree 2>
gap> D := ShallowCopy(GreensDClasses(last));;
gap> Sort(D, sort);
gap> D;
[ <Green's D-class: <empty partial perm>>,
<Green's D-class: <identity partial perm on [ 1 ]>>,
<Green's D-class: <identity partial perm on [ 1, 2 ]>> ]
#
gap> S := Semigroup(x, y);
<partial perm monoid of rank 1 with 2 generators>
gap> FroidurePinExtendedAlg(S);
gap> LeftCayleyGraphSemigroup(S);
[ [ 1 ], [ 1 ] ]

0 comments on commit a8867a9

Please sign in to comment.