Skip to content

Commit

Permalink
Merge pull request #769 from james-d-mitchell/fix-is-full-trans-semi
Browse files Browse the repository at this point in the history
Fix bug in IsFullTransformationSemigroup
  • Loading branch information
markuspf committed May 3, 2016
2 parents cd4afab + 99ec2b0 commit c42598e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/semitran.gi
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,16 @@ InstallMethod(IsFullTransformationSemigroup, "for a transformation semigroup",
[IsTransformationSemigroup],
function(s)
local n, t;

n := DegreeOfTransformationSemigroup(s);

n:=DegreeOfTransformationSemigroup(s);
if HasSize(s) then
if n = 0 and HasIsTrivial(s) and IsTrivial(s) then
return true;
elif HasSize(s) then
return Size(s)=n^n;
fi;

t:=FullTransformationSemigroup(n);
t:=FullTransformationSemigroup(DegreeOfTransformationSemigroup(s));
return ForAll(GeneratorsOfSemigroup(t), x-> x in s);
end);

Expand Down
27 changes: 27 additions & 0 deletions tst/testinstall/semitrans.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#############################################################################
##
#W semitrans.tst
#Y James D. Mitchell
##
#############################################################################
##

#
gap> START_TEST("trans.tst");
gap> display := UserPreference("TransformationDisplayLimit");;
gap> notation := UserPreference("NotationForTransformations");;
gap> SetUserPreference("TransformationDisplayLimit", 100);;
gap> SetUserPreference("NotationForTransformations", "input");;

# Test IsFullTransformationSemigroup in trivial cases
gap> IsFullTransformationSemigroup(Semigroup(Transformation([1])));
true
gap> IsFullTransformationSemigroup(Semigroup(Transformation([1, 1])));
false

#
gap> SetUserPreference("TransformationDisplayLimit", display);;
gap> SetUserPreference("NotationForTransformations", notation);;

#
gap> STOP_TEST("trans.tst", 74170000);

0 comments on commit c42598e

Please sign in to comment.