Retry kernel recognition for missing generators#519
Conversation
Final verification can expose a missing residual kernel element. Add it to gensN and rerun kernel recognition before aborting. Co-authored-by: Codex <codex@openai.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #519 +/- ##
==========================================
- Coverage 86.51% 86.51% -0.01%
==========================================
Files 45 45
Lines 19262 19284 +22
==========================================
+ Hits 16665 16684 +19
- Misses 2597 2600 +3
🚀 New features to boost your workflow:
|
| for i in [1..Length(GeneratorsOfGroup( H ))] do | ||
| h := GeneratorsOfGroup( H )[i]; | ||
| if SLPforElement(ri, h) = fail then | ||
| x := ImageElm(Homom(ri), h); |
There was a problem hiding this comment.
Hrm, I guess if this returns fail at this point, we are in deep troubles, and ought to abort. Actually, if we did everything right before getting here, shouldn't this be effectively impossible? Hrm.
There was a problem hiding this comment.
I think x could potentially be fail if KernelRecogNode(ImageRecogNode(ri)) is too small. In any case, I agree that we ought to abort in this situation (which is what the code currently does).
There was a problem hiding this comment.
Actually, my statement that the code currently aborts in this situation is not entirely correct. I think it does not abort in the following situation:
- The for loop finds some
hwithSLPforElement(ri, h) = fail, andx := ImageElm(Homom(ri), h)is notfailfor thish, ands := SLPforElement(ImageRecogNode(ri), x)is also not fail. This results indonebeing set tofalse. - In a later iteration of the for loop, we find some
hwithSLPforElement(ri, h) = fail, but this timex := ImageElm(Homom(ri), h)isfail. Sincedoneis stillfalsefrom a previous iteration, the code does not abort.
| if x <> fail then | ||
| s := SLPforElement(ImageRecogNode(ri), x); | ||
| else | ||
| s := fail; | ||
| fi; | ||
| if s <> fail then | ||
| y := ResultOfStraightLineProgram(s, ri!.pregensfacwithmem); | ||
| z := ri!.gensHmem[i] * y^-1; | ||
| if not isone(ri)(z) and | ||
| not ForAny(gensN(ri), x -> isequal(ri)(x, z)) then | ||
| Add(gensN(ri), z); | ||
| Info(InfoRecog, 2, | ||
| "Final verification found extra kernel ", | ||
| "element (depth=", depth, ")."); | ||
| done := false; | ||
| fi; | ||
| fi; | ||
| if done then | ||
| # NiceGens(ri) is too small, abort | ||
| if InfoLevel(InfoRecog) = 1 and depth = 0 then | ||
| Print("\n"); | ||
| fi; | ||
| Info(InfoRecog, 1, | ||
| "RecogNode <ri> could not be recognised,", | ||
| " IsReady(<ri>) is not set, recognition aborts"); | ||
| return ri; | ||
| fi; |
There was a problem hiding this comment.
| if x <> fail then | |
| s := SLPforElement(ImageRecogNode(ri), x); | |
| else | |
| s := fail; | |
| fi; | |
| if s <> fail then | |
| y := ResultOfStraightLineProgram(s, ri!.pregensfacwithmem); | |
| z := ri!.gensHmem[i] * y^-1; | |
| if not isone(ri)(z) and | |
| not ForAny(gensN(ri), x -> isequal(ri)(x, z)) then | |
| Add(gensN(ri), z); | |
| Info(InfoRecog, 2, | |
| "Final verification found extra kernel ", | |
| "element (depth=", depth, ")."); | |
| done := false; | |
| fi; | |
| fi; | |
| if done then | |
| # NiceGens(ri) is too small, abort | |
| if InfoLevel(InfoRecog) = 1 and depth = 0 then | |
| Print("\n"); | |
| fi; | |
| Info(InfoRecog, 1, | |
| "RecogNode <ri> could not be recognised,", | |
| " IsReady(<ri>) is not set, recognition aborts"); | |
| return ri; | |
| fi; | |
| abort := false; | |
| if x <> fail then | |
| s := SLPforElement(ImageRecogNode(ri), x); | |
| else | |
| s := fail; | |
| abort := true; | |
| fi; | |
| if s <> fail then | |
| y := ResultOfStraightLineProgram(s, ri!.pregensfacwithmem); | |
| z := ri!.gensHmem[i] * y^-1; | |
| if not isone(ri)(z) and | |
| not ForAny(gensN(ri), x -> isequal(ri)(x, z)) then | |
| Add(gensN(ri), z); | |
| Info(InfoRecog, 2, | |
| "Final verification found extra kernel ", | |
| "element (depth=", depth, ")."); | |
| done := false; | |
| else | |
| # This should not be possible: If z is one or already in gensN(ri), | |
| # then we should have been able to find an SLP for h in the first place. | |
| abort := true; | |
| fi; | |
| fi; | |
| if abort then | |
| # NiceGens(ri) is too small, abort | |
| if InfoLevel(InfoRecog) = 1 and depth = 0 then | |
| Print("\n"); | |
| fi; | |
| Info(InfoRecog, 1, | |
| "RecogNode <ri> could not be recognised,", | |
| " IsReady(<ri>) is not set, recognition aborts"); | |
| return ri; | |
| fi; |
I think this change makes the code abort as it should.
Final verification can expose a missing residual kernel element. Add it to gensN and rerun kernel recognition before aborting.
Co-authored-by: Codex codex@openai.com