diff --git a/lib/sgpres.gi b/lib/sgpres.gi index e1d0674d91..fedcebf5ec 100644 --- a/lib/sgpres.gi +++ b/lib/sgpres.gi @@ -2847,7 +2847,12 @@ local c,offset,f,b,r,i,j,fp,bp; od; if i>r then if f<>alpha then - NEWTC_ModifiedCoincidence(DATA,f,alpha,WordProductLetterRep(-Reversed(fp),y)); + if DATA.useAddition then + NEWTC_ModifiedCoincidence(DATA,f,alpha,-fp+y); + else + NEWTC_ModifiedCoincidence(DATA,f,alpha, + WordProductLetterRep(-Reversed(fp),y)); + fi; fi; return; fi; diff --git a/tst/testbugfix/2023-10-28-GQuotients.tst b/tst/testbugfix/2023-10-28-GQuotients.tst new file mode 100644 index 0000000000..64f6da671e --- /dev/null +++ b/tst/testbugfix/2023-10-28-GQuotients.tst @@ -0,0 +1,7 @@ +# Fix unexpected error in GQuotients. +# See https://github.com/gap-system/gap/issues/5525 +# +gap> G := FreeGroup(2);; +gap> Q := G / [G.1*G.2^-2*G.1, G.1^-1*G.2^-3];; +gap> GQuotients(Q, SmallGroup(12, 1)); +[ ]