From 1547c7db27b411464f7009603e77ffa341f733b3 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Mon, 23 Oct 2017 01:56:17 +0200 Subject: [PATCH 1/2] Correct MagmaWith{One|Inverses] 'no method found' error. --- lib/magma.gi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/magma.gi b/lib/magma.gi index 8927ee66db..96fb7c42ca 100644 --- a/lib/magma.gi +++ b/lib/magma.gi @@ -418,7 +418,7 @@ InstallGlobalFunction( MagmaWithOne, function( arg ) return MagmaWithOneByGenerators( arg[1] ); # family plus list of generators - elif Length( arg ) = 2 and IsFamily( arg[1] ) and IsList( arg[1] ) then + elif Length( arg ) = 2 and IsFamily( arg[1] ) and IsList( arg[2] ) then return MagmaWithOneByGenerators( arg[1], arg[2] ); # generators @@ -495,7 +495,7 @@ InstallGlobalFunction( MagmaWithInverses, function( arg ) return MagmaWithInversesByGenerators( arg[1] ); # family plus list of generators - elif Length( arg ) = 2 and IsFamily( arg[1] ) and IsList( arg[1] ) then + elif Length( arg ) = 2 and IsFamily( arg[1] ) and IsList( arg[2] ) then return MagmaWithInversesByGenerators( arg[1], arg[2] ); # generators From 1ff514c8f96329431a0013c1cde2d9ea6e4ad382 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Tue, 24 Oct 2017 15:45:03 +0200 Subject: [PATCH 2/2] Add a test in tst/testbugfix that would have failed prior to fix --- tst/testbugfix/2017-10-23-MagmaWith.tst | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tst/testbugfix/2017-10-23-MagmaWith.tst diff --git a/tst/testbugfix/2017-10-23-MagmaWith.tst b/tst/testbugfix/2017-10-23-MagmaWith.tst new file mode 100644 index 0000000000..1492ed9edb --- /dev/null +++ b/tst/testbugfix/2017-10-23-MagmaWith.tst @@ -0,0 +1,10 @@ +# Issue related to MagmaWith[One|Inverses] with family specified +# +gap> MagmaWithOne(CollectionsFamily(PermutationsFamily), [(1,2),(1,2,3)]); +Group([ (1,2), (1,2,3) ]) +gap> Elements(last); +[ (), (2,3), (1,2), (1,2,3), (1,3,2), (1,3) ] +gap> MagmaWithInverses(CollectionsFamily(PermutationsFamily), [(1,2),(1,2,3)]); +Group([ (1,2), (1,2,3) ]) +gap> Elements(last); +[ (), (2,3), (1,2), (1,2,3), (1,3,2), (1,3) ]