Skip to content

Commit

Permalink
adding bestiary tests for the Covering Lemma method
Browse files Browse the repository at this point in the history
  • Loading branch information
egri-nagy committed Jun 18, 2024
1 parent 8f11f07 commit a5eef4b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
2 changes: 2 additions & 0 deletions lib/emulation.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ DeclareGlobalFunction("Mu");

DeclareGlobalFunction("TestEmulationWithMorphism");
DeclareGlobalFunction("TestEmulation");

DeclareInfoClass("EmulationInfoClass");
42 changes: 24 additions & 18 deletions lib/emulation.gi
Original file line number Diff line number Diff line change
Expand Up @@ -186,29 +186,35 @@ InstallGlobalFunction(TestEmulationWithMorphism,
function(S,theta, phi)
local psi, mu, lifts;
#1st to double check that we have a relational morphism
Print("Surjective morphism works? ",
IsTSRelMorph(theta, phi, OnPoints, OnPoints),
"\n");
if not IsTSRelMorph(theta, phi, OnPoints, OnPoints) then
Info(EmulationInfoClass, 1, "Surjective Morphism failed!");
return false;
fi;
#now creating the coordinatized version
psi := Psi(theta);
mu := Mu(theta, phi);
# Can the cascade emulation the original
Print("Emulation works? ",
IsTSRelMorph(psi, mu, OnPoints, OnCoordinates),
"\n");
Print("Interpretation works? ",
IsTSRelMorph(InvertHashMapRelation(psi),
InvertHashMapRelation(mu),
OnCoordinates,
OnPoints),
"\n");

if not IsTSRelMorph(psi, mu, OnPoints, OnCoordinates) then
Info(EmulationInfoClass, 1, "Emulation failed!");
return false;
fi;
if not IsTSRelMorph(InvertHashMapRelation(psi),
InvertHashMapRelation(mu),
OnCoordinates,
OnPoints) then
Info(EmulationInfoClass, 1, "Interpretation failed!");
return false;
fi;
lifts := ImageOfHashMapRelation(mu);
#the size calculation might be heavy for bigger cascade products
Print("|S|=", Size(S), " -> (",
Size(lifts) , ",",
Size(Semigroup(lifts)), ",",
Size(Semigroup(Concatenation(List(Generators(S), s-> mu[s])))),
") (#lifts, #Sgp(lifts), #Sgp(mu(Sgens)))");
Info(EmulationInfoClass, 1,
Concatenation("|S|=", Size(S), " -> (",
Size(lifts) , ",",
Size(Semigroup(lifts)), ",",
Size(Semigroup(Concatenation(List(Generators(S), s-> mu[s])))),
") (#lifts, #Sgp(lifts), #Sgp(mu(Sgens)))"));
return true;
end);

# creates the default n(n-1) covering
Expand All @@ -219,5 +225,5 @@ local n, theta, phi;
#the standard covering map described in the Covering Lemma paper
theta := ThetaForPermutationResets(n);
phi := PhiForPermutationResets(S);
TestEmulationWithMorphism(S, theta, phi);
return TestEmulationWithMorphism(S, theta, phi);
end);
12 changes: 12 additions & 0 deletions tst/emulation.tst
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
gap> START_TEST("Emulation (Covering Lemma)");
gap> LoadPackage("sgpdec", false);;
gap> Read(Concatenation(PackageInfo("sgpdec")[1]!.InstallationPath,
> "/tst/bestiary.g"));;
gap> TestEmulation(BEX);
true
gap> TestEmulation(BECKS);
true
gap> TestEmulation(HEYBUG);
true
gap> TestEmulation(OVLCOVERS);
true
gap> TestEmulation(LASTMINUTE);
true

gap> STOP_TEST( "Emulation Covering Lemma");

0 comments on commit a5eef4b

Please sign in to comment.