Skip to content

Commit

Permalink
fix declaration and method problem and remove ExistsTransversal as a …
Browse files Browse the repository at this point in the history
…method
  • Loading branch information
Tianrun-Y committed Jul 26, 2024
1 parent affb39b commit 27eb838
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 43 deletions.
4 changes: 1 addition & 3 deletions gap/attributes/attr.gd
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ DeclareAttribute("NambooripadLeqRegularSemigroup", IsSemigroup);
DeclareAttribute("NambooripadPartialOrder", IsSemigroup);

DeclareOperation("KernelContainment", [IsTransformation, IsTransformation, IsPosInt]);
DeclareOperation("ExistsTransversal", [IsTransformation, IsTransformation, IsPosInt]);
DeclareAttribute("RegularLeqTransformationSemigroup", IsTransformationSemigroup);
DeclareAttribute("MitschLeqSemigroup", IsSemigroup);
# DeclareAttribute("MitschOrderOfTransformationSemigroup", IsFinite and IsTransformationSemigroup);
DeclareAttribute("MitschOrderOfTransformationSemigroup", IsFinite and IsRegularSemigroup and IsTransformationSemigroup);
DeclareAttribute("MitschOrderOfTransformationSemigroup", IsFinite and IsTransformationSemigroup);
DeclareAttribute("MitschOrderOfSemigroup", IsFinite and IsSemigroup);
DeclareAttribute("DumbMitschOrderOfSemigroup", IsFinite and IsSemigroup);

Expand Down
77 changes: 37 additions & 40 deletions gap/attributes/attr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1079,10 +1079,7 @@ function (a,b,n)
return true;
end);

InstallMethod(ExistsTransversal,
"for two transformations in a transformation semigroup of degree n",
[IsTransformation, IsTransformation, IsPosInt],
function (a,b,n)
SEMIGROUPS.ExistsTransversal := function(a,b,n)
local exists, class, i;
if DegreeOfTransformation(a) > n or
DegreeOfTransformation(b) > n then
Expand All @@ -1101,7 +1098,7 @@ function (a,b,n)
fi;
od;
return true;
end);
end;

InstallMethod(RegularLeqTransformationSemigroup,
"for a transformation semigroup",
Expand All @@ -1112,7 +1109,7 @@ function(S)
return
function(x,y)
#only returns the correct answer if y is a regular element
return KernelContainment(x,y,deg) and ExistsTransversal(x,y,deg);
return KernelContainment(x,y,deg) and SEMIGROUPS.ExistsTransversal(x,y,deg);
end;
end);

Expand All @@ -1131,40 +1128,40 @@ return
end;
end);

# InstallMethod(MitschOrderOfTransformationSemigroup,
# "for a finite transformation semigroup",
# [IsFinite and IsTransformationSemigroup],
# function(S)
# local elts, p, func1, func2, out, i, j,regular, D, a;
# elts := ShallowCopy(Elements(S));
# p := Sortex(elts, {x, y} -> IsGreensDGreaterThanFunc(S)(y, x)) ^ -1;
# func1 := RegularLeqTransformationSemigroup(S);
# func2 := MitschLeqSemigroup(S);
# out := List([1 .. Size(S)], x -> []);
# regular :=ListWithIdenticalEntries(Size(S),false);
# for D in RegularDClasses(S) do
# for a in D do
# i := Position(elts,a);
# regular[i]:=true;
# od;
# od;
# for j in [Size(S),Size(S)-1..1] do
# if regular[j] then
# for i in [j-1,j-2..1] do
# if func1(elts[i], elts[j]) then
# AddSet(out[j ^ p], i ^ p);
# fi;
# od;
# else
# for i in [j-1,j-2..1] do
# if func2(elts[i], elts[j]) then
# AddSet(out[j ^ p], i ^ p);
# fi;
# od;
# fi;
# od;
# return out;
# end);
InstallMethod(MitschOrderOfTransformationSemigroup,
"for a finite transformation semigroup",
[IsFinite and IsTransformationSemigroup],
function(S)
local elts, p, func1, func2, out, i, j,regular, D, a;
elts := ShallowCopy(Elements(S));
p := Sortex(elts, {x, y} -> IsGreensDGreaterThanFunc(S)(y, x)) ^ -1;
func1 := RegularLeqTransformationSemigroup(S);
func2 := MitschLeqSemigroup(S);
out := List([1 .. Size(S)], x -> []);
regular :=ListWithIdenticalEntries(Size(S),false);
for D in RegularDClasses(S) do
for a in D do
i := Position(elts,a);
regular[i]:=true;
od;
od;
for j in [Size(S),Size(S)-1..1] do
if regular[j] then
for i in [j-1,j-2..1] do
if func1(elts[i], elts[j]) then
AddSet(out[j ^ p], i ^ p);
fi;
od;
else
for i in [j-1,j-2..1] do
if func2(elts[i], elts[j]) then
AddSet(out[j ^ p], i ^ p);
fi;
od;
fi;
od;
return out;
end);

InstallMethod(MitschOrderOfTransformationSemigroup,
"for a finite regular transformation semigroup",
Expand Down

0 comments on commit 27eb838

Please sign in to comment.