diff --git a/src/bipart.cpp b/src/bipart.cpp index 2a4ae24f1..41f605161 100644 --- a/src/bipart.cpp +++ b/src/bipart.cpp @@ -273,6 +273,15 @@ Obj BIPART_PROD(Obj x, Obj y) { Bipartition* xx = bipart_get_cpp(x); Bipartition* yy = bipart_get_cpp(y); + if (xx->degree() != yy->degree()) { + // TODO implement a product_inplace checks version for bipartitions in + // Libsemigroups + ErrorMayQuit( + "the arguments and must have equal degrees but found %d <> %d", + xx->degree(), + yy->degree()); + } + Bipartition* z = new Bipartition(xx->degree()); z->product_inplace_no_checks(*xx, *yy); diff --git a/tst/testinstall.tst b/tst/testinstall.tst index 51542f941..b0002c73e 100644 --- a/tst/testinstall.tst +++ b/tst/testinstall.tst @@ -12,7 +12,7 @@ #@local bug, c, cong, contain, ec, es, f, file, g, gens, gns, hom, i, id, inv #@local iso, iter, latt, log, looking, lookingfor, map, mat, max, n, number, o #@local pair, pairs, r, regular, rel, rels, s, s1, s2, sgns, slist, small, t -#@local tab, tuples, u, x, y, z +#@local tab, tuples, u, x, y, z, a, b gap> START_TEST("Semigroups package: testinstall.tst"); gap> LoadPackage("semigroups", false);; @@ -1826,6 +1826,16 @@ gap> S := FreeBand(3);; gap> IsSelfDualSemigroup(S); true +# Issue https://github.com/semigroups/Semigroups/issues/1183 +# Previously permitted to take products of bipartitions of different +# degrees which was not intended. +gap> a := Bipartition([[1, -1, -2], [2, 5], [3, 4, -3], [-4, -5], [6, -6]]); + +gap> b := Bipartition([[1, -4], [2], [3, -1], [4], [5, -3], [-2], [-5]]); + +gap> a * b; +Error, the arguments and must have equal degrees but found 6 <> 5 + # gap> SEMIGROUPS.StopTest(); gap> STOP_TEST("Semigroups package: testinstall.tst");