Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in IsFullTransformationSemigroup #769

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);