Skip to content

Commit 09df5ce

Browse files
committed
Store mandarins and their SLPs
1 parent 002d067 commit 09df5ce

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

gap/base/recognition.gi

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ InstallGlobalFunction( RecogniseGeneric,
542542
IsIdenticalObj( methoddb, FindHomDbProjective ),
543543
knowledge
544544
);
545+
ri!.mandarins := mandarins;
545546
if isSafeForMandarins then
546547
SetFilterObj(ri, IsSafeForMandarins);
547548
fi;
@@ -596,19 +597,18 @@ InstallGlobalFunction( RecogniseGeneric,
596597
fi;
597598
fi;
598599

599-
# TODO: store the mandarin SLPs here. Make sure, to only write when succesful.
600-
# check mandarins now
600+
# Check mandarins now
601+
mandarinSLPs := [];
601602
for x in mandarins do
602603
s := SLPforElement(ri, x);
603604
if s = fail then
604-
# TODO: with the master branch rewriting the gens as slps never
605-
# fails. at least we never enter a second iteration of the
606-
# "recognise image" loop.
607605
Info(InfoRecog, 2,
608606
"Enter Mandarin crisis (leaf, depth=", depth, ").");
609607
return MANDARIN_CRISIS;
610608
fi;
609+
Add(mandarinSLPs, s);
611610
od;
611+
ri!.mandarinSLPs := mandarinSLPs;
612612

613613
if InfoLevel(InfoRecog) = 1 and depth = 0 then Print("\n"); fi;
614614
# StopStoringRandEls(ri);
@@ -641,7 +641,7 @@ InstallGlobalFunction( RecogniseGeneric,
641641
Assert(2, y <> fail);
642642
Add(imageMandarins, y);
643643
od;
644-
# TODO: sort the imageMandarins and remove duplicates and trivials
644+
# TODO: sort the imageMandarins and handle duplicates and trivials
645645

646646
counter_image := 1;
647647
repeat
@@ -740,15 +740,32 @@ InstallGlobalFunction( RecogniseGeneric,
740740

741741
# Evaluate mandarins to get kernel mandarins
742742
kernelMandarins := [];
743+
# The image node SLPs are in terms of the generators of the image. Rewrite
744+
# these in terms of the generators of H.
745+
# TODO, compose: slp to pregensfac -> imageMandarinSLPs[i]
746+
# How can I access / store an slpToPregensfac? I don't want to have a
747+
# single slp for every element of pregensfac but one slp which returns all.
748+
# Btw. for kernels this is stored in gensNslp.
749+
imageMandarinSLPs := List(rifac!.mandarinSLPs,
750+
x -> PrependRestrictionToImageNodeSLP(ri, x));
743751
for i in [1..Length(mandarins)] do
744752
x := mandarins[i];
753+
sx := mandarinSLPs[i];
745754
y := imageMandarins[i];
746-
s := SLPforElement(rifac, y);
747-
# TODO: These SLPs should be stored when they are computed for the
748-
# first time. In particular, they can't be fail.
749-
z := ResultOfStraightLineProgram(s, pregensfac(ri));
755+
sy := imageMandarinSLPs[i];
756+
z := ResultOfStraightLineProgram(sy, pregensfac(ri));
750757
if not ri!.isequal(x, z) then
751-
Add( kernelMandarins, x / z );
758+
Add(kernelMandarins, x / z);
759+
# TODO: Can we compute the SLPs here already? Yes, because we know
760+
# how we got the kernels gens?
761+
Add(kernelMandarinSLPs,
762+
# TODO: Is this valid syntax?
763+
mandarinSLPs[i] / imageMandarinSLPs[i]);
764+
else
765+
Add(kernelMandarins, One(Grp(ri)));
766+
Add(kernelMandarinSLPs,
767+
# TODO
768+
trivialCase);
752769
fi;
753770
od;
754771
# TODO: sort the kernelMandarins and remove duplicates and trivials

0 commit comments

Comments
 (0)