Skip to content

Commit

Permalink
Implemented essential dependency check. (#26)
Browse files Browse the repository at this point in the history
* Added function to find permutation groups.

* Attempt to add idempotents no 1.

* Co-authored-by: Thomas Gao <thomasgaozx@users.noreply.github.com>

* Extracting idempotents as transformations.

* Almost done essential dependency.

* It works now.

* cleanup.

* more cleanup.

* Removed extra file.

* Added headers and test.

---------

Co-authored-by: Thomas Gao <z72gao@edu.uwaterloo.ca>
Co-authored-by: Srijan01 <khatrisrijan99@gmail.com>
  • Loading branch information
3 people committed Aug 9, 2023
1 parent 52c2080 commit ef0341c
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
1 change: 1 addition & 0 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ ReadPackage("SgpDec","/lib/cascadegroup.gd");
ReadPackage("SgpDec","/lib/fl.gd");
ReadPackage("SgpDec","/lib/coords.gd");
ReadPackage("SgpDec","/lib/holonomy.gd");
ReadPackage("SgpDec","/lib/lowerbound.gd");
13 changes: 13 additions & 0 deletions lib/lowerbound.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#############################################################################
##
## lowerbound.gd SgpDec package
##
## Copyright (C) 2023
##
## Thomas Gao, Chrystopher L. Nehaniv
##
## Checks essential dependency for Rhodes–Tilson complexity lower bound.
##

DeclareGlobalFunction("IdempotentsForSubset");
DeclareGlobalFunction("CheckEssentialDependency");
67 changes: 67 additions & 0 deletions lib/lowerbound.gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#############################################################################
##
## lowerbound.gd SgpDec package
##
## Copyright (C) 2023
##
## Thomas Gao, Chrystopher L. Nehaniv
##
## Checks essential dependency for Rhodes–Tilson complexity lower bound.
##

InstallGlobalFunction(IdempotentsForSubset,
function(S, sk, set)
local e, IdempotentSet, ssize;
ssize := Size(BaseSet(sk));
IdempotentSet := [];
for e in Idempotents(S) do
# check whether the image of e is set
if OnFiniteSet(BaseSet(sk), e) = set then
Add(IdempotentSet, e);
fi;
od;
return IdempotentSet;
end);

InstallGlobalFunction(CheckEssentialDependency, function(S, sk, d1, d2)
# d1 is lower than d2 so larger set
local G1, CalX2, CalI2, skJ, J, x1, x2, e1, Xt, JGroup;

for x1 in Concatenation(SubductionClassesOnDepth(sk, d1)) do
for x2 in Concatenation(SubductionClassesOnDepth(sk, d2)) do
if IsSubsetBlist(x1, x2) then

for e1 in IdempotentsForSubset(S, sk, x1) do
G1 := SchutzenbergerGroup(HClass(S, e1));

CalX2 := Enumerate(Orb(G1, x2, OnFiniteSet, rec(schreier := true, orbitgraph := true)));
CalI2 := []; #Cal_I2 = all idempotents with images that are members of CalX2;
for Xt in CalX2 do
CalI2 := Concatenation(CalI2, IdempotentsForSubset(S, sk, Xt));
od;

if IsEmpty(CalI2) then
continue;
fi;

J := Semigroup(CalI2);
skJ := Skeleton(J);

if ContainsSet( skJ, x2 ) then
JGroup := PermutatorGroup(skJ, x2);

if Size(JGroup) > 1 then # the stricter test is PermutatorGroup(sk, x2) = JGroup
Assert( 1, PermutatorGroup(sk, x2) = JGroup,
Concatenation("PermutatorGroup(sk, x2) <> JGroup\nx2 = ",
TrueValuePositionsBlistString(x2), "\nx1 = ",
TrueValuePositionsBlistString(x1), "\n") );
return JGroup;
fi;
fi;
od;

fi;
od;
od;
return Group(());
end);
1 change: 1 addition & 0 deletions read.g
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ ReadPackage("SgpDec","/lib/cascadesemigroup.gi");
ReadPackage("SgpDec","/lib/cascadegroup.gi");
ReadPackage("SgpDec","/lib/fl.gi");
ReadPackage("SgpDec","/lib/holonomy.gi");
ReadPackage("SgpDec","/lib/lowerbound.gi");
#just the test calling functions
ReadPackage("SgpDec","/tst/testfunctions.g");
14 changes: 14 additions & 0 deletions tst/lowerbound.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# testing lowerbound
gap> START_TEST("Sgpdec package: lowerbound.tst");
gap> LoadPackage("sgpdec", false);;
gap> SgpDecFiniteSetDisplayOn();;
gap> S := FullTransformationSemigroup(4);;
gap> sk := Skeleton(S);;
gap> CheckEssentialDependency(S, sk, 1,2);
Group([ (2,3), (1,2), (1,3) ])
gap> CheckEssentialDependency(S, sk, 2,3);
Group([ (1,2) ])
gap> SgpDecFiniteSetDisplayOff();;

#
gap> STOP_TEST( "Sgpdec package: lowerbound.tst", 10000);
1 change: 1 addition & 0 deletions tst/testfunctions.g
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SgpDecTestInstall := function()
local test;
for test in [
"lowerbound",
"disjointuniongroup",
"WeakControlWords",
"wreath",
Expand Down

0 comments on commit ef0341c

Please sign in to comment.